summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-02-15 09:36:51 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-02-19 11:35:42 (GMT)
commit5bb997c24a7ba8b6f252cc7914858f5c12a543b6 (patch)
tree32d1593971bf45f2eb3dd583382c0533107efc6f /Source/cmQtAutoGenerators.cxx
parenta9e3c903b6f74d181c76d1a2014a3af2babe6e41 (diff)
downloadCMake-5bb997c24a7ba8b6f252cc7914858f5c12a543b6.zip
CMake-5bb997c24a7ba8b6f252cc7914858f5c12a543b6.tar.gz
CMake-5bb997c24a7ba8b6f252cc7914858f5c12a543b6.tar.bz2
Autogen: Split moc compile options info string immediately
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 002e95b..ab9ca2c 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -335,8 +335,9 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
// - Moc
cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_MOC"),
this->SkipMoc);
- this->MocInfoCompileDefinitions =
- GetConfigDefinition(makefile, "AM_MOC_COMPILE_DEFINITIONS", config);
+ cmSystemTools::ExpandListArgument(
+ GetConfigDefinition(makefile, "AM_MOC_COMPILE_DEFINITIONS", config),
+ this->MocDefinitions);
this->MocInfoIncludes =
GetConfigDefinition(makefile, "AM_MOC_INCLUDES", config);
this->MocInfoOptions = makefile->GetSafeDefinition("AM_MOC_OPTIONS");
@@ -433,7 +434,8 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile,
// Compose current settings strings
if (this->MocEnabled()) {
std::string& str = this->SettingsStringMoc;
- str += this->MocInfoCompileDefinitions;
+ str +=
+ cmOutputConverter::EscapeForCMake(cmJoin(this->MocDefinitions, ";"));
str += " ~~~ ";
str += this->MocInfoIncludes;
str += " ~~~ ";
@@ -531,13 +533,6 @@ void cmQtAutoGenerators::Init()
this->ProjectSourceDir,
this->ProjectBinaryDir);
- std::vector<std::string> cdefList;
- cmSystemTools::ExpandListArgument(this->MocInfoCompileDefinitions, cdefList);
- for (std::vector<std::string>::const_iterator it = cdefList.begin();
- it != cdefList.end(); ++it) {
- this->MocDefinitions.push_back("-D" + (*it));
- }
-
cmSystemTools::ExpandListArgument(this->MocInfoOptions, this->MocOptions);
std::vector<std::string> incPaths;
@@ -1194,8 +1189,12 @@ bool cmQtAutoGenerators::MocGenerateFile(const std::string& sourceFile,
cmd.push_back(this->MocExecutable);
cmd.insert(cmd.end(), this->MocIncludes.begin(),
this->MocIncludes.end());
- cmd.insert(cmd.end(), this->MocDefinitions.begin(),
- this->MocDefinitions.end());
+ // Add definitions
+ for (std::vector<std::string>::const_iterator it =
+ this->MocDefinitions.begin();
+ it != this->MocDefinitions.end(); ++it) {
+ cmd.push_back("-D" + (*it));
+ }
cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end());
#ifdef _WIN32
cmd.push_back("-DWIN32");