summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.cxx
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-09-20 12:12:34 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-26 15:54:26 (GMT)
commitbac468ddfd5eb207d64af527fa12466ceecee0dd (patch)
treef9429f34978b98226fbfca35d919f5ad035909e8 /Source/cmQtAutoGenInitializer.cxx
parentc3f0825d3c0876829d066493a3fc0f0a516fb0f2 (diff)
downloadCMake-bac468ddfd5eb207d64af527fa12466ceecee0dd.zip
CMake-bac468ddfd5eb207d64af527fa12466ceecee0dd.tar.gz
CMake-bac468ddfd5eb207d64af527fa12466ceecee0dd.tar.bz2
AutoGen: Fix regression in timestamps on multi-config generators
Since commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for per-config values, 2023-06-14) we do not correctly generate outputs for one configuration after another configuration has been built. Fix this: - Revert some config based stuff for `Xcode` due to the `$<CONFIG>` genex usage limitation in source files with `Xcode`. - For multi-config generators use a per-config `timestamp_$<CONFIG>` file instead of one `timestamp` file. Fixes: #25261
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index d6d3999..a33c5db 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1175,7 +1175,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// Path checksum
qrc.QrcPathChecksum = this->PathCheckSum.getPart(qrc.QrcFile);
// Output file name
- if (this->CrossConfig) {
+ if (this->MultiConfig && !this->GlobalGen->IsXcode()) {
qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
"_$<CONFIG>", "/qrc_", qrc.QrcName, ".cpp");
} else {
@@ -1467,7 +1467,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
std::string outputFile;
std::string depFile;
// Create the custom command that outputs the timestamp file.
- if (this->MultiConfig && this->CrossConfig) {
+ if (this->MultiConfig) {
// create timestamp file with $<CONFIG> in the name so that
// every cmake_autogen target has its own timestamp file
std::string const configView = "$<CONFIG>";
@@ -1577,6 +1577,12 @@ void cmQtAutoGenInitializer::AddCMakeProcessToCommandLines(
commandLines.push_back(cmMakeCommandLine(
{ cmSystemTools::GetCMakeCommand(), "-E", processName, infoFile,
"$<CONFIG>", "$<COMMAND_CONFIG:$<CONFIG>>" }));
+ } else if (this->MultiConfig && this->GlobalGen->IsXcode()) {
+ for (std::string const& config : this->ConfigsList) {
+ commandLines.push_back(
+ cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
+ processName, infoFile, config }));
+ }
} else {
std::string autoInfoFileConfig;
if (this->MultiConfig) {
@@ -1934,6 +1940,7 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
info.SetBool("MULTI_CONFIG", this->MultiConfig);
info.SetBool("CROSS_CONFIG", this->CrossConfig);
info.SetUInt("VERBOSITY", this->Verbosity);
+ info.Set("GENERATOR", this->GlobalGen->GetName());
// Files
info.Set("LOCK_FILE", qrc.LockFile);