mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 20:00:51 -05:00
cmQtAutoGenGlobalInitializer: Improve Const-correctness
This commit is contained in:
@@ -49,7 +49,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
|||||||
bool globalAutoGenTarget = false;
|
bool globalAutoGenTarget = false;
|
||||||
bool globalAutoRccTarget = false;
|
bool globalAutoRccTarget = false;
|
||||||
{
|
{
|
||||||
cmMakefile* makefile = localGen->GetMakefile();
|
cmMakefile const* makefile = localGen->GetMakefile();
|
||||||
// Detect global autogen target name
|
// Detect global autogen target name
|
||||||
if (makefile->IsOn("CMAKE_GLOBAL_AUTOGEN_TARGET")) {
|
if (makefile->IsOn("CMAKE_GLOBAL_AUTOGEN_TARGET")) {
|
||||||
std::string targetName =
|
std::string targetName =
|
||||||
@@ -118,7 +118,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
|||||||
target->GetSafeProperty(this->kw().AUTORCC_EXECUTABLE);
|
target->GetSafeProperty(this->kw().AUTORCC_EXECUTABLE);
|
||||||
|
|
||||||
// We support Qt4, Qt5 and Qt6
|
// We support Qt4, Qt5 and Qt6
|
||||||
auto qtVersion =
|
auto const qtVersion =
|
||||||
cmQtAutoGenInitializer::GetQtVersion(target.get(), mocExec);
|
cmQtAutoGenInitializer::GetQtVersion(target.get(), mocExec);
|
||||||
bool const validQt = (qtVersion.first.Major == 4) ||
|
bool const validQt = (qtVersion.first.Major == 4) ||
|
||||||
(qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
|
(qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
|
||||||
@@ -167,7 +167,7 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
|
|||||||
{
|
{
|
||||||
// Test if the target already exists
|
// Test if the target already exists
|
||||||
if (localGen->FindGeneratorTargetToUse(name) == nullptr) {
|
if (localGen->FindGeneratorTargetToUse(name) == nullptr) {
|
||||||
cmMakefile* makefile = localGen->GetMakefile();
|
cmMakefile const* makefile = localGen->GetMakefile();
|
||||||
|
|
||||||
// Create utility target
|
// Create utility target
|
||||||
auto cc = cm::make_unique<cmCustomCommand>();
|
auto cc = cm::make_unique<cmCustomCommand>();
|
||||||
@@ -192,9 +192,10 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
|
|||||||
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
|
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
|
||||||
cmLocalGenerator* localGen, std::string const& targetName)
|
cmLocalGenerator* localGen, std::string const& targetName)
|
||||||
{
|
{
|
||||||
auto it = this->GlobalAutoGenTargets_.find(localGen);
|
auto const it = this->GlobalAutoGenTargets_.find(localGen);
|
||||||
if (it != this->GlobalAutoGenTargets_.end()) {
|
if (it != this->GlobalAutoGenTargets_.end()) {
|
||||||
cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
|
cmGeneratorTarget const* target =
|
||||||
|
localGen->FindGeneratorTargetToUse(it->second);
|
||||||
if (target != nullptr) {
|
if (target != nullptr) {
|
||||||
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
|
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
|
||||||
}
|
}
|
||||||
@@ -204,9 +205,10 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
|
|||||||
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
|
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
|
||||||
cmLocalGenerator* localGen, std::string const& targetName)
|
cmLocalGenerator* localGen, std::string const& targetName)
|
||||||
{
|
{
|
||||||
auto it = this->GlobalAutoRccTargets_.find(localGen);
|
auto const it = this->GlobalAutoRccTargets_.find(localGen);
|
||||||
if (it != this->GlobalAutoRccTargets_.end()) {
|
if (it != this->GlobalAutoRccTargets_.end()) {
|
||||||
cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
|
cmGeneratorTarget const* target =
|
||||||
|
localGen->FindGeneratorTargetToUse(it->second);
|
||||||
if (target != nullptr) {
|
if (target != nullptr) {
|
||||||
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
|
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
|
||||||
}
|
}
|
||||||
@@ -216,7 +218,7 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
|
|||||||
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
|
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
|
||||||
cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
||||||
std::string const& generator, cmQtAutoGen::ConfigString const& executable,
|
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;
|
cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> res;
|
||||||
if (isMultiConfig && UseBetterGraph) {
|
if (isMultiConfig && UseBetterGraph) {
|
||||||
@@ -275,7 +277,7 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
|||||||
|
|
||||||
// Check if we have cached features
|
// 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()) {
|
if (it != this->CompilerFeatures_.Default.end()) {
|
||||||
res.Default = it->second;
|
res.Default = it->second;
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user