diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-09-23 11:21:10 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-09-25 08:31:06 (GMT) |
commit | 881e3cfbf96c7b4f48304d3dfc07899c2e6703de (patch) | |
tree | 2bc1dc0698e233e123056f670c8af484d469a073 /Source/cmQtAutoGenInitializer.cxx | |
parent | fc36f4410bcdb76ef23a07e5172cb57b41ff5ce3 (diff) | |
download | CMake-881e3cfbf96c7b4f48304d3dfc07899c2e6703de.zip CMake-881e3cfbf96c7b4f48304d3dfc07899c2e6703de.tar.gz CMake-881e3cfbf96c7b4f48304d3dfc07899c2e6703de.tar.bz2 |
Autogen: Variable renames and cleanups
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 3aba19d..0329ac7 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -123,7 +123,7 @@ bool StaticLibraryCycle(cmGeneratorTarget const* targetOrigin, return cycle; } -/** Sanitizes file search paths */ +/** Sanitizes file search paths. */ class SearchPathSanitizer { public: @@ -353,9 +353,6 @@ bool cmQtAutoGenInitializer::InitCustomTargets() // Include directory this->Dir.Include = cmStrCat(this->Dir.Build, "/include"); - if (this->MultiConfig) { - this->Dir.Include += "_$<CONFIG>"; - } // Per config include directories if (this->MultiConfig) { for (std::string const& cfg : this->ConfigsList) { @@ -363,6 +360,10 @@ bool cmQtAutoGenInitializer::InitCustomTargets() dir = cmStrCat(this->Dir.Build, "/include_", cfg); } } + this->Dir.IncludeGenExp = this->Dir.Include; + if (this->MultiConfig) { + this->Dir.IncludeGenExp += "_$<CONFIG>"; + } } // Moc, Uic and _autogen target settings @@ -454,7 +455,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets() // Add autogen include directory to the origin target INCLUDE_DIRECTORIES if (this->MocOrUicEnabled() || (this->Rcc.Enabled && this->MultiConfig)) { - this->GenTarget->AddIncludeDirectory(this->Dir.Include, true); + this->GenTarget->AddIncludeDirectory(this->Dir.IncludeGenExp, true); } // Scan files @@ -889,13 +890,15 @@ bool cmQtAutoGenInitializer::InitScanFiles() { cmFilePathChecksum const fpathCheckSum(this->Makefile); for (Qrc& qrc : this->Rcc.Qrcs) { - qrc.PathChecksum = fpathCheckSum.getPart(qrc.QrcFile); - // RCC output file name - qrc.RccFile = cmStrCat(this->Dir.Build, '/', qrc.PathChecksum, "/qrc_", - qrc.QrcName, ".cpp"); + // Path checksum + qrc.QrcPathChecksum = fpathCheckSum.getPart(qrc.QrcFile); + // Output file name + qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum, + "/qrc_", qrc.QrcName, ".cpp"); { - cm::string_view const baseSuffix = - qrc.Unique ? cm::string_view() : cm::string_view(qrc.PathChecksum); + cm::string_view const baseSuffix = qrc.Unique + ? cm::string_view() + : cm::string_view(qrc.QrcPathChecksum); std::string const base = cmStrCat(this->Dir.Info, "/RCC", qrc.QrcName, baseSuffix); qrc.LockFile = cmStrCat(base, ".lock"); @@ -910,7 +913,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() } } } - // RCC options + // rcc options for (Qrc& qrc : this->Rcc.Qrcs) { // Target options std::vector<std::string> opts = optionsTarget; @@ -920,7 +923,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() // Replace '-' with '_'. The former is not valid for symbol names. std::replace(name.begin(), name.end(), '-', '_'); if (!qrc.Unique) { - name += cmStrCat('_', qrc.PathChecksum); + name += cmStrCat('_', qrc.QrcPathChecksum); } std::vector<std::string> nameOpts; nameOpts.emplace_back("-name"); @@ -931,7 +934,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() RccMergeOptions(opts, qrc.Options, modernQt); qrc.Options = std::move(opts); } - // RCC resources + // rcc resources for (Qrc& qrc : this->Rcc.Qrcs) { if (!qrc.Generated) { std::string error; @@ -1099,10 +1102,10 @@ bool cmQtAutoGenInitializer::InitRccTargets() // Register info file as generated by CMake this->Makefile->AddCMakeOutputFile(qrc.InfoFile); // Register file at target - this->AddGeneratedSource(qrc.RccFile, this->Rcc); + this->AddGeneratedSource(qrc.OutputFile, this->Rcc); std::vector<std::string> ccOutput; - ccOutput.push_back(qrc.RccFile); + ccOutput.push_back(qrc.OutputFile); std::vector<std::string> ccDepends; // Add the .qrc and info file to the custom command dependencies @@ -1132,7 +1135,7 @@ bool cmQtAutoGenInitializer::InitRccTargets() { ccName = cmStrCat(this->GenTarget->GetName(), "_arcc_", qrc.QrcName); if (!qrc.Unique) { - ccName += cmStrCat('_', qrc.PathChecksum); + ccName += cmStrCat('_', qrc.QrcPathChecksum); } cmTarget* autoRccTarget = this->Makefile->AddUtilityCommand( @@ -1424,9 +1427,9 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo() ofs.Write("# Rcc job\n"); ofs.Write("ARCC_LOCK_FILE", qrc.LockFile); ofs.Write("ARCC_SOURCE", qrc.QrcFile); - ofs.Write("ARCC_OUTPUT_CHECKSUM", qrc.PathChecksum); + ofs.Write("ARCC_OUTPUT_CHECKSUM", qrc.QrcPathChecksum); ofs.Write("ARCC_OUTPUT_NAME", - cmSystemTools::GetFilenameName(qrc.RccFile)); + cmSystemTools::GetFilenameName(qrc.OutputFile)); ofs.WriteStrings("ARCC_OPTIONS", qrc.Options); ofs.WriteStrings("ARCC_INPUTS", qrc.Resources); } else { |