diff options
author | Brad King <brad.king@kitware.com> | 2018-01-11 15:29:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-11 15:29:58 (GMT) |
commit | 8c450b316fdcc210df913e3824d51a8f426b6d07 (patch) | |
tree | 339a1f40106f0c7fd724a172a9160a89aacbeba5 /Source | |
parent | 66335350a35e37b347034e81b1d4c5f9218f22d5 (diff) | |
parent | be304fb8c0af5e3d9e32754f3a5b711a8d63cbda (diff) | |
download | CMake-8c450b316fdcc210df913e3824d51a8f426b6d07.zip CMake-8c450b316fdcc210df913e3824d51a8f426b6d07.tar.gz CMake-8c450b316fdcc210df913e3824d51a8f426b6d07.tar.bz2 |
Merge topic 'autogen-nexist-source-fix'
be304fb8 Merge branch 'backport-autogen-nexist-source-fix' into autogen-nexist-source-fix
d592bfc9 Autogen: Ignore not existing source files in cmMakefile
513eb014 Autogen: Ignore not existing source files in cmMakefile
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1651
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 14743de..de0ba4f 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -475,10 +475,16 @@ void cmQtAutoGeneratorInitializer::InitCustomTargets() } // Read skip files from makefile sources if (this->MocEnabled || this->UicEnabled) { - const std::vector<cmSourceFile*>& allSources = makefile->GetSourceFiles(); - for (cmSourceFile* sf : allSources) { + std::string pathError; + for (cmSourceFile* sf : makefile->GetSourceFiles()) { // sf->GetExtension() is only valid after sf->GetFullPath() ... - std::string const& fPath = sf->GetFullPath(); + // Since we're iterating over source files that might be not in the + // target we need to check for path errors (not existing files). + std::string const& fPath = sf->GetFullPath(&pathError); + if (!pathError.empty()) { + pathError.clear(); + continue; + } cmSystemTools::FileFormat const fileType = cmSystemTools::GetFileFormat(sf->GetExtension().c_str()); if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) && @@ -1188,9 +1194,16 @@ void cmQtAutoGeneratorInitializer::SetupCustomTargetsUic() std::vector<std::vector<std::string>> uiFileOptions; { std::string const uiExt = "ui"; + std::string pathError; for (cmSourceFile* sf : makefile->GetSourceFiles()) { // sf->GetExtension() is only valid after sf->GetFullPath() ... - std::string const& fPath = sf->GetFullPath(); + // Since we're iterating over source files that might be not in the + // target we need to check for path errors (not existing files). + std::string const& fPath = sf->GetFullPath(&pathError); + if (!pathError.empty()) { + pathError.clear(); + continue; + } if (sf->GetExtension() == uiExt) { std::string const absFile = cmSystemTools::GetRealPath(fPath); // Check if the .ui file should be skipped |