summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-27 19:27:40 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-27 19:33:19 (GMT)
commit4d08e6b6dd21658bdcdc4dc1cd2a2b03d377d531 (patch)
tree07392ac2006dff3be6c5af20330e34defb4d145f /Source/cmQtAutoGenerators.cxx
parent7910cb7cfb6b8a1dd3424327d667f6df5fc60b0a (diff)
downloadCMake-4d08e6b6dd21658bdcdc4dc1cd2a2b03d377d531.zip
CMake-4d08e6b6dd21658bdcdc4dc1cd2a2b03d377d531.tar.gz
CMake-4d08e6b6dd21658bdcdc4dc1cd2a2b03d377d531.tar.bz2
QtAutogen: Fix rcc rebuild with Ninja generator (#15459)
The rcc outputs are byproducts of the cmake_autogen rule, not outputs. We still must run cmake_autogen on every run even if the rcc outputs exist. Ninja requires explicit byproduct specification, which is now possible in CMake since commit v3.2.0-rc1~340^2~2 (Add an option for explicit BYPRODUCTS of custom commands, 2014-11-13). Revise the logic introduced by commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their input changes, 2014-09-17) to specify byproducts explicitly.
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 08092c7..4cb49c8 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -374,7 +374,9 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
#endif
std::vector<std::string> rcc_output;
- if(makefile->GetLocalGenerator()->GetGlobalGenerator()->GetName() == "Ninja"
+ bool const isNinja =
+ makefile->GetLocalGenerator()->GetGlobalGenerator()->GetName() == "Ninja";
+ if(isNinja
#if defined(_WIN32) && !defined(__CYGWIN__)
|| usePRE_BUILD
#endif
@@ -444,7 +446,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
#endif
{
cmTarget* autogenTarget = 0;
- if (!rcc_output.empty())
+ if (!rcc_output.empty() && !isNinja)
{
std::vector<std::string> no_byproducts;
makefile->AddCustomCommandToOutput(rcc_output, no_byproducts,
@@ -464,7 +466,8 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
{
autogenTarget = makefile->AddUtilityCommand(
autogenTargetName, true,
- workingDirectory.c_str(), depends,
+ workingDirectory.c_str(),
+ /*byproducts=*/rcc_output, depends,
commandLines, false, autogenComment.c_str());
}