summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-10 18:53:59 (GMT)
committerBrad King <brad.king@kitware.com>2018-01-10 18:53:59 (GMT)
commitecfc729ad4db8ad743c277e3d82e7a64cf325b7c (patch)
treee528100340d0c95511d03739f94068c18acb6760 /Source
parent0cfcea334b305d47f291f776be422b9d9362d019 (diff)
parentd592bfc9f5f616249d85bbea94d8e76a666591a8 (diff)
downloadCMake-ecfc729ad4db8ad743c277e3d82e7a64cf325b7c.zip
CMake-ecfc729ad4db8ad743c277e3d82e7a64cf325b7c.tar.gz
CMake-ecfc729ad4db8ad743c277e3d82e7a64cf325b7c.tar.bz2
Merge branch 'backport-autogen-nexist-source-fix' into release-3.10
Merge-request: !1650
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index b02d872..89568c3 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -361,11 +361,16 @@ static void SetupAcquireSkipFiles(cmQtAutoGenDigest const& digest,
{
// Read skip files from makefile sources
{
- const std::vector<cmSourceFile*>& allSources =
- digest.Target->Makefile->GetSourceFiles();
- for (cmSourceFile* sf : allSources) {
+ std::string pathError;
+ for (cmSourceFile* sf : digest.Target->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) &&
@@ -540,9 +545,16 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest,
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 file should be skipped