diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-28 10:43:25 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-01-10 11:49:15 (GMT) |
commit | 63d3ca4c1cab0c7b9c71d6c051c3b4c053eb7627 (patch) | |
tree | 89afdc5f45057566afe0700d644585cb3fcbbcb2 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | 6ae19bf32e232beb59a0c427d82c0761e8248ab8 (diff) | |
download | CMake-63d3ca4c1cab0c7b9c71d6c051c3b4c053eb7627.zip CMake-63d3ca4c1cab0c7b9c71d6c051c3b4c053eb7627.tar.gz CMake-63d3ca4c1cab0c7b9c71d6c051c3b4c053eb7627.tar.bz2 |
AUTOGEN: Make skipMoc and skipUic blacklists behave the same way
Before skipMoc was a list of files that were not included in the
sources. Now the skipMoc files are added to the sources as well in case
they are needed for uic processing. skipMoc becomes a blacklist just like
skipUic.
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index f0847b1..0ed43b1 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -100,8 +100,8 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target) static void SetupSourceFiles(cmGeneratorTarget const* target, std::vector<std::string>& skipMoc, - std::vector<std::string>& mocSources, - std::vector<std::string>& mocHeaders, + std::vector<std::string>& sources, + std::vector<std::string>& headers, std::vector<std::string>& skipUic) { cmMakefile* makefile = target->Target->GetMakefile(); @@ -113,26 +113,39 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin(); fileIt != srcFiles.end(); ++fileIt) { cmSourceFile* sf = *fileIt; + const cmSystemTools::FileFormat fileType = + cmSystemTools::GetFileFormat(sf->GetExtension().c_str()); + + if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) && + !(fileType == cmSystemTools::HEADER_FILE_FORMAT)) { + continue; + } + if (cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { + continue; + } + const bool fileSkipUic = + cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")); + const bool fileSkipMoc = + cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC")); + if (fileSkipUic && fileSkipMoc) { + continue; + } + + // Use file const std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath()); - const std::string ext = sf->GetExtension(); - - if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"))) { + // Add file name to sources or headers list + if (fileType == cmSystemTools::CXX_FILE_FORMAT) { + sources.push_back(absFile); + } else if (fileType == cmSystemTools::HEADER_FILE_FORMAT) { + headers.push_back(absFile); + } + // Add file name to skip lists on demand + if (fileSkipUic) { skipUic.push_back(absFile); } - - if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { - if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"))) { - skipMoc.push_back(absFile); - } else { - cmSystemTools::FileFormat fileType = - cmSystemTools::GetFileFormat(ext.c_str()); - if (fileType == cmSystemTools::CXX_FILE_FORMAT) { - mocSources.push_back(absFile); - } else if (fileType == cmSystemTools::HEADER_FILE_FORMAT) { - mocHeaders.push_back(absFile); - } - } + if (fileSkipMoc) { + skipMoc.push_back(absFile); } } } |