From f37f1a647d5aba4de5903a3a3dc7700be55c99ec Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 15 Feb 2017 10:47:54 +0100 Subject: Autogen: Split moc options info string immediately --- Source/cmQtAutoGenerators.cxx | 26 +++++++++++++++----------- Source/cmQtAutoGenerators.h | 1 - 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index ab9ca2c..56c09f8 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -154,13 +154,19 @@ static bool ListContains(const std::vector& list, return (std::find(list.begin(), list.end(), entry) != list.end()); } -static std::string JoinOptions(const std::map& opts) +static std::string JoinOptionsList(const std::vector& opts) +{ + return cmOutputConverter::EscapeForCMake(cmJoin(opts, ";")); +} + +static std::string JoinOptionsMap( + const std::map& opts) { std::string result; for (std::map::const_iterator it = opts.begin(); it != opts.end(); ++it) { if (it != opts.begin()) { - result += "%%%"; + result += "@list_sep@"; } result += it->first; result += "==="; @@ -340,7 +346,8 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( this->MocDefinitions); this->MocInfoIncludes = GetConfigDefinition(makefile, "AM_MOC_INCLUDES", config); - this->MocInfoOptions = makefile->GetSafeDefinition("AM_MOC_OPTIONS"); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_MOC_OPTIONS"), this->MocOptions); // - Uic cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_UIC"), @@ -434,26 +441,25 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, // Compose current settings strings if (this->MocEnabled()) { std::string& str = this->SettingsStringMoc; - str += - cmOutputConverter::EscapeForCMake(cmJoin(this->MocDefinitions, ";")); + str += JoinOptionsList(this->MocDefinitions); str += " ~~~ "; str += this->MocInfoIncludes; str += " ~~~ "; - str += this->MocInfoOptions; + str += JoinOptionsList(this->MocOptions); str += " ~~~ "; str += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; str += " ~~~ "; } if (this->UicEnabled()) { std::string& str = this->SettingsStringUic; - str += cmJoin(this->UicTargetOptions, "@osep@"); + str += JoinOptionsList(this->UicTargetOptions); str += " ~~~ "; - str += JoinOptions(this->UicOptions); + str += JoinOptionsMap(this->UicOptions); str += " ~~~ "; } if (this->RccEnabled()) { std::string& str = this->SettingsStringRcc; - str += JoinOptions(this->RccOptions); + str += JoinOptionsMap(this->RccOptions); str += " ~~~ "; } @@ -533,8 +539,6 @@ void cmQtAutoGenerators::Init() this->ProjectSourceDir, this->ProjectBinaryDir); - cmSystemTools::ExpandListArgument(this->MocInfoOptions, this->MocOptions); - std::vector incPaths; cmSystemTools::ExpandListArgument(this->MocInfoIncludes, incPaths); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index c9c31fc..ec9afef 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -144,7 +144,6 @@ private: // - Moc std::vector SkipMoc; std::string MocInfoIncludes; - std::string MocInfoOptions; std::string OutMocCppFilenameRel; std::string OutMocCppFilenameAbs; std::list MocIncludes; -- cgit v0.12