Merge branch 'backport-autogen-nexist-source-fix' into release-3.10

Merge-request: !1650
This commit is contained in:
Brad King 2018-01-10 13:53:59 -05:00
commit ecfc729ad4

View File

@ -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