summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-02-06 15:02:35 (GMT)
committerOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-02-06 15:02:35 (GMT)
commit16cc011fa56adae8946916fa457c5a833765002c (patch)
tree992bd2db18aaa1ff727dca5f07a02a6c5c7561e4 /Source
parentae667813deb5861c6f829eb8c2f944155f7cf8fe (diff)
downloadCMake-16cc011fa56adae8946916fa457c5a833765002c.zip
CMake-16cc011fa56adae8946916fa457c5a833765002c.tar.gz
CMake-16cc011fa56adae8946916fa457c5a833765002c.tar.bz2
cmQtAutoGenGlobalInitializer: Improve Const-correctness
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index 5e2f99f..591c53e 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -49,7 +49,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
bool globalAutoGenTarget = false;
bool globalAutoRccTarget = false;
{
- cmMakefile* makefile = localGen->GetMakefile();
+ cmMakefile const* makefile = localGen->GetMakefile();
// Detect global autogen target name
if (makefile->IsOn("CMAKE_GLOBAL_AUTOGEN_TARGET")) {
std::string targetName =
@@ -118,7 +118,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
target->GetSafeProperty(this->kw().AUTORCC_EXECUTABLE);
// We support Qt4, Qt5 and Qt6
- auto qtVersion =
+ auto const qtVersion =
cmQtAutoGenInitializer::GetQtVersion(target.get(), mocExec);
bool const validQt = (qtVersion.first.Major == 4) ||
(qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
@@ -167,7 +167,7 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
{
// Test if the target already exists
if (localGen->FindGeneratorTargetToUse(name) == nullptr) {
- cmMakefile* makefile = localGen->GetMakefile();
+ cmMakefile const* makefile = localGen->GetMakefile();
// Create utility target
auto cc = cm::make_unique<cmCustomCommand>();
@@ -192,9 +192,10 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
cmLocalGenerator* localGen, std::string const& targetName)
{
- auto it = this->GlobalAutoGenTargets_.find(localGen);
+ auto const it = this->GlobalAutoGenTargets_.find(localGen);
if (it != this->GlobalAutoGenTargets_.end()) {
- cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+ cmGeneratorTarget const* target =
+ localGen->FindGeneratorTargetToUse(it->second);
if (target != nullptr) {
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
}
@@ -204,9 +205,10 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
cmLocalGenerator* localGen, std::string const& targetName)
{
- auto it = this->GlobalAutoRccTargets_.find(localGen);
+ auto const it = this->GlobalAutoRccTargets_.find(localGen);
if (it != this->GlobalAutoRccTargets_.end()) {
- cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+ cmGeneratorTarget const* target =
+ localGen->FindGeneratorTargetToUse(it->second);
if (target != nullptr) {
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
}
@@ -216,7 +218,7 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
std::string const& generator, cmQtAutoGen::ConfigString const& executable,
- std::string& error, bool const isMultiConfig, bool UseBetterGraph)
+ std::string& error, bool const isMultiConfig, bool const UseBetterGraph)
{
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> res;
if (isMultiConfig && UseBetterGraph) {
@@ -275,7 +277,7 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
// Check if we have cached features
{
- auto it = this->CompilerFeatures_.Default.find(executable.Default);
+ auto const it = this->CompilerFeatures_.Default.find(executable.Default);
if (it != this->CompilerFeatures_.Default.end()) {
res.Default = it->second;
return res;