summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@users.noreply.gitlab.com>2024-03-17 23:00:00 (GMT)
committerVitaly Stakhovsky <vvs31415@users.noreply.gitlab.com>2024-03-17 23:05:37 (GMT)
commit1a49b439a548a5ccc573e85c86ef42ece1d267ae (patch)
tree5cb159207f37bb6665f8f089330bbb868c11adf4
parentf440439dee558273a32e4efa39e10a9ff6b479d5 (diff)
downloadCMake-1a49b439a548a5ccc573e85c86ef42ece1d267ae.zip
CMake-1a49b439a548a5ccc573e85c86ef42ece1d267ae.tar.gz
CMake-1a49b439a548a5ccc573e85c86ef42ece1d267ae.tar.bz2
Source: Use cmValue::IsOn and IsOff
Speed up a bit by calling members directly.
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx4
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackGenerator.cxx14
-rw-r--r--Source/CPack/cmCPackInnoSetupGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx6
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx4
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx6
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx2
-rw-r--r--Source/cmAddLibraryCommand.cxx2
-rw-r--r--Source/cmCacheManager.cxx2
-rw-r--r--Source/cmCommonTargetGenerator.cxx2
-rw-r--r--Source/cmComputeLinkInformation.cxx4
-rw-r--r--Source/cmComputeTargetDepends.cxx2
-rw-r--r--Source/cmConditionEvaluator.cxx6
-rw-r--r--Source/cmFindCommon.cxx2
-rw-r--r--Source/cmFindPackageCommand.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx14
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx18
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx8
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx12
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Source/cmMakefile.cxx10
-rw-r--r--Source/cmMakefileTargetGenerator.cxx13
-rw-r--r--Source/cmQtAutoGenInitializer.cxx4
-rw-r--r--Source/cmSourceFile.cxx2
-rw-r--r--Source/cmStandardLevelResolver.cxx16
-rw-r--r--Source/cmState.cxx2
-rw-r--r--Source/cmStateDirectory.cxx2
-rw-r--r--Source/cmTarget.cxx4
-rw-r--r--Source/cmTest.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx6
-rw-r--r--Source/cmXCodeScheme.cxx2
-rw-r--r--Source/cmake.cxx18
42 files changed, 121 insertions, 116 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 8047729..b3e5fe4 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -416,10 +416,10 @@ int cmCPackIFWGenerator::InitializeInternal()
}
if (cmValue ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
- this->OnlineOnly = cmIsOn(ifwDownloadAll);
+ this->OnlineOnly = ifwDownloadAll.IsOn();
} else if (cmValue cpackDownloadAll =
this->GetOption("CPACK_DOWNLOAD_ALL")) {
- this->OnlineOnly = cmIsOn(cpackDownloadAll);
+ this->OnlineOnly = cpackDownloadAll.IsOn();
} else {
this->OnlineOnly = false;
}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 6918b5e..3cc09da 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -235,7 +235,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions);
CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", this->CandleExtensions);
- if (!cmIsOn(GetOption("CPACK_WIX_SKIP_WIX_UI_EXTENSION"))) {
+ if (!GetOption("CPACK_WIX_SKIP_WIX_UI_EXTENSION").IsOn()) {
this->LightExtensions.insert("WixUIExtension");
}
CollectExtensions("CPACK_WIX_EXTENSIONS", this->LightExtensions);
@@ -255,7 +255,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
// if install folder is supposed to be set absolutely, the default
// component guid "*" cannot be used
- if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
+ if (GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER").IsOn()) {
this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID;
}
@@ -613,7 +613,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string cmCPackWIXGenerator::GetRootFolderId() const
{
- if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
+ if (GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER").IsOn()) {
return "";
}
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 41ea32c..7693891 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -527,7 +527,7 @@ cmCPackDebGenerator::~cmCPackDebGenerator() = default;
int cmCPackDebGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
- if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
+ if (this->GetOption("CPACK_SET_DESTDIR").IsOff()) {
this->SetOption("CPACK_SET_DESTDIR", "I_ON");
}
return this->Superclass::InitializeInternal();
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 8ba015c..52eacaa 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -156,7 +156,7 @@ int cmCPackExternalGenerator::InstallCMakeProject(
bool cmCPackExternalGenerator::StagingEnabled() const
{
- return !cmIsOff(this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
+ return !this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING").IsOff();
}
cmCPackExternalGenerator::cmCPackExternalVersionGenerator::
@@ -221,7 +221,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
root["setDestdir"] = false;
}
- root["stripFiles"] = !cmIsOff(this->Parent->GetOption("CPACK_STRIP_FILES"));
+ root["stripFiles"] = !this->Parent->GetOption("CPACK_STRIP_FILES").IsOff();
root["warnOnAbsoluteInstallDestination"] =
this->Parent->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION");
root["errorOnAbsoluteInstallDestination"] =
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index f0ea690..8f72ceb 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -187,7 +187,7 @@ int cmCPackGenerator::InstallProject()
std::string bareTempInstallDirectory =
this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
std::string tempInstallDirectoryStr = bareTempInstallDirectory;
- bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) ||
+ bool setDestDir = this->GetOption("CPACK_SET_DESTDIR").IsOn() ||
cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
if (!setDestDir) {
tempInstallDirectoryStr += this->GetPackagingInstallPrefix();
@@ -855,7 +855,7 @@ int cmCPackGenerator::InstallCMakeProject(
// strip on TRUE, ON, 1, one or several file names, but not on
// FALSE, OFF, 0 and an empty string
- if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES"))) {
+ if (!this->GetOption("CPACK_STRIP_FILES").IsOff()) {
mf.AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
}
// Remember the list of files before installation
@@ -1041,7 +1041,7 @@ int cmCPackGenerator::DoPackage()
return 0;
}
- if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
+ if (this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY").IsOn()) {
cmValue toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (toplevelDirectory && cmSystemTools::FileExists(*toplevelDirectory)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
@@ -1089,7 +1089,7 @@ int cmCPackGenerator::DoPackage()
"Remove old package file" << std::endl);
cmSystemTools::RemoveFile(*tempPackageFileName);
}
- if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY").IsOn()) {
tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
}
@@ -1231,14 +1231,14 @@ bool cmCPackGenerator::IsSet(const std::string& name) const
bool cmCPackGenerator::IsOn(const std::string& name) const
{
- return cmIsOn(this->GetOption(name));
+ return this->GetOption(name).IsOn();
}
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
{
cmValue ret = this->MakefileMap->GetDefinition(op);
if (cmNonempty(ret)) {
- return cmIsOff(*ret);
+ return ret.IsOff();
}
return false;
}
@@ -1560,7 +1560,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->IsRequired = this->IsOn(macroPrefix + "_REQUIRED");
component->IsDisabledByDefault = this->IsOn(macroPrefix + "_DISABLED");
component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") ||
- cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
+ this->GetOption("CPACK_DOWNLOAD_ALL").IsOn();
cmValue archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
if (cmNonempty(archiveFile)) {
diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx
index fcd0a5d..dd0065f 100644
--- a/Source/CPack/cmCPackInnoSetupGenerator.cxx
+++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx
@@ -34,7 +34,7 @@ bool cmCPackInnoSetupGenerator::CanGenerate()
int cmCPackInnoSetupGenerator::InitializeInternal()
{
- if (cmIsOn(GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY").IsOn()) {
cmCPackLogger(cmCPackLog::LOG_WARNING,
"Inno Setup Generator cannot work with "
"CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
@@ -938,7 +938,7 @@ bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
// Build the list of files to go into this archive
const std::string& zipListFileName =
cmStrCat(GetOption("CPACK_TEMPORARY_DIRECTORY"), "/winZip.filelist");
- const bool needQuotesInFile = cmIsOn(GetOption("CPACK_ZIP_NEED_QUOTES"));
+ const bool needQuotesInFile = GetOption("CPACK_ZIP_NEED_QUOTES").IsOn();
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName);
for (const std::string& i : component->Files) {
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 7749b29..43b1d76 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -365,7 +365,7 @@ int cmCPackNSISGenerator::PackageFiles()
if (anyDownloadedComponents) {
defines += "!define CPACK_USES_DOWNLOAD\n";
- if (cmIsOn(this->GetOption("CPACK_ADD_REMOVE"))) {
+ if (this->GetOption("CPACK_ADD_REMOVE").IsOn()) {
defines += "!define CPACK_NSIS_ADD_REMOVE\n";
}
}
@@ -412,7 +412,7 @@ int cmCPackNSISGenerator::PackageFiles()
int cmCPackNSISGenerator::InitializeInternal()
{
- if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY").IsOn()) {
cmCPackLogger(
cmCPackLog::LOG_WARNING,
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
@@ -801,7 +801,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
// size of the installed component.
std::string zipListFileName = cmStrCat(
this->GetOption("CPACK_TEMPORARY_DIRECTORY"), "/winZip.filelist");
- bool needQuotesInFile = cmIsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
+ bool needQuotesInFile = this->GetOption("CPACK_ZIP_NEED_QUOTES").IsOn();
unsigned long totalSize = 0;
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName);
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 74cbeef..62f03c1 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -297,7 +297,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
upload_as += "&MD5=";
- if (cmIsOn(this->GetOption("InternalTest"))) {
+ if (this->GetOption("InternalTest").IsOn()) {
upload_as += "ffffffffffffffffffffffffffffffff";
} else {
cmCryptoHash hasher(cmCryptoHash::AlgoMD5);
@@ -539,7 +539,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
fields = url.substr(pos + 1);
url.erase(pos);
}
- bool internalTest = cmIsOn(this->GetOption("InternalTest"));
+ bool internalTest = this->GetOption("InternalTest").IsOn();
// Get RETRY_COUNT and RETRY_DELAY values if they were set.
std::string retryDelayString = *this->GetOption("RetryDelay");
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b75df27..2018b73 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -522,8 +522,8 @@ bool cmCTestTestHandler::ProcessOptions()
{
// Update internal data structure from generic one
this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation"));
- this->SetUseUnion(cmIsOn(this->GetOption("UseUnion")));
- if (cmIsOn(this->GetOption("ScheduleRandom"))) {
+ this->SetUseUnion(this->GetOption("UseUnion").IsOn());
+ if (this->GetOption("ScheduleRandom").IsOn()) {
this->CTest->SetScheduleType("Random");
}
if (cmValue repeat = this->GetOption("Repeat")) {
@@ -609,7 +609,7 @@ bool cmCTestTestHandler::ProcessOptions()
if (val) {
this->ExcludeTestListFile = val;
}
- this->SetRerunFailed(cmIsOn(this->GetOption("RerunFailed")));
+ this->SetRerunFailed(this->GetOption("RerunFailed").IsOn());
return true;
}
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 0b104ea..3a47485 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -54,7 +54,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
switch (state->GetCacheEntryType(key)) {
case cmStateEnums::BOOL: {
auto bw = cm::make_unique<cmCursesBoolWidget>(this->EntryWidth, 1, 1, 1);
- bw->SetValueAsBool(cmIsOn(*value));
+ bw->SetValueAsBool(value.IsOn());
this->Entry = std::move(bw);
break;
}
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 29fc09b..fe71333 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -26,7 +26,7 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
// Library type defaults to value of BUILD_SHARED_LIBS, if it exists,
// otherwise it defaults to static library.
cmStateEnums::TargetType type = cmStateEnums::SHARED_LIBRARY;
- if (cmIsOff(mf.GetDefinition("BUILD_SHARED_LIBS"))) {
+ if (mf.GetDefinition("BUILD_SHARED_LIBS").IsOff()) {
type = cmStateEnums::STATIC_LIBRARY;
}
bool excludeFromAll = false;
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 5c25cb9..51b2300 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -577,7 +577,7 @@ cmValue cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
bool cmCacheManager::CacheEntry::GetPropertyAsBool(
const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 90f0d55..677bb48 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -295,7 +295,7 @@ std::string cmCommonTargetGenerator::GetAIXExports(std::string const&)
if (this->GeneratorTarget->IsAIX()) {
if (cmValue exportAll =
this->GeneratorTarget->GetProperty("AIX_EXPORT_ALL_SYMBOLS")) {
- if (cmIsOff(*exportAll)) {
+ if (exportAll.IsOff()) {
aixExports = "-n";
}
}
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c985767..b631610 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -646,7 +646,7 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
cmValue lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
- if (cmIsOn(lss)) {
+ if (lss.IsOn()) {
this->SetCurrentLinkType(LinkStatic);
} else {
this->SetCurrentLinkType(this->StartLinkType);
@@ -1451,7 +1451,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
// Lookup the starting link type from the target (linked statically?).
cmValue lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
- this->StartLinkType = cmIsOn(lss) ? LinkStatic : LinkShared;
+ this->StartLinkType = lss.IsOn() ? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 6763225..0bcc7b9 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -473,7 +473,7 @@ void cmComputeTargetDepends::ComputeIntermediateGraph()
} else {
if (cmValue optimizeDependencies =
gt->GetProperty("OPTIMIZE_DEPENDENCIES")) {
- if (cmIsOn(optimizeDependencies)) {
+ if (optimizeDependencies.IsOn()) {
this->OptimizeLinkDependencies(gt, intermediateEdges, initialEdges);
} else {
intermediateEdges = initialEdges;
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index eba4c57..5a2b33a 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -399,7 +399,7 @@ bool cmConditionEvaluator::GetBooleanValue(
// Check definition.
cmValue def = this->GetDefinitionIfUnquoted(arg);
- return !cmIsOff(def);
+ return !def.IsOff();
}
//=========================================================================
@@ -416,14 +416,14 @@ bool cmConditionEvaluator::GetBooleanValueOld(
return true;
}
cmValue def = this->GetDefinitionIfUnquoted(arg);
- return !cmIsOff(def);
+ return !def.IsOff();
}
// Old GetVariableOrNumber behavior.
cmValue def = this->GetDefinitionIfUnquoted(arg);
if (!def && std::atoi(arg.GetValue().c_str())) {
def = cmValue(arg.GetValue());
}
- return !cmIsOff(def);
+ return !def.IsOff();
}
//=========================================================================
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index bec6369..1a80961 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -207,7 +207,7 @@ void cmFindCommon::SelectDefaultSearchModes()
for (auto const& path : search_paths) {
cmValue def = this->Makefile->GetDefinition(path.second);
if (def) {
- path.first = !cmIsOn(*def);
+ path.first = !def.IsOn();
}
}
}
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 9b51b1a..d730339 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -628,7 +628,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
if (cmValue const def =
this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
- this->NoUserRegistry = !cmIsOn(*def);
+ this->NoUserRegistry = !def.IsOn();
} else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
}
@@ -638,7 +638,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
if (cmValue const def = this->Makefile->GetDefinition(
"CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY")) {
- this->NoSystemRegistry = !cmIsOn(*def);
+ this->NoSystemRegistry = !def.IsOn();
} else if (this->Makefile->IsOn(
"CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY")) {
this->NoSystemRegistry = true;
@@ -1420,7 +1420,7 @@ bool cmFindPackageCommand::HandlePackageMode(
// Try to load the config file if the directory is known
bool fileFound = false;
if (this->UseConfigFiles) {
- if (!cmIsOff(def)) {
+ if (!def.IsOff()) {
// Get the directory from the variable value.
std::string dir = *def;
cmSystemTools::ConvertToUnixSlashes(dir);
@@ -1440,7 +1440,7 @@ bool cmFindPackageCommand::HandlePackageMode(
}
// Search for the config file if it is not already found.
- if (cmIsOff(def) || !fileFound) {
+ if (def.IsOff() || !fileFound) {
fileFound = this->FindConfig();
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a40af8b..b1b38c5 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -918,7 +918,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
{
cmValue feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config);
- if (!cmIsOn(feature)) {
+ if (!feature.IsOn()) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies
return false;
}
@@ -1084,8 +1084,8 @@ cmValue cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const
bool cmGeneratorTarget::GetLanguageStandardRequired(
std::string const& lang) const
{
- return cmIsOn(
- this->GetPropertyWithPairedLanguageSupport(lang, "_STANDARD_REQUIRED"));
+ return this->GetPropertyWithPairedLanguageSupport(lang, "_STANDARD_REQUIRED")
+ .IsOn();
}
void cmGeneratorTarget::GetModuleDefinitionSources(
@@ -2422,7 +2422,7 @@ bool cmGeneratorTarget::MacOSXUseInstallNameDir() const
cmValue build_with_install_name =
this->GetProperty("BUILD_WITH_INSTALL_NAME_DIR");
if (build_with_install_name) {
- return cmIsOn(*build_with_install_name);
+ return build_with_install_name.IsOn();
}
cmPolicies::PolicyStatus cmp0068 = this->GetPolicyStatusCMP0068();
@@ -6768,7 +6768,7 @@ bool cmGeneratorTarget::IsFortranBuildingInstrinsicModules() const
{
if (cmValue prop =
this->GetProperty("Fortran_BUILDING_INSTRINSIC_MODULES")) {
- return cmIsOn(*prop);
+ return prop.IsOn();
}
return false;
}
@@ -7881,9 +7881,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
if (this->GetType() == cmStateEnums::SHARED_LIBRARY) {
std::string soProp = cmStrCat("IMPORTED_NO_SONAME", suffix);
if (cmValue config_no_soname = this->GetProperty(soProp)) {
- info.NoSOName = cmIsOn(*config_no_soname);
+ info.NoSOName = config_no_soname.IsOn();
} else if (cmValue no_soname = this->GetProperty("IMPORTED_NO_SONAME")) {
- info.NoSOName = cmIsOn(*no_soname);
+ info.NoSOName = no_soname.IsOn();
}
}
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 940f49d..a92faef 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -593,7 +593,7 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
for (auto& sg : groupFilesList) {
std::ostream* fout;
bool useProjectFile =
- cmIsOn(this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
+ this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE").IsOn() ||
this->Makefile->IsOn("CMAKE_GHS_NO_SOURCE_GROUP_FILE");
if (useProjectFile || sg.empty()) {
fout = &fout_proj;
@@ -764,7 +764,7 @@ std::string cmGhsMultiTargetGenerator::WriteObjectLangOverride(
bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()
{
if (cmValue p = this->GeneratorTarget->GetProperty("ghs_integrity_app")) {
- return cmIsOn(*p);
+ return p.IsOn();
}
std::vector<cmSourceFile*> sources;
this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 185bff9..818b1a0 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -223,7 +223,7 @@ std::string cmGlobalGenerator::SelectMakeProgram(
if (cmIsOff(makeProgram)) {
cmValue makeProgramCSTR =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- if (cmIsOff(makeProgramCSTR)) {
+ if (makeProgramCSTR.IsOff()) {
makeProgram = makeDefault;
} else {
makeProgram = *makeProgramCSTR;
@@ -336,7 +336,7 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
for (const auto& localGen : this->LocalGenerators) {
for (const auto& target : localGen->GetGeneratorTargets()) {
if (!target->CanCompileSources() ||
- cmIsOn(target->GetProperty("ghs_integrity_app"))) {
+ target->GetProperty("ghs_integrity_app").IsOn()) {
continue;
}
@@ -408,7 +408,7 @@ bool cmGlobalGenerator::CheckTargetsForPchCompilePdb() const
for (const auto& generator : this->LocalGenerators) {
for (const auto& target : generator->GetGeneratorTargets()) {
if (!target->CanCompileSources() ||
- cmIsOn(target->GetProperty("ghs_integrity_app"))) {
+ target->GetProperty("ghs_integrity_app").IsOn()) {
continue;
}
@@ -452,13 +452,13 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
"all generators must specify this->FindMakeProgramFile");
return false;
}
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile);
if (!setMakeProgram.empty()) {
mf->ReadListFile(setMakeProgram);
}
}
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
std::ostringstream err;
err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
@@ -2823,7 +2823,7 @@ void cmGlobalGenerator::AddGlobalTarget_Package(
} else {
cmValue noPackageAll =
mf->GetDefinition("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY");
- if (cmIsOff(noPackageAll)) {
+ if (noPackageAll.IsOff()) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -2891,7 +2891,7 @@ void cmGlobalGenerator::AddGlobalTarget_Test(
// by default. Enable it only if CMAKE_SKIP_TEST_ALL_DEPENDENCY is
// explicitly set to OFF.
if (cmValue noall = mf->GetDefinition("CMAKE_SKIP_TEST_ALL_DEPENDENCY")) {
- if (cmIsOff(noall)) {
+ if (noall.IsOff()) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -3015,7 +3015,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
gti.Depends.emplace_back(this->GetPreinstallTargetName());
} else {
cmValue noall = mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
- if (cmIsOff(noall)) {
+ if (noall.IsOff()) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -3097,7 +3097,7 @@ bool cmGlobalGenerator::UseFolderProperty() const
// If this property is defined, let the setter turn this on or off.
if (prop) {
- return cmIsOn(*prop);
+ return prop.IsOn();
}
// If CMP0143 is NEW `treat` "USE_FOLDERS" as ON. Otherwise `treat` it as OFF
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 4ba53ec..37bcc2c 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -124,7 +124,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
{
/* set primary target */
cmValue t = mf->GetDefinition("GHS_PRIMARY_TARGET");
- if (cmIsOff(t)) {
+ if (t.IsOff()) {
/* Use the value from `-A` or use `arm` */
std::string arch = "arm";
if (!cmIsOff(p)) {
@@ -297,18 +297,18 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout,
// Specify BSP option if supplied by user
// -- not all platforms require this entry in the project file
cmValue bspName = root->GetMakefile()->GetDefinition("GHS_BSP_NAME");
- if (!cmIsOff(bspName)) {
+ if (!bspName.IsOff()) {
fout << " -bsp " << *bspName << '\n';
}
// Specify OS DIR if supplied by user
// -- not all platforms require this entry in the project file
cmValue osDir = root->GetMakefile()->GetDefinition("GHS_OS_DIR");
- if (!cmIsOff(osDir)) {
+ if (!osDir.IsOff()) {
cmValue osDirOption =
root->GetMakefile()->GetDefinition("GHS_OS_DIR_OPTION");
fout << " ";
- if (cmIsOff(osDirOption)) {
+ if (osDirOption.IsOff()) {
fout << "";
} else {
fout << *osDirOption;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 30206b5..56748a5 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -698,7 +698,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
if (cmValue tgtMsg =
this->GetCMakeInstance()->GetState()->GetGlobalProperty(
"TARGET_MESSAGES")) {
- targetMessages = cmIsOn(*tgtMsg);
+ targetMessages = tgtMsg.IsOn();
}
if (targetMessages) {
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 68b4d1a..35b69af 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -390,7 +390,7 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion(
"CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM")) {
// If the value is some off/false value, then there is NO maximum set.
- if (cmIsOff(value)) {
+ if (value.IsOff()) {
return std::string();
}
// If the value is something else, trust that it is a valid SDK value.
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 9739a09..866ace2 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -740,7 +740,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
}
// inspect EXCLUDE_FROM_DEFAULT_BUILD[_<CONFIG>] properties
for (std::string const& i : configs) {
- if (cmIsOff(target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i))) {
+ if (target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i).IsOff()) {
activeConfigs.insert(i);
}
}
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 5305fec..6fdc32c 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -491,7 +491,7 @@ bool cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
// Visual Studio generators know how to lookup their build tool
// directly instead of needing a helper module to do it, so we
// do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetVSMakeProgram());
}
return true;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 98d77c6..8462a1a 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -269,7 +269,7 @@ bool cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf)
// The Xcode generator knows how to lookup its build tool
// directly instead of needing a helper module to do it, so we
// do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetXcodeBuildCommand());
}
return true;
@@ -4223,18 +4223,18 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects(
cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
bool removeHeaders = actionsOnByDefault & RemoveHeadersOnCopyByDefault;
- if (auto prop = gt->GetProperty(
+ if (cmValue prop = gt->GetProperty(
cmStrCat(embedPropertyName, "_REMOVE_HEADERS_ON_COPY"))) {
- removeHeaders = cmIsOn(*prop);
+ removeHeaders = prop.IsOn();
}
if (removeHeaders) {
attrs->AddObject(this->CreateString("RemoveHeadersOnCopy"));
}
bool codeSign = actionsOnByDefault & CodeSignOnCopyByDefault;
- if (auto prop =
+ if (cmValue prop =
gt->GetProperty(cmStrCat(embedPropertyName, "_CODE_SIGN_ON_COPY"))) {
- codeSign = cmIsOn(*prop);
+ codeSign = prop.IsOn();
}
if (codeSign) {
attrs->AddObject(this->CreateString("CodeSignOnCopy"));
@@ -5298,7 +5298,7 @@ bool cmGlobalXCodeGenerator::UseEffectivePlatformName(cmMakefile* mf) const
return mf->PlatformIsAppleEmbedded();
}
- return cmIsOn(*epnValue);
+ return epnValue.IsOn();
}
bool cmGlobalXCodeGenerator::ShouldStripResourcePath(cmMakefile*) const
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index 28aa5d9..f1bda8d 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -204,7 +204,7 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
target.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
// If CUDA_RESOLVE_DEVICE_SYMBOLS has been explicitly set we need
// to honor the value no matter what it is.
- return cmIsOn(*resolveDeviceSymbols);
+ return resolveDeviceSymbols.IsOn();
}
// Determine if we have any dependencies that require
@@ -213,7 +213,7 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
target.GetLinkClosure(config);
if (cm::contains(closure->Languages, "CUDA")) {
- if (cmIsOn(target.GetProperty("CUDA_SEPARABLE_COMPILATION"))) {
+ if (target.GetProperty("CUDA_SEPARABLE_COMPILATION").IsOn()) {
bool doDeviceLinking = false;
switch (target.GetType()) {
case cmStateEnums::SHARED_LIBRARY:
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 077404d..684dfda 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3424,7 +3424,7 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags(
const std::string mode = cmIsOn(PICValue) ? "PIE" : "NO_PIE";
std::string supported = "CMAKE_" + lang + "_LINK_" + mode + "_SUPPORTED";
- if (cmIsOff(this->Makefile->GetDefinition(supported))) {
+ if (this->Makefile->GetDefinition(supported).IsOff()) {
return;
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7bce1d2..7def1fe 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -898,7 +898,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepend(
// Add a dependency on the rule file itself unless an option to skip
// it is specifically enabled by the user or project.
cmValue nodep = this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY");
- if (cmIsOff(nodep)) {
+ if (nodep.IsOff()) {
depends.emplace_back(ruleFileName);
}
}
@@ -1532,7 +1532,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
if (haveDirectoryInfo) {
// Test whether we need to force Unix paths.
if (cmValue force = mf->GetDefinition("CMAKE_FORCE_UNIX_PATHS")) {
- if (!cmIsOff(force)) {
+ if (!force.IsOff()) {
cmSystemTools::SetForceUnixPaths(true);
}
}
@@ -1784,7 +1784,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
depends.clear();
cmValue noall =
this->Makefile->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
- if (cmIsOff(noall)) {
+ if (noall.IsOff()) {
// Drive the build before installing.
depends.emplace_back("all");
} else if (regenerate) {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index cfaac11..bd24f83 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2522,7 +2522,7 @@ void cmMakefile::ExpandVariablesCMP0019()
bool cmMakefile::IsOn(const std::string& name) const
{
- return cmIsOn(this->GetDefinition(name));
+ return this->GetDefinition(name).IsOn();
}
bool cmMakefile::IsSet(const std::string& name) const
@@ -4025,7 +4025,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
// Replace #cmakedefine instances.
if (this->cmDefineRegex.find(line)) {
cmValue def = this->GetDefinition(this->cmDefineRegex.match(2));
- if (!cmIsOff(def)) {
+ if (!def.IsOff()) {
const std::string indentation = this->cmDefineRegex.match(1);
cmSystemTools::ReplaceString(line,
cmStrCat("#", indentation, "cmakedefine"),
@@ -4043,7 +4043,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
cmStrCat("#", indentation, "cmakedefine01"),
cmStrCat("#", indentation, "define"));
output += line;
- if (!cmIsOff(def)) {
+ if (!def.IsOff()) {
output += " 1";
} else {
output += " 0";
@@ -4218,7 +4218,7 @@ cmValue cmMakefile::GetProperty(const std::string& prop, bool chain) const
bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
std::vector<std::string> cmMakefile::GetPropertyKeys() const
@@ -4625,7 +4625,7 @@ bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) const
{
// Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting.
if (cmValue val = this->GetDefinition(var)) {
- return cmIsOn(val);
+ return val.IsOn();
}
// Enable optional policy warnings with --debug-output, --trace,
// or --trace-expand.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ff509ce..960b358 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -65,7 +65,7 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
this->NoRuleMessages = false;
if (cmValue ruleStatus =
cm->GetState()->GetGlobalProperty("RULE_MESSAGES")) {
- this->NoRuleMessages = cmIsOff(*ruleStatus);
+ this->NoRuleMessages = ruleStatus.IsOff();
}
switch (this->GeneratorTarget->GetPolicyStatusCMP0113()) {
case cmPolicies::WARN:
@@ -244,7 +244,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
}
// add custom commands to the clean rules?
- bool const clean = cmIsOff(this->Makefile->GetProperty("CLEAN_NO_CUSTOM"));
+ bool const clean = this->Makefile->GetProperty("CLEAN_NO_CUSTOM").IsOff();
// First generate the object rule files. Save a list of all object
// files for this target.
@@ -613,8 +613,9 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
// Use compiler to generate dependencies, if supported.
bool const compilerGenerateDeps =
this->GlobalGenerator->SupportsCompilerDependencies() &&
- cmIsOn(this->Makefile->GetDefinition(
- cmStrCat("CMAKE_", lang, "_DEPENDS_USE_COMPILER")));
+ this->Makefile
+ ->GetDefinition(cmStrCat("CMAKE_", lang, "_DEPENDS_USE_COMPILER"))
+ .IsOn();
auto const scanner = compilerGenerateDeps ? cmDependencyScannerKind::Compiler
: cmDependencyScannerKind::CMake;
@@ -2082,7 +2083,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
"CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_OBJECTS";
if (cmValue val = this->Makefile->GetDefinition(responseVar)) {
if (!val->empty()) {
- return cmIsOn(val);
+ return val.IsOn();
}
}
@@ -2121,7 +2122,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForLibraries(
"CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_LIBRARIES";
if (cmValue val = this->Makefile->GetDefinition(responseVar)) {
if (!val->empty()) {
- return cmIsOn(val);
+ return val.IsOn();
}
}
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 3d2373d..0ccebfd 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -601,7 +601,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
if (this->Moc.Enabled) {
// Path prefix
- if (cmIsOn(this->GenTarget->GetProperty("AUTOMOC_PATH_PREFIX"))) {
+ if (this->GenTarget->GetProperty("AUTOMOC_PATH_PREFIX").IsOn()) {
this->Moc.PathPrefix = true;
}
@@ -657,7 +657,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
auto const& value =
this->GenTarget->GetProperty("AUTOGEN_USE_SYSTEM_INCLUDE");
if (value.IsSet()) {
- if (cmIsOn(value)) {
+ if (value.IsOn()) {
this->GenTarget->AddSystemIncludeDirectory(this->Dir.IncludeGenExp,
"CXX");
} else {
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 1be680a..22bd9fe 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -442,7 +442,7 @@ const std::string& cmSourceFile::GetSafeProperty(const std::string& prop) const
bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
void cmSourceFile::MarkAsGenerated()
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
index e814690..c9ed380 100644
--- a/Source/cmStandardLevelResolver.cxx
+++ b/Source/cmStandardLevelResolver.cxx
@@ -88,8 +88,10 @@ struct StandardLevelComputer
cmPolicies::PolicyStatus const cmp0128{ makefile->GetPolicyStatus(
cmPolicies::CMP0128) };
- bool const defaultExt{ cmIsOn(*makefile->GetDefinition(
- cmStrCat("CMAKE_", this->Language, "_EXTENSIONS_DEFAULT"))) };
+ bool const defaultExt{ makefile
+ ->GetDefinition(cmStrCat("CMAKE_", this->Language,
+ "_EXTENSIONS_DEFAULT"))
+ .IsOn() };
bool ext = true;
if (cmp0128 == cmPolicies::NEW) {
@@ -97,7 +99,7 @@ struct StandardLevelComputer
}
if (cmValue extPropValue = target->GetLanguageExtensions(this->Language)) {
- ext = cmIsOn(*extPropValue);
+ ext = extPropValue.IsOn();
}
std::string const type{ ext ? "EXTENSION" : "STANDARD" };
@@ -252,8 +254,10 @@ struct StandardLevelComputer
cmPolicies::PolicyStatus const cmp0128{ makefile->GetPolicyStatus(
cmPolicies::CMP0128) };
- bool const defaultExt{ cmIsOn(*makefile->GetDefinition(
- cmStrCat("CMAKE_", this->Language, "_EXTENSIONS_DEFAULT"))) };
+ bool const defaultExt{ makefile
+ ->GetDefinition(cmStrCat("CMAKE_", this->Language,
+ "_EXTENSIONS_DEFAULT"))
+ .IsOn() };
bool ext = true;
if (cmp0128 == cmPolicies::NEW) {
@@ -261,7 +265,7 @@ struct StandardLevelComputer
}
if (cmValue extPropValue = target->GetLanguageExtensions(this->Language)) {
- ext = cmIsOn(*extPropValue);
+ ext = extPropValue.IsOn();
}
std::string const type{ ext ? "EXTENSION" : "STANDARD" };
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d104268..bb11161 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -662,7 +662,7 @@ cmValue cmState::GetGlobalProperty(const std::string& prop)
bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
{
- return cmIsOn(this->GetGlobalProperty(prop));
+ return this->GetGlobalProperty(prop).IsOn();
}
void cmState::SetSourceDirectory(std::string const& sourceDirectory)
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 39353f3..343bee5 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -451,7 +451,7 @@ cmValue cmStateDirectory::GetProperty(const std::string& prop,
bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
std::vector<std::string> cmStateDirectory::GetPropertyKeys() const
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b8001ad..3f7e29b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2151,7 +2151,7 @@ void cmTarget::SetProperty(const std::string& prop, cmValue value)
}
if (prop == propIMPORTED_GLOBAL) {
- if (!cmIsOn(value)) {
+ if (!value.IsOn()) {
std::ostringstream e;
e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\""
<< this->impl->Name << "\")\n";
@@ -2845,7 +2845,7 @@ std::string const& cmTarget::GetSafeProperty(std::string const& prop) const
bool cmTarget::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
cmPropertyMap const& cmTarget::GetProperties() const
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 7c9969c..8a39144 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -50,7 +50,7 @@ cmValue cmTest::GetProperty(const std::string& prop) const
bool cmTest::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
void cmTest::SetProperty(const std::string& prop, cmValue value)
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 579c0db..bca4719 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1167,7 +1167,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
const char* privateReference = "True";
if (cmValue value = this->GeneratorTarget->GetProperty(
"VS_DOTNET_REFERENCES_COPY_LOCAL")) {
- if (cmIsOff(*value)) {
+ if (value.IsOff()) {
privateReference = "False";
}
}
@@ -4217,9 +4217,9 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions(
if (dpiAware) {
if (*dpiAware == "PerMonitor"_s) {
e2.Element("EnableDpiAwareness", "PerMonitorHighDPIAware");
- } else if (cmIsOn(*dpiAware)) {
+ } else if (dpiAware.IsOn()) {
e2.Element("EnableDpiAwareness", "true");
- } else if (cmIsOff(*dpiAware)) {
+ } else if (dpiAware.IsOff()) {
e2.Element("EnableDpiAwareness", "false");
} else {
cmSystemTools::Error(
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index 8c067ef..12272d1 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -369,7 +369,7 @@ bool cmXCodeScheme::WriteLaunchActionBooleanAttribute(
bool defaultValue)
{
cmValue property = Target->GetTarget()->GetProperty(varName);
- bool isOn = (!property && defaultValue) || cmIsOn(property);
+ bool isOn = (!property && defaultValue) || property.IsOn();
if (isOn) {
xout.Attribute(attrName.c_str(), "YES");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 88fac8d..ed981be 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2346,16 +2346,16 @@ int cmake::Configure()
// so we cannot rely on command line options alone. Always ensure our
// messenger is in sync with the cache.
cmValue value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
- this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(*value));
+ this->Messenger->SetSuppressDeprecatedWarnings(value && value.IsOff());
value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
- this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(value.IsOn());
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
- this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
+ this->Messenger->SetSuppressDevWarnings(value.IsOn());
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
- this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(*value));
+ this->Messenger->SetDevWarningsAsErrors(value && value.IsOff());
int ret = this->ActualConfigure();
cmValue delCacheVars =
@@ -2924,13 +2924,13 @@ void cmake::AddCacheEntry(const std::string& key, cmValue value,
this->UnwatchUnusedCli(key);
if (key == "CMAKE_WARN_DEPRECATED"_s) {
- this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(value));
+ this->Messenger->SetSuppressDeprecatedWarnings(value && value.IsOff());
} else if (key == "CMAKE_ERROR_DEPRECATED"_s) {
- this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(value.IsOn());
} else if (key == "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"_s) {
- this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
+ this->Messenger->SetSuppressDevWarnings(value.IsOn());
} else if (key == "CMAKE_SUPPRESS_DEVELOPER_ERRORS"_s) {
- this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(value));
+ this->Messenger->SetDevWarningsAsErrors(value && value.IsOff());
}
}
@@ -3769,7 +3769,7 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
}
projName = *cachedProjectName;
- if (cmIsOn(this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"))) {
+ if (this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE").IsOn()) {
verbose = true;
}