diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-10-09 12:03:18 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-10-09 12:35:17 (GMT) |
commit | 1c19626864d8622ac3a0f00b564ea1d7f0eb3971 (patch) | |
tree | c5e1a4f820f25d8c84fc5a205b1b0214ed056ea1 | |
parent | 7a31da43b1b598a255bf5261f7dff66e5aa71dd0 (diff) | |
download | CMake-1c19626864d8622ac3a0f00b564ea1d7f0eb3971.zip CMake-1c19626864d8622ac3a0f00b564ea1d7f0eb3971.tar.gz CMake-1c19626864d8622ac3a0f00b564ea1d7f0eb3971.tar.bz2 |
Autogen: Allow setting SKIP_AUTOUIC/GEN on .ui files not in the sources
SKIP_AUTOUIC and SKIP_AUTOGEN were ignored when set on a `.ui` file that
was not in the sources of the target.
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 217865b..e7080cd 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -452,8 +452,6 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest, cmGeneratorTarget const* target = digest.Target; cmMakefile* makefile = target->Target->GetMakefile(); - AddDefinitionEscaped(makefile, "_uic_skip", setup.UicSkip); - // Uic search paths { std::vector<std::string> uicSearchPaths; @@ -489,21 +487,25 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest, } } } - // Uic files options + // .ui files skip and options { std::vector<std::string> uiFileFiles; std::vector<std::vector<std::string>> uiFileOptions; { std::string const uiExt = "ui"; - const std::vector<cmSourceFile*>& srcFiles = makefile->GetSourceFiles(); - for (cmSourceFile* sf : srcFiles) { + for (cmSourceFile* sf : makefile->GetSourceFiles()) { // sf->GetExtension() is only valid after sf->GetFullPath() ... std::string const& fPath = sf->GetFullPath(); if (sf->GetExtension() == uiExt) { + std::string const absFile = cmSystemTools::GetRealPath(fPath); + // Check if the file should be skipped + if (sf->GetPropertyAsBool("SKIP_AUTOUIC") || + sf->GetPropertyAsBool("SKIP_AUTOGEN")) { + setup.UicSkip.insert(absFile); + } // Check if the files has uic options std::string const uicOpts = GetSafeProperty(sf, "AUTOUIC_OPTIONS"); if (!uicOpts.empty()) { - std::string const absFile = cmSystemTools::GetRealPath(fPath); // Check if file isn't skipped if (setup.UicSkip.count(absFile) == 0) { uiFileFiles.push_back(absFile); @@ -519,6 +521,8 @@ static void SetupAutoTargetUic(cmQtAutoGenDigest const& digest, AddDefinitionEscaped(makefile, "_qt_uic_options_options", uiFileOptions); } + AddDefinitionEscaped(makefile, "_uic_skip", setup.UicSkip); + // Uic executable { std::string err; |