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
This commit is contained in:
Brad King 2018-01-11 15:29:43 +00:00 committed by Kitware Robot
commit 8c450b316f

View File

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