diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-02 16:39:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-07 13:24:04 (GMT) |
commit | df74f3ff834cacdd46aff7366a479d8317315a7c (patch) | |
tree | 517f4c7c1bce775e3a4b53d63dfba0107c0ae348 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | bafbeaf19076f9ae94be2b8cdb845617674aaf99 (diff) | |
download | CMake-df74f3ff834cacdd46aff7366a479d8317315a7c.zip CMake-df74f3ff834cacdd46aff7366a479d8317315a7c.tar.gz CMake-df74f3ff834cacdd46aff7366a479d8317315a7c.tar.bz2 |
QtAutogen: Generate rcc output file names in one place only
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 8ddf5b6..f0847b1 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -109,8 +109,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, std::vector<cmSourceFile*> srcFiles; target->GetConfigCommonSourceFiles(srcFiles); - std::vector<std::string> rccOutput; - cmFilePathChecksum fpathCheckSum(makefile); for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin(); fileIt != srcFiles.end(); ++fileIt) { @@ -123,23 +121,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, skipUic.push_back(absFile); } - if (target->GetPropertyAsBool("AUTORCC")) { - if (ext == "qrc" && - !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) { - - // Run cmake again when .qrc file changes - makefile->AddCMakeDependFile(absFile); - - std::string rccOutputFile = GetAutogenTargetBuildDir(target); - rccOutputFile += fpathCheckSum.getPart(absFile); - rccOutputFile += "/qrc_"; - rccOutputFile += - cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile); - rccOutputFile += ".cpp"; - rccOutput.push_back(rccOutputFile); - } - } - if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"))) { skipMoc.push_back(absFile); @@ -154,18 +135,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, } } } - - // Add rcc output files as sources - for (std::vector<std::string>::const_iterator fileIt = rccOutput.begin(); - fileIt != rccOutput.end(); ++fileIt) { - const std::string& rccOutputFile = *fileIt; - // Add source - makefile->GetOrCreateSource(rccOutputFile, true); - const_cast<cmGeneratorTarget*>(target)->AddSource(rccOutputFile); - // Create output directory - cmSystemTools::MakeDirectory( - cmsys::SystemTools::GetFilenamePath(rccOutputFile)); - } } static void GetCompileDefinitionsAndDirectories( @@ -783,12 +752,19 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( const std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath()); + // Run cmake again when .qrc file changes + makefile->AddCMakeDependFile(absFile); + std::string rccOutputFile = autogenBuildDir; rccOutputFile += fpathCheckSum.getPart(absFile); rccOutputFile += "/qrc_"; rccOutputFile += cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile); rccOutputFile += ".cpp"; + + // Add rcc output file to origin target sources + makefile->GetOrCreateSource(rccOutputFile, true); + target->AddSource(rccOutputFile); // Register rcc output file as generated autogenOutputFiles.push_back(rccOutputFile); } |