Commit 1c196268 authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

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.
parent 7a31da43
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment