Commit a8ee7406 authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

Autogen: Improved multi-config include scheme

For multi configuration generators AUTOMOC generates the
moc files that are included in `mocs_compilation.cpp`
in `AUTOGEN_BUILD_DIR/include_$<CONFIG>/`. By doing so each
configuration reads different moc files when compiling
`mocs_compilation.cpp`. Since we do not (need to) rewrite
`mocs_compilation.cpp` on a configuration change anymore,
the files also does not need to be recompiled anymore.
Not having to rewrite and recompile `mocs_compilation.cpp`
on a configuration change anymore was the main objective of
this patch.

In a similar fashion AUTORCC generates a `qrc_BASE_CMAKE.cpp`
file below `AUTOGEN_BUILD_DIR/include_$<CONFIG>/` and
`qrc_BASE.cpp` becomes a mere wrapper that includes this
actuall rcc output file (when using multi configuration
generators).

The template files `Modules/AutoRccInfo.cmake.in` and
`Modules/AutogenInfo.cmake.in` were removed in favor
of writing the info `.cmake` files manually.

Closes #17230
parent 5a16e762
# Meta
set(ARCC_MULTI_CONFIG @_multi_config@)
# Directories and files
set(ARCC_BUILD_DIR @_build_dir@)
# Qt environment
set(ARCC_RCC_EXECUTABLE @_qt_rcc_executable@)
set(ARCC_RCC_LIST_OPTIONS @_qt_rcc_list_options@)
# Meta
set(AM_MULTI_CONFIG @_multi_config@)
set(AM_PARALLEL @_parallel@)
# Directories and files
set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
set(AM_BUILD_DIR @_build_dir@)
set(AM_SOURCES @_sources@)
set(AM_HEADERS @_headers@)
set(AM_SETTINGS_FILE @_settings_file@)
# Qt environment
set(AM_QT_VERSION_MAJOR @_qt_version_major@)
set(AM_QT_MOC_EXECUTABLE @_qt_moc_executable@)
set(AM_QT_UIC_EXECUTABLE @_qt_uic_executable@)
# MOC settings
set(AM_MOC_SKIP @_moc_skip@)
set(AM_MOC_DEFINITIONS @_moc_compile_defs@)
set(AM_MOC_INCLUDES @_moc_include_dirs@)
set(AM_MOC_OPTIONS @_moc_options@)
set(AM_MOC_RELAXED_MODE @_moc_relaxed_mode@)
set(AM_MOC_MACRO_NAMES @_moc_macro_names@)
set(AM_MOC_DEPEND_FILTERS @_moc_depend_filters@)
set(AM_MOC_PREDEFS_CMD @_moc_predefs_cmd@)
# UIC settings
set(AM_UIC_SKIP @_uic_skip@)
set(AM_UIC_TARGET_OPTIONS @_uic_target_options@)
set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@)
set(AM_UIC_OPTIONS_OPTIONS @_qt_uic_options_options@)
set(AM_UIC_SEARCH_PATHS @_uic_search_paths@)
...@@ -17,10 +17,6 @@ std::string const genNameMoc = "AutoMoc"; ...@@ -17,10 +17,6 @@ std::string const genNameMoc = "AutoMoc";
std::string const genNameUic = "AutoUic"; std::string const genNameUic = "AutoUic";
std::string const genNameRcc = "AutoRcc"; std::string const genNameRcc = "AutoRcc";
std::string const mcNameSingle = "SINGLE";
std::string const mcNameWrapper = "WRAPPER";
std::string const mcNameMulti = "MULTI";
// - Static functions // - Static functions
/// @brief Merges newOpts into baseOpts /// @brief Merges newOpts into baseOpts
...@@ -102,30 +98,6 @@ std::string cmQtAutoGen::GeneratorNameUpper(GeneratorT genType) ...@@ -102,30 +98,6 @@ std::string cmQtAutoGen::GeneratorNameUpper(GeneratorT genType)
return cmSystemTools::UpperCase(cmQtAutoGen::GeneratorName(genType)); return cmSystemTools::UpperCase(cmQtAutoGen::GeneratorName(genType));
} }
std::string const& cmQtAutoGen::MultiConfigName(MultiConfigT config)
{
switch (config) {
case MultiConfigT::SINGLE:
return mcNameSingle;
case MultiConfigT::WRAPPER:
return mcNameWrapper;
case MultiConfigT::MULTI:
return mcNameMulti;
}
return mcNameWrapper;
}
cmQtAutoGen::MultiConfigT cmQtAutoGen::MultiConfigType(std::string const& name)
{
if (name == mcNameSingle) {
return MultiConfigT::SINGLE;
}
if (name == mcNameMulti) {
return MultiConfigT::MULTI;
}
return MultiConfigT::WRAPPER;
}
std::string cmQtAutoGen::Quoted(std::string const& text) std::string cmQtAutoGen::Quoted(std::string const& text)
{ {
static const char* rep[18] = { "\\", "\\\\", "\"", "\\\"", "\a", "\\a", static const char* rep[18] = { "\\", "\\\\", "\"", "\\\"", "\a", "\\a",
......
...@@ -28,25 +28,12 @@ public: ...@@ -28,25 +28,12 @@ public:
RCC RCC
}; };
/// @brief Multiconfiguration type
enum class MultiConfigT
{
SINGLE, // Single configuration
WRAPPER, // Multi configuration using wrapper files
MULTI // Multi configuration using per config sources
};
public: public:
/// @brief Returns the generator name /// @brief Returns the generator name
static std::string const& GeneratorName(GeneratorT genType); static std::string const& GeneratorName(GeneratorT genType);
/// @brief Returns the generator name in upper case /// @brief Returns the generator name in upper case
static std::string GeneratorNameUpper(GeneratorT genType); static std::string GeneratorNameUpper(GeneratorT genType);
/// @brief Returns the multi configuration name string
static std::string const& MultiConfigName(MultiConfigT config);
/// @brief Returns the multi configuration type
static MultiConfigT MultiConfigType(std::string const& name);
/// @brief Returns a the string escaped and enclosed in quotes /// @brief Returns a the string escaped and enclosed in quotes
static std::string Quoted(std::string const& text); static std::string Quoted(std::string const& text);
......
This diff is collapsed.
...@@ -21,6 +21,7 @@ public: ...@@ -21,6 +21,7 @@ public:
static std::string GetQtMinorVersion(cmGeneratorTarget const* target, static std::string GetQtMinorVersion(cmGeneratorTarget const* target,
std::string const& qtVersionMajor); std::string const& qtVersionMajor);
/// @brief Rcc job information
class Qrc class Qrc
{ {
public: public:
...@@ -55,8 +56,7 @@ private: ...@@ -55,8 +56,7 @@ private:
void SetupCustomTargetsMoc(); void SetupCustomTargetsMoc();
void SetupCustomTargetsUic(); void SetupCustomTargetsUic();
std::vector<std::string> AddGeneratedSource(std::string const& filename, void AddGeneratedSource(std::string const& filename, GeneratorT genType);
GeneratorT genType);
bool QtVersionGreaterOrEqual(unsigned long requestMajor, bool QtVersionGreaterOrEqual(unsigned long requestMajor,
unsigned long requestMinor) const; unsigned long requestMinor) const;
...@@ -70,15 +70,18 @@ private: ...@@ -70,15 +70,18 @@ private:
bool MocEnabled; bool MocEnabled;
bool UicEnabled; bool UicEnabled;
bool RccEnabled; bool RccEnabled;
bool MultiConfig;
// Qt // Qt
std::string QtVersionMajor; std::string QtVersionMajor;
std::string QtVersionMinor; std::string QtVersionMinor;
std::string MocExecutable;
std::string UicExecutable;
std::string RccExecutable; std::string RccExecutable;
std::vector<std::string> RccListOptions; std::vector<std::string> RccListOptions;
// Configurations // Configurations
std::string ConfigDefault; std::string ConfigDefault;
std::vector<std::string> ConfigsList; std::vector<std::string> ConfigsList;
MultiConfigT MultiConfig; std::string Parallel;
// Names // Names
std::string AutogenTargetName; std::string AutogenTargetName;
std::string AutogenFolder; std::string AutogenFolder;
...@@ -91,11 +94,21 @@ private: ...@@ -91,11 +94,21 @@ private:
// Sources // Sources
std::vector<std::string> Headers; std::vector<std::string> Headers;
std::vector<std::string> Sources; std::vector<std::string> Sources;
// Moc
std::string MocPredefsCmd;
std::set<std::string> MocSkip; std::set<std::string> MocSkip;
std::string MocIncludes;
std::map<std::string, std::string> MocIncludesConfig;
std::string MocDefines;
std::map<std::string, std::string> MocDefinesConfig;
// Uic
std::set<std::string> UicSkip; std::set<std::string> UicSkip;
std::map<std::string, std::string> ConfigMocIncludes; std::vector<std::string> UicSearchPaths;
std::map<std::string, std::string> ConfigMocDefines; std::string UicOptions;
std::map<std::string, std::string> ConfigUicOptions; std::map<std::string, std::string> UicOptionsConfig;
std::vector<std::string> UicFileFiles;
std::vector<std::vector<std::string>> UicFileOptions;
// Rcc
std::vector<Qrc> Qrcs; std::vector<Qrc> Qrcs;
}; };
......
...@@ -672,19 +672,24 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk) ...@@ -672,19 +672,24 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk)
{ {
// Compute build file name // Compute build file name
if (!IncludeString.empty()) { if (!IncludeString.empty()) {
BuildFile = wrk.Base().AutogenIncludeDirAbs; BuildFile = wrk.Base().AutogenIncludeDir;
BuildFile += '/';
BuildFile += IncludeString; BuildFile += IncludeString;
} else { } else {
std::string buildRel = wrk.Base().FilePathChecksum.getPart(SourceFile); std::string rel = wrk.Base().FilePathChecksum.getPart(SourceFile);
buildRel += '/'; rel += "/moc_";
buildRel += "moc_"; rel += cmSystemTools::GetFilenameWithoutLastExtension(SourceFile);
buildRel += cmSystemTools::GetFilenameWithoutLastExtension(SourceFile); rel += ".cpp";
if (wrk.Base().MultiConfig != MultiConfigT::SINGLE) { // Register relative file path
buildRel += wrk.Base().ConfigSuffix; wrk.Gen().ParallelMocAutoRegister(rel);
// Absolute build path
if (wrk.Base().MultiConfig) {
BuildFile = wrk.Base().AutogenIncludeDir;
BuildFile += '/';
BuildFile += rel;
} else {
BuildFile = wrk.Base().AbsoluteBuildPath(rel);
} }
buildRel += ".cpp";
wrk.Gen().ParallelMocAutoRegister(buildRel);
BuildFile = wrk.Base().AbsoluteBuildPath(buildRel);
} }
if (UpdateRequired(wrk)) { if (UpdateRequired(wrk)) {
...@@ -871,7 +876,8 @@ void cmQtAutoGeneratorMocUic::JobMocT::GenerateMoc(WorkerT& wrk) ...@@ -871,7 +876,8 @@ void cmQtAutoGeneratorMocUic::JobMocT::GenerateMoc(WorkerT& wrk)
void cmQtAutoGeneratorMocUic::JobUicT::Process(WorkerT& wrk) void cmQtAutoGeneratorMocUic::JobUicT::Process(WorkerT& wrk)
{ {
// Compute build file name // Compute build file name
BuildFile = wrk.Base().AutogenIncludeDirAbs; BuildFile = wrk.Base().AutogenIncludeDir;
BuildFile += '/';
BuildFile += IncludeString; BuildFile += IncludeString;
if (UpdateRequired(wrk)) { if (UpdateRequired(wrk)) {
...@@ -1208,20 +1214,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) ...@@ -1208,20 +1214,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
} }
// -- Meta // -- Meta
Base_.MultiConfig = MultiConfigType(InfoGet("AM_MULTI_CONFIG")); Base_.MultiConfig = InfoGetBool("AM_MULTI_CONFIG");
Base_.ConfigSuffix = InfoGetConfig("AM_CONFIG_SUFFIX");
if (Base_.ConfigSuffix.empty()) {
Base_.ConfigSuffix = "_";
Base_.ConfigSuffix += InfoConfig();
}
SettingsFile_ = InfoGetConfig("AM_SETTINGS_FILE");
if (SettingsFile_.empty()) {
Log().ErrorFile(GeneratorT::GEN, InfoFile(), "Settings file name missing");
return false;
}
{ {
unsigned long num = Base_.NumThreads; unsigned long num = Base_.NumThreads;
if (cmSystemTools::StringToULong(InfoGet("AM_PARALLEL"), &num)) { if (cmSystemTools::StringToULong(InfoGet("AM_PARALLEL"), &num)) {
...@@ -1244,6 +1237,23 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) ...@@ -1244,6 +1237,23 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
"Autogen build directory missing"); "Autogen build directory missing");
return false; return false;
} }
// include directory
{
std::string dirRel = InfoGetConfig("AM_INCLUDE_DIR");
if (dirRel.empty()) {
Log().ErrorFile(GeneratorT::GEN, InfoFile(),
"Autogen include directory missing");
return false;
}
Base_.AutogenIncludeDir = Base_.AbsoluteBuildPath(dirRel);
}
// - Files
SettingsFile_ = InfoGetConfig("AM_SETTINGS_FILE");
if (SettingsFile_.empty()) {
Log().ErrorFile(GeneratorT::GEN, InfoFile(), "Settings file name missing");
return false;
}
// - Qt environment // - Qt environment
{ {
...@@ -1438,30 +1448,17 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) ...@@ -1438,30 +1448,17 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir, Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir,
Base().ProjectBinaryDir); Base().ProjectBinaryDir);
// include directory
Base_.AutogenIncludeDirRel = "include";
if (Base().MultiConfig != MultiConfigT::SINGLE) {
Base_.AutogenIncludeDirRel += Base().ConfigSuffix;
}
Base_.AutogenIncludeDirRel += "/";
Base_.AutogenIncludeDirAbs =
Base_.AbsoluteBuildPath(Base().AutogenIncludeDirRel);
// Moc variables // Moc variables
if (Moc().Enabled) { if (Moc().Enabled) {
// Mocs compilation file // Mocs compilation file
Moc_.CompFileRel = "mocs_compilation"; Moc_.CompFileAbs = Base().AbsoluteBuildPath("mocs_compilation.cpp");
if (Base_.MultiConfig == MultiConfigT::MULTI) {
Moc_.CompFileRel += Base().ConfigSuffix;
}
Moc_.CompFileRel += ".cpp";
Moc_.CompFileAbs = Base_.AbsoluteBuildPath(Moc().CompFileRel);
// Moc predefs file // Moc predefs file
if (!Moc_.PredefsCmd.empty()) { if (!Moc_.PredefsCmd.empty()) {
Moc_.PredefsFileRel = "moc_predefs"; Moc_.PredefsFileRel = "moc_predefs";
if (Base_.MultiConfig != MultiConfigT::SINGLE) { if (Base_.MultiConfig) {
Moc_.PredefsFileRel += Base().ConfigSuffix; Moc_.PredefsFileRel += '_';
Moc_.PredefsFileRel += InfoConfig();
} }
Moc_.PredefsFileRel += ".h"; Moc_.PredefsFileRel += ".h";
Moc_.PredefsFileAbs = Base_.AbsoluteBuildPath(Moc().PredefsFileRel); Moc_.PredefsFileAbs = Base_.AbsoluteBuildPath(Moc().PredefsFileRel);
...@@ -1731,7 +1728,7 @@ void cmQtAutoGeneratorMocUic::SettingsFileWrite() ...@@ -1731,7 +1728,7 @@ void cmQtAutoGeneratorMocUic::SettingsFileWrite()
void cmQtAutoGeneratorMocUic::CreateDirectories() void cmQtAutoGeneratorMocUic::CreateDirectories()
{ {
// Create AUTOGEN include directory // Create AUTOGEN include directory
if (!FileSys().MakeDirectory(GeneratorT::GEN, Base().AutogenIncludeDirAbs)) { if (!FileSys().MakeDirectory(GeneratorT::GEN, Base().AutogenIncludeDir)) {
RegisterJobError(); RegisterJobError();
} }
} }
...@@ -1980,9 +1977,10 @@ void cmQtAutoGeneratorMocUic::ParallelMocAutoUpdated() ...@@ -1980,9 +1977,10 @@ void cmQtAutoGeneratorMocUic::ParallelMocAutoUpdated()
void cmQtAutoGeneratorMocUic::MocGenerateCompilation() void cmQtAutoGeneratorMocUic::MocGenerateCompilation()
{ {
std::lock_guard<std::mutex> mocLock(JobsMutex_); std::lock_guard<std::mutex> mocLock(JobsMutex_);
if (!JobThreadsAbort_ && Moc().Enabled) { if (!JobError_ && Moc().Enabled) {
// Compose mocs compilation file content // Write mocs compilation build file
{ {
// Compose mocs compilation file content
std::string content = std::string content =
"// This file is autogenerated. Changes will be overwritten.\n"; "// This file is autogenerated. Changes will be overwritten.\n";
if (MocAutoFiles_.empty()) { if (MocAutoFiles_.empty()) {
...@@ -1992,19 +1990,22 @@ void cmQtAutoGeneratorMocUic::MocGenerateCompilation() ...@@ -1992,19 +1990,22 @@ void cmQtAutoGeneratorMocUic::MocGenerateCompilation()
content += "enum some_compilers { need_more_than_nothing };\n"; content += "enum some_compilers { need_more_than_nothing };\n";
} else { } else {
// Valid content // Valid content
char const sbeg = Base().MultiConfig ? '<' : '"';
char const send = Base().MultiConfig ? '>' : '"';
for (std::string const& mocfile : MocAutoFiles_) { for (std::string const& mocfile : MocAutoFiles_) {
content += "#include \""; content += "#include ";
content += sbeg;
content += mocfile; content += mocfile;
content += "\"\n"; content += send;
content += '\n';
} }
} }
std::string const& compRel = Moc().CompFileRel;
std::string const& compAbs = Moc().CompFileAbs; std::string const& compAbs = Moc().CompFileAbs;
if (FileSys().FileDiffers(compAbs, content)) { if (FileSys().FileDiffers(compAbs, content)) {
// Actually write mocs compilation file // Actually write mocs compilation file
if (Log().Verbose()) { if (Log().Verbose()) {
Log().Info(GeneratorT::MOC, "Generating MOC compilation " + compRel); Log().Info(GeneratorT::MOC, "Generating MOC compilation " + compAbs);
} }
if (!FileSys().FileWrite(GeneratorT::MOC, compAbs, content)) { if (!FileSys().FileWrite(GeneratorT::MOC, compAbs, content)) {
Log().ErrorFile(GeneratorT::MOC, compAbs, Log().ErrorFile(GeneratorT::MOC, compAbs,
...@@ -2015,10 +2016,13 @@ void cmQtAutoGeneratorMocUic::MocGenerateCompilation() ...@@ -2015,10 +2016,13 @@ void cmQtAutoGeneratorMocUic::MocGenerateCompilation()
} else if (MocAutoFileUpdated_) { } else if (MocAutoFileUpdated_) {
// Only touch mocs compilation file // Only touch mocs compilation file
if (Log().Verbose()) { if (Log().Verbose()) {
Log().Info(GeneratorT::MOC, "Touching mocs compilation " + compRel); Log().Info(GeneratorT::MOC, "Touching mocs compilation " + compAbs);
} }
FileSys().Touch(compAbs); FileSys().Touch(compAbs);
} }
} }
// Write mocs compilation wrapper file
if (Base().MultiConfig) {
}
} }
} }
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
public: public:
// -- Volatile methods // -- Volatile methods
BaseSettingsT(FileSystem* fileSystem) BaseSettingsT(FileSystem* fileSystem)
: MultiConfig(MultiConfigT::WRAPPER) : MultiConfig(false)
, IncludeProjectDirsBefore(false) , IncludeProjectDirsBefore(false)
, QtVersionMajor(4) , QtVersionMajor(4)
, NumThreads(1) , NumThreads(1)
...@@ -83,8 +83,7 @@ public: ...@@ -83,8 +83,7 @@ public:
// -- Attributes // -- Attributes
// - Config // - Config
std::string ConfigSuffix; bool MultiConfig;
MultiConfigT MultiConfig;
bool IncludeProjectDirsBefore; bool IncludeProjectDirsBefore;
unsigned int QtVersionMajor; unsigned int QtVersionMajor;
unsigned int NumThreads; unsigned int NumThreads;
...@@ -94,8 +93,7 @@ public: ...@@ -94,8 +93,7 @@ public:
std::string CurrentSourceDir; std::string CurrentSourceDir;
std::string CurrentBinaryDir; std::string CurrentBinaryDir;
std::string AutogenBuildDir; std::string AutogenBuildDir;
std::string AutogenIncludeDirRel; std::string AutogenIncludeDir;
std::string AutogenIncludeDirAbs;
// - Files // - Files
cmFilePathChecksum FilePathChecksum; cmFilePathChecksum FilePathChecksum;
std::vector<std::string> HeaderExtensions; std::vector<std::string> HeaderExtensions;
...@@ -128,7 +126,6 @@ public: ...@@ -128,7 +126,6 @@ public:
bool SettingsChanged = false; bool SettingsChanged = false;
bool RelaxedMode = false; bool RelaxedMode = false;
std::string Executable; std::string Executable;
std::string CompFileRel;
std::string CompFileAbs; std::string CompFileAbs;
std::string PredefsFileRel; std::string PredefsFileRel;
std::string PredefsFileAbs; std::string PredefsFileAbs;
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
// -- Class methods // -- Class methods
cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc() cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
: SettingsChanged_(false) : MultiConfig_(false)
, MultiConfig_(MultiConfigT::WRAPPER) , SettingsChanged_(false)
, Stage_(StageT::SETTINGS_READ) , Stage_(StageT::SETTINGS_READ)
, Error_(false) , Error_(false)
, Generate_(false) , Generate_(false)
...@@ -31,16 +31,18 @@ cmQtAutoGeneratorRcc::~cmQtAutoGeneratorRcc() ...@@ -31,16 +31,18 @@ cmQtAutoGeneratorRcc::~cmQtAutoGeneratorRcc()
bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile) bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
{ {
// Utility lambdas // -- Utility lambdas
auto InfoGet = [makefile](const char* key) { auto InfoGet = [makefile](std::string const& key) {
return makefile->GetSafeDefinition(key); return makefile->GetSafeDefinition(key);
}; };
auto InfoGetList = [makefile](const char* key) -> std::vector<std::string> { auto InfoGetList =
[makefile](std::string const& key) -> std::vector<std::string> {
std::vector<std::string> list; std::vector<std::string> list;
cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition(key), list); cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition(key), list);
return list; return list;
}; };
auto InfoGetConfig = [makefile, this](const char* key) -> std::string { auto InfoGetConfig = [makefile,
this](std::string const& key) -> std::string {
const char* valueConf = nullptr; const char* valueConf = nullptr;
{ {
std::string keyConf = key; std::string keyConf = key;
...@@ -54,7 +56,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile) ...@@ -54,7 +56,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
return std::string(valueConf); return std::string(valueConf);
}; };
auto InfoGetConfigList = auto InfoGetConfigList =
[&InfoGetConfig](const char* key) -> std::vector<std::string> { [&InfoGetConfig](std::string const& key) -> std::vector<std::string> {
std::vector<std::string> list; std::vector<std::string> list;
cmSystemTools::ExpandListArgument(InfoGetConfig(key), list); cmSystemTools::ExpandListArgument(InfoGetConfig(key), list);
return list; return list;
...@@ -66,20 +68,23 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile) ...@@ -66,20 +68,23 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
return false; return false;
} }
// -- Meta // - Configurations
MultiConfig_ = MultiConfigType(InfoGet("ARCC_MULTI_CONFIG")); MultiConfig_ = makefile->IsOn("ARCC_MULTI_CONFIG");
ConfigSuffix_ = InfoGetConfig("ARCC_CONFIG_SUFFIX");
if (ConfigSuffix_.empty()) {
ConfigSuffix_ = "_";
ConfigSuffix_ += InfoConfig();
}
SettingsFile_ = InfoGetConfig("ARCC_SETTINGS_FILE");
// - Files and directories // - Directories
AutogenBuildDir_ = InfoGet("ARCC_BUILD_DIR"); AutogenBuildDir_ = InfoGet("ARCC_BUILD_DIR");
if (AutogenBuildDir_.empty()) {