diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2018-05-30 15:23:23 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2018-05-30 15:45:01 (GMT) |
commit | 41685c8ba0902cff1241886d966e796cecb82ae3 (patch) | |
tree | 119fd9d0418f55dc5b7090b86b121dd9f3baef9b | |
parent | 2930a198f610e729d73df6771d70119adac6df2e (diff) | |
download | CMake-41685c8ba0902cff1241886d966e796cecb82ae3.zip CMake-41685c8ba0902cff1241886d966e796cecb82ae3.tar.gz CMake-41685c8ba0902cff1241886d966e796cecb82ae3.tar.bz2 |
Autogen: Let AUTORCC generate output for all configurations
For multi configuration generators let AUTORCC generate
the rcc output for all configurations. This is a workaround
for the incomplete `$<CONFIG>` support in the DEPENDS and OUTPUT
clauses of a custom_command/custom_target. Since we can't depend
on the per-config rcc output file we somehow must ensure the successful
rcc build for one configuration doesn't shadow the need to rcc rebuild
for a second configuration.
Closes #18006
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 59f4eb8..d59f3a7 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -628,14 +628,26 @@ void cmQtAutoGenInitializer::InitCustomTargets() std::vector<std::string> ccOutput; ccOutput.push_back(qrc.RccFile); + cmCustomCommandLines commandLines; - { + if (this->MultiConfig) { + // Build for all configurations + for (std::string const& config : this->ConfigsList) { + cmCustomCommandLine currentLine; + currentLine.push_back(cmSystemTools::GetCMakeCommand()); + currentLine.push_back("-E"); + currentLine.push_back("cmake_autorcc"); + currentLine.push_back(qrc.InfoFile); + currentLine.push_back(config); + commandLines.push_back(std::move(currentLine)); + } + } else { cmCustomCommandLine currentLine; currentLine.push_back(cmSystemTools::GetCMakeCommand()); currentLine.push_back("-E"); currentLine.push_back("cmake_autorcc"); currentLine.push_back(qrc.InfoFile); - currentLine.push_back("$<CONFIGURATION>"); + currentLine.push_back("$<CONFIG>"); commandLines.push_back(std::move(currentLine)); } std::string ccComment = "Automatic RCC for "; |