mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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
This commit is contained in:
@@ -628,14 +628,26 @@ void cmQtAutoGenInitializer::InitCustomTargets()
|
|||||||
|
|
||||||
std::vector<std::string> ccOutput;
|
std::vector<std::string> ccOutput;
|
||||||
ccOutput.push_back(qrc.RccFile);
|
ccOutput.push_back(qrc.RccFile);
|
||||||
|
|
||||||
cmCustomCommandLines commandLines;
|
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;
|
cmCustomCommandLine currentLine;
|
||||||
currentLine.push_back(cmSystemTools::GetCMakeCommand());
|
currentLine.push_back(cmSystemTools::GetCMakeCommand());
|
||||||
currentLine.push_back("-E");
|
currentLine.push_back("-E");
|
||||||
currentLine.push_back("cmake_autorcc");
|
currentLine.push_back("cmake_autorcc");
|
||||||
currentLine.push_back(qrc.InfoFile);
|
currentLine.push_back(qrc.InfoFile);
|
||||||
currentLine.push_back("$<CONFIGURATION>");
|
currentLine.push_back("$<CONFIG>");
|
||||||
commandLines.push_back(std::move(currentLine));
|
commandLines.push_back(std::move(currentLine));
|
||||||
}
|
}
|
||||||
std::string ccComment = "Automatic RCC for ";
|
std::string ccComment = "Automatic RCC for ";
|
||||||
|
|||||||
Reference in New Issue
Block a user