summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx47
-rw-r--r--Source/cmQtAutoGenInitializer.h2
2 files changed, 23 insertions, 26 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index a1602bd..816d7e5 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -430,12 +430,8 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
cmSystemTools::ConvertToUnixSlashes(this->Dir.Work);
// Include directory
- this->ConfigFileNames(this->Dir.Include,
- cmStrCat(this->Dir.Build, "/include"), "");
- this->Dir.IncludeGenExp = this->Dir.Include.Default;
- if (this->MultiConfig) {
- this->Dir.IncludeGenExp += "_$<CONFIG>";
- }
+ this->ConfigFileNamesAndGenex(this->Dir.Include, this->Dir.IncludeGenExp,
+ cmStrCat(this->Dir.Build, "/include"), "");
}
// Moc, Uic and _autogen target settings
@@ -586,15 +582,9 @@ bool cmQtAutoGenInitializer::InitMoc()
cmStrCat(this->Dir.Build, "/mocs_compilation.cpp");
this->Moc.CompilationFileGenex = this->Moc.CompilationFile.Default;
} else {
- this->ConfigFileNames(this->Moc.CompilationFile,
- cmStrCat(this->Dir.Build, "/mocs_compilation"),
- ".cpp");
- if (this->MultiConfig) {
- this->Moc.CompilationFileGenex =
- cmStrCat(this->Dir.Build, "/mocs_compilation_$<CONFIG>.cpp"_s);
- } else {
- this->Moc.CompilationFileGenex = this->Moc.CompilationFile.Default;
- }
+ this->ConfigFileNamesAndGenex(
+ this->Moc.CompilationFile, this->Moc.CompilationFileGenex,
+ cmStrCat(this->Dir.Build, "/mocs_compilation"_s), ".cpp"_s);
}
// Moc predefs
@@ -966,17 +956,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
cmSystemTools::GetFilenameWithoutLastExtension(fullPath), ".h"_s);
ConfigString uiHeader;
- uiHeader.Default =
- cmStrCat(this->Dir.Build, "/include"_s, uiHeaderFilePath);
- auto uiHeaderGenex = uiHeader.Default;
- if (this->MultiConfig) {
- uiHeaderGenex = cmStrCat(this->Dir.Build, "/include_$<CONFIG>"_s,
- uiHeaderFilePath);
- for (std::string const& cfg : this->ConfigsList) {
- uiHeader.Config[cfg] = cmStrCat(this->Dir.Build, "/include_"_s,
- cfg, uiHeaderFilePath);
- }
- }
+ std::string uiHeaderGenex;
+ this->ConfigFileNamesAndGenex(
+ uiHeader, uiHeaderGenex, cmStrCat(this->Dir.Build, "/include"_s),
+ uiHeaderFilePath);
this->Uic.UiHeaders.emplace_back(
std::make_pair(uiHeader, uiHeaderGenex));
@@ -1790,6 +1773,18 @@ void cmQtAutoGenInitializer::ConfigFileNames(ConfigString& configString,
}
}
+void cmQtAutoGenInitializer::ConfigFileNamesAndGenex(
+ ConfigString& configString, std::string& genex, cm::string_view const prefix,
+ cm::string_view const suffix)
+{
+ this->ConfigFileNames(configString, prefix, suffix);
+ if (this->MultiConfig) {
+ genex = cmStrCat(prefix, "_$<CONFIG>"_s, suffix);
+ } else {
+ genex = configString.Default;
+ }
+}
+
void cmQtAutoGenInitializer::ConfigFileClean(ConfigString& configString)
{
this->AddCleanFile(configString.Default);
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index 9fe0cf0..d096315 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -141,6 +141,8 @@ private:
void ConfigFileNames(ConfigString& configString, cm::string_view prefix,
cm::string_view suffix);
+ void ConfigFileNamesAndGenex(ConfigString& configString, std::string& genex,
+ cm::string_view prefix, cm::string_view suffix);
void ConfigFileClean(ConfigString& configString);
std::string GetMocBuildPath(MUFile const& muf);