diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-02 16:21:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-07 13:24:03 (GMT) |
commit | bafbeaf19076f9ae94be2b8cdb845617674aaf99 (patch) | |
tree | fa66fe5b514e9dbf49ce28c0e920dc819c17da97 | |
parent | 8f437f3c35ae13c147e0d022a84774750d4a0a7a (diff) | |
download | CMake-bafbeaf19076f9ae94be2b8cdb845617674aaf99.zip CMake-bafbeaf19076f9ae94be2b8cdb845617674aaf99.tar.gz CMake-bafbeaf19076f9ae94be2b8cdb845617674aaf99.tar.bz2 |
QtAutogen: Add rcc output files to autogen target byproducts
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 3a46ab0..8ddf5b6 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -128,7 +128,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) { // Run cmake again when .qrc file changes - makefile->AddCMakeDependFile ( absFile ); + makefile->AddCMakeDependFile(absFile); std::string rccOutputFile = GetAutogenTargetBuildDir(target); rccOutputFile += fpathCheckSum.getPart(absFile); @@ -697,7 +697,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( if (target->GetPropertyAsBool("AUTOMOC")) { // Register moc compilation file as generated - autogenOutputFiles.push_back ( autogenBuildDir + "moc_compilation.cpp" ); + autogenOutputFiles.push_back(autogenBuildDir + "moc_compilation.cpp"); } // Initialize autogen target dependencies @@ -770,35 +770,33 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( } #endif - bool const isNinja = lg->GetGlobalGenerator()->GetName() == "Ninja"; - if (isNinja + if (target->GetPropertyAsBool("AUTORCC")) { + cmFilePathChecksum fpathCheckSum(makefile); + std::vector<cmSourceFile*> srcFiles; + target->GetConfigCommonSourceFiles(srcFiles); + for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin(); + fileIt != srcFiles.end(); ++fileIt) { + cmSourceFile* sf = *fileIt; + if (sf->GetExtension() == "qrc" && + !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) { + { + const std::string absFile = + cmsys::SystemTools::GetRealPath(sf->GetFullPath()); + + std::string rccOutputFile = autogenBuildDir; + rccOutputFile += fpathCheckSum.getPart(absFile); + rccOutputFile += "/qrc_"; + rccOutputFile += + cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile); + rccOutputFile += ".cpp"; + // Register rcc output file as generated + autogenOutputFiles.push_back(rccOutputFile); + } + if (lg->GetGlobalGenerator()->GetName() == "Ninja" #if defined(_WIN32) && !defined(__CYGWIN__) - || usePRE_BUILD + || usePRE_BUILD #endif - ) { - if (target->GetPropertyAsBool("AUTORCC")) { - cmFilePathChecksum fpathCheckSum(makefile); - std::vector<cmSourceFile*> srcFiles; - target->GetConfigCommonSourceFiles(srcFiles); - for (std::vector<cmSourceFile*>::const_iterator fileIt = - srcFiles.begin(); - fileIt != srcFiles.end(); ++fileIt) { - cmSourceFile* sf = *fileIt; - if (sf->GetExtension() == "qrc" && - !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) { - { - const std::string absFile = - cmsys::SystemTools::GetRealPath(sf->GetFullPath()); - - std::string rccOutputFile = GetAutogenTargetBuildDir(target); - rccOutputFile += fpathCheckSum.getPart(absFile); - rccOutputFile += "/qrc_"; - rccOutputFile += - cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile); - rccOutputFile += ".cpp"; - // Register rcc output file as generated - autogenOutputFiles.push_back(rccOutputFile); - } + ) { if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { RccListInputs(qtMajorVersion, sf, target, depends); #if defined(_WIN32) && !defined(__CYGWIN__) |