diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-02 16:42:21 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-10 13:46:21 (GMT) |
commit | f84193292cb36e26d13a3f1f56a1539f088e8827 (patch) | |
tree | 797f2c1cb1014e03fa9b2f8e5bfa7d7966eb3eb8 /Source/cmake.cxx | |
parent | 3c2e58eeb884adea8ee12462f7d471ab518a673f (diff) | |
download | CMake-f84193292cb36e26d13a3f1f56a1539f088e8827.zip CMake-f84193292cb36e26d13a3f1f56a1539f088e8827.tar.gz CMake-f84193292cb36e26d13a3f1f56a1539f088e8827.tar.bz2 |
Use new AddCacheEntry signatures
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 62ee380..7cafaee 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -605,9 +605,8 @@ void cmake::ProcessCacheArg(const std::string& var, const std::string& value, } } - this->AddCacheEntry(var, value.c_str(), - "No help, variable specified on the command line.", - type); + this->AddCacheEntry( + var, value, "No help, variable specified on the command line.", type); if (this->WarnUnusedCli) { if (!haveValue || @@ -1517,16 +1516,15 @@ void cmake::SetDirectoriesFromFile(const std::string& arg) int cmake::AddCMakePaths() { // Save the value in the cache - this->AddCacheEntry("CMAKE_COMMAND", - cmSystemTools::GetCMakeCommand().c_str(), + this->AddCacheEntry("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand(), "Path to CMake executable.", cmStateEnums::INTERNAL); #ifndef CMAKE_BOOTSTRAP - this->AddCacheEntry( - "CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), - "Path to ctest program executable.", cmStateEnums::INTERNAL); - this->AddCacheEntry( - "CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), - "Path to cpack program executable.", cmStateEnums::INTERNAL); + this->AddCacheEntry("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand(), + "Path to ctest program executable.", + cmStateEnums::INTERNAL); + this->AddCacheEntry("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand(), + "Path to cpack program executable.", + cmStateEnums::INTERNAL); #endif if (!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot() + "/Modules/CMake.cmake"))) { @@ -1538,7 +1536,7 @@ int cmake::AddCMakePaths() cmSystemTools::GetCMakeRoot()); return 0; } - this->AddCacheEntry("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), + this->AddCacheEntry("CMAKE_ROOT", cmSystemTools::GetCMakeRoot(), "Path to CMake installation.", cmStateEnums::INTERNAL); return 1; @@ -1886,7 +1884,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) this->LoadCache(); // restore the changed compilers for (SaveCacheEntry const& i : saved) { - this->AddCacheEntry(i.key, i.value.c_str(), i.help.c_str(), i.type); + this->AddCacheEntry(i.key, i.value, i.help.c_str(), i.type); } cmSystemTools::Message(warning.str()); // avoid reconfigure if there were errors @@ -1993,7 +1991,7 @@ int cmake::ActualConfigure() } if (!res) { this->AddCacheEntry( - "CMAKE_HOME_DIRECTORY", this->GetHomeDirectory().c_str(), + "CMAKE_HOME_DIRECTORY", this->GetHomeDirectory(), "Source directory with the top level CMakeLists.txt file for this " "project", cmStateEnums::INTERNAL); @@ -2038,19 +2036,17 @@ int cmake::ActualConfigure() } } if (!this->State->GetInitializedCacheValue("CMAKE_GENERATOR")) { - this->AddCacheEntry("CMAKE_GENERATOR", - this->GlobalGenerator->GetName().c_str(), + this->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName(), "Name of generator.", cmStateEnums::INTERNAL); - this->AddCacheEntry("CMAKE_EXTRA_GENERATOR", - this->GlobalGenerator->GetExtraGeneratorName().c_str(), - "Name of external makefile project generator.", - cmStateEnums::INTERNAL); + this->AddCacheEntry( + "CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName(), + "Name of external makefile project generator.", cmStateEnums::INTERNAL); if (!this->State->GetInitializedCacheValue("CMAKE_TOOLCHAIN_FILE")) { std::string envToolchain; if (cmSystemTools::GetEnv("CMAKE_TOOLCHAIN_FILE", envToolchain) && !envToolchain.empty()) { - this->AddCacheEntry("CMAKE_TOOLCHAIN_FILE", envToolchain.c_str(), + this->AddCacheEntry("CMAKE_TOOLCHAIN_FILE", envToolchain, "The CMake toolchain file", cmStateEnums::FILEPATH); } @@ -2069,9 +2065,9 @@ int cmake::ActualConfigure() return -2; } } else { - this->AddCacheEntry( - "CMAKE_GENERATOR_INSTANCE", this->GeneratorInstance.c_str(), - "Generator instance identifier.", cmStateEnums::INTERNAL); + this->AddCacheEntry("CMAKE_GENERATOR_INSTANCE", this->GeneratorInstance, + "Generator instance identifier.", + cmStateEnums::INTERNAL); } if (cmProp platformName = @@ -2087,8 +2083,7 @@ int cmake::ActualConfigure() return -2; } } else { - this->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", - this->GeneratorPlatform.c_str(), + this->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform, "Name of generator platform.", cmStateEnums::INTERNAL); } @@ -2104,8 +2099,7 @@ int cmake::ActualConfigure() return -2; } } else { - this->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", - this->GeneratorToolset.c_str(), + this->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset, "Name of generator toolset.", cmStateEnums::INTERNAL); } @@ -3540,7 +3534,7 @@ void cmake::SetSuppressDevWarnings(bool b) value = "FALSE"; } - this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", value.c_str(), + this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", value, "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", cmStateEnums::INTERNAL); @@ -3564,7 +3558,7 @@ void cmake::SetSuppressDeprecatedWarnings(bool b) value = "TRUE"; } - this->AddCacheEntry("CMAKE_WARN_DEPRECATED", value.c_str(), + this->AddCacheEntry("CMAKE_WARN_DEPRECATED", value, "Whether to issue warnings for deprecated " "functionality.", cmStateEnums::INTERNAL); @@ -3588,7 +3582,7 @@ void cmake::SetDevWarningsAsErrors(bool b) value = "TRUE"; } - this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_ERRORS", value.c_str(), + this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_ERRORS", value, "Suppress errors that are meant for" " the author of the CMakeLists.txt files.", cmStateEnums::INTERNAL); @@ -3612,7 +3606,7 @@ void cmake::SetDeprecatedWarningsAsErrors(bool b) value = "FALSE"; } - this->AddCacheEntry("CMAKE_ERROR_DEPRECATED", value.c_str(), + this->AddCacheEntry("CMAKE_ERROR_DEPRECATED", value, "Whether to issue deprecation errors for macros" " and functions.", cmStateEnums::INTERNAL); |