Commit 20e580be authored by Sebastian Holtermann's avatar Sebastian Holtermann

Source sweep: Use cmIsOn instead of cmSystemTools::IsOn

This replaces invocations of

- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
parent 5b765021
......@@ -254,7 +254,7 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'binarycreator' executable (needs)
const char* BinCreatorStr = this->GetOption(BinCreatorOpt);
if (!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) {
if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) {
this->BinCreator.clear();
} else {
this->BinCreator = BinCreatorStr;
......@@ -271,7 +271,7 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'repogen' executable (optional)
const char* RepoGenStr = this->GetOption(RepoGenOpt);
if (!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) {
if (!RepoGenStr || cmIsNOTFOUND(RepoGenStr)) {
this->RepoGen.clear();
} else {
this->RepoGen = RepoGenStr;
......@@ -325,10 +325,10 @@ int cmCPackIFWGenerator::InitializeInternal()
}
if (const char* ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
this->OnlineOnly = cmSystemTools::IsOn(ifwDownloadAll);
this->OnlineOnly = cmIsOn(ifwDownloadAll);
} else if (const char* cpackDownloadAll =
this->GetOption("CPACK_DOWNLOAD_ALL")) {
this->OnlineOnly = cmSystemTools::IsOn(cpackDownloadAll);
this->OnlineOnly = cmIsOn(cpackDownloadAll);
} else {
this->OnlineOnly = false;
}
......
......@@ -238,7 +238,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
// if install folder is supposed to be set absolutely, the default
// component guid "*" cannot be used
if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID;
}
......@@ -582,7 +582,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string cmCPackWIXGenerator::GetRootFolderId() const
{
if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
return "";
}
......
......@@ -440,7 +440,7 @@ cmCPackDebGenerator::~cmCPackDebGenerator() = default;
int cmCPackDebGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_SET_DESTDIR", "I_ON");
}
return this->Superclass::InitializeInternal();
......
......@@ -5,6 +5,7 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cm_jsoncpp_value.h"
......@@ -149,8 +150,7 @@ int cmCPackExternalGenerator::InstallCMakeProject(
bool cmCPackExternalGenerator::StagingEnabled() const
{
return !cmSystemTools::IsOff(
this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
return !cmIsOff(this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
}
cmCPackExternalGenerator::cmCPackExternalVersionGenerator::
......@@ -208,8 +208,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
if (defaultDirectoryPermissions && *defaultDirectoryPermissions) {
root["defaultDirectoryPermissions"] = defaultDirectoryPermissions;
}
if (cmSystemTools::IsInternallyOn(
this->Parent->GetOption("CPACK_SET_DESTDIR"))) {
if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) {
root["setDestdir"] = true;
root["packagingInstallPrefix"] =
this->Parent->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
......@@ -217,8 +216,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
root["setDestdir"] = false;
}
root["stripFiles"] =
!cmSystemTools::IsOff(this->Parent->GetOption("CPACK_STRIP_FILES"));
root["stripFiles"] = !cmIsOff(this->Parent->GetOption("CPACK_STRIP_FILES"));
root["warnOnAbsoluteInstallDestination"] =
this->Parent->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION");
root["errorOnAbsoluteInstallDestination"] =
......
......@@ -180,8 +180,8 @@ int cmCPackGenerator::InstallProject()
std::string bareTempInstallDirectory =
this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
std::string tempInstallDirectoryStr = bareTempInstallDirectory;
bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")) |
cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) |
cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
if (!setDestDir) {
tempInstallDirectoryStr += this->GetPackagingInstallPrefix();
}
......@@ -750,7 +750,7 @@ int cmCPackGenerator::InstallCMakeProject(
// CPACK_PACKAGING_INSTALL_PREFIX
// I know this is tricky and awkward but it's the price for
// CPACK_SET_DESTDIR backward compatibility.
if (cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) {
if (cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_INSTALL_PREFIX",
this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"));
}
......@@ -826,7 +826,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 (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES"))) {
if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES"))) {
mf.AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
}
// Remember the list of files before installation
......@@ -977,8 +977,7 @@ int cmCPackGenerator::DoPackage()
return 0;
}
if (cmSystemTools::IsOn(
this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
const char* toplevelDirectory =
this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (cmSystemTools::FileExists(toplevelDirectory)) {
......@@ -1028,8 +1027,7 @@ int cmCPackGenerator::DoPackage()
"Remove old package file" << std::endl);
cmSystemTools::RemoveFile(tempPackageFileName);
}
if (cmSystemTools::IsOn(
this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
}
......@@ -1153,14 +1151,14 @@ bool cmCPackGenerator::IsSet(const std::string& name) const
bool cmCPackGenerator::IsOn(const std::string& name) const
{
return cmSystemTools::IsOn(GetOption(name));
return cmIsOn(GetOption(name));
}
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
{
const char* ret = this->MakefileMap->GetDefinition(op);
if (ret && *ret) {
return cmSystemTools::IsOff(ret);
return cmIsOff(ret);
}
return false;
}
......@@ -1474,7 +1472,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->IsRequired = this->IsOn(macroPrefix + "_REQUIRED");
component->IsDisabledByDefault = this->IsOn(macroPrefix + "_DISABLED");
component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") ||
cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
const char* archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
if (archiveFile && *archiveFile) {
......
......@@ -275,7 +275,7 @@ int cmCPackNSISGenerator::PackageFiles()
if (anyDownloadedComponents) {
defines += "!define CPACK_USES_DOWNLOAD\n";
if (cmSystemTools::IsOn(this->GetOption("CPACK_ADD_REMOVE"))) {
if (cmIsOn(this->GetOption("CPACK_ADD_REMOVE"))) {
defines += "!define CPACK_NSIS_ADD_REMOVE\n";
}
}
......@@ -322,8 +322,7 @@ int cmCPackNSISGenerator::PackageFiles()
int cmCPackNSISGenerator::InitializeInternal()
{
if (cmSystemTools::IsOn(
this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
cmCPackLogger(
cmCPackLog::LOG_WARNING,
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
......@@ -721,8 +720,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
// size of the installed component.
std::string zipListFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
zipListFileName += "/winZip.filelist";
bool needQuotesInFile =
cmSystemTools::IsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
bool needQuotesInFile = cmIsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
unsigned long totalSize = 0;
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName);
......
......@@ -12,6 +12,7 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmCPackRPMGenerator::cmCPackRPMGenerator() = default;
......@@ -21,7 +22,7 @@ cmCPackRPMGenerator::~cmCPackRPMGenerator() = default;
int cmCPackRPMGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_SET_DESTDIR", "I_ON");
}
/* Replace space in CPACK_PACKAGE_NAME in order to avoid
......
......@@ -326,7 +326,7 @@ int cmCTestBuildHandler::ProcessHandler()
std::string const& useLaunchers =
this->CTest->GetCTestConfiguration("UseLaunchers");
this->UseCTestLaunch = cmSystemTools::IsOn(useLaunchers);
this->UseCTestLaunch = cmIsOn(useLaunchers);
// Create a last build log
cmGeneratedFileStream ofs;
......
......@@ -270,7 +270,7 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules");
if (cmSystemTools::IsOn(init_submodules)) {
if (cmIsOn(init_submodules)) {
char const* git_submodule_init[] = { git, "submodule", "init", nullptr };
ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
top_dir.c_str());
......
......@@ -280,7 +280,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
upload_as += "&MD5=";
if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
if (cmIsOn(this->GetOption("InternalTest"))) {
upload_as += "bad_md5sum";
} else {
upload_as +=
......@@ -517,7 +517,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
"Only http and https are supported for CDASH_UPLOAD\n");
return -1;
}
bool internalTest = cmSystemTools::IsOn(this->GetOption("InternalTest"));
bool internalTest = cmIsOn(this->GetOption("InternalTest"));
// Get RETRY_COUNT and RETRY_DELAY values if they were set.
std::string retryDelayString = this->GetOption("RetryDelay") == nullptr
......
......@@ -512,8 +512,8 @@ bool cmCTestTestHandler::ProcessOptions()
{
// Update internal data structure from generic one
this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation"));
this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion")));
if (cmSystemTools::IsOn(this->GetOption("ScheduleRandom"))) {
this->SetUseUnion(cmIsOn(this->GetOption("UseUnion")));
if (cmIsOn(this->GetOption("ScheduleRandom"))) {
this->CTest->SetScheduleType("Random");
}
if (this->GetOption("ParallelLevel")) {
......@@ -553,7 +553,7 @@ bool cmCTestTestHandler::ProcessOptions()
if (val) {
this->ExcludeFixtureCleanupRegExp = val;
}
this->SetRerunFailed(cmSystemTools::IsOn(this->GetOption("RerunFailed")));
this->SetRerunFailed(cmIsOn(this->GetOption("RerunFailed")));
return true;
}
......@@ -2203,10 +2203,10 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "WILL_FAIL") {
rt.WillFail = cmSystemTools::IsOn(val);
rt.WillFail = cmIsOn(val);
}
if (key == "DISABLED") {
rt.Disabled = cmSystemTools::IsOn(val);
rt.Disabled = cmIsOn(val);
}
if (key == "ATTACHED_FILES") {
cmExpandList(val, rt.AttachedFiles);
......@@ -2249,7 +2249,7 @@ bool cmCTestTestHandler::SetTestsProperties(
cmExpandList(val, rt.RequiredFiles);
}
if (key == "RUN_SERIAL") {
rt.RunSerial = cmSystemTools::IsOn(val);
rt.RunSerial = cmIsOn(val);
}
if (key == "FAIL_REGULAR_EXPRESSION") {
std::vector<std::string> lval;
......@@ -2272,7 +2272,7 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "PROCESSOR_AFFINITY") {
rt.WantAffinity = cmSystemTools::IsOn(val);
rt.WantAffinity = cmIsOn(val);
}
if (key == "SKIP_RETURN_CODE") {
rt.SkipReturnCode = atoi(val.c_str());
......
......@@ -3,6 +3,7 @@
#include "cmCTestVC.h"
#include "cmCTest.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmXMLWriter.h"
......@@ -152,8 +153,7 @@ bool cmCTestVC::Update()
// if update version only is on then do not actually update,
// just note the current version and finish
if (!cmSystemTools::IsOn(
this->CTest->GetCTestConfiguration("UpdateVersionOnly"))) {
if (!cmIsOn(this->CTest->GetCTestConfiguration("UpdateVersionOnly"))) {
result = this->NoteOldRevision() && result;
this->Log << "--- Begin Update ---\n";
result = this->UpdateImpl() && result;
......
......@@ -50,7 +50,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
switch (cm->GetState()->GetCacheEntryType(key)) {
case cmStateEnums::BOOL:
this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1);
if (cmSystemTools::IsOn(value)) {
if (cmIsOn(value)) {
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true);
} else {
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(false);
......
......@@ -13,6 +13,7 @@
#include "cmCursesWidget.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
#include "cmake.h"
......@@ -696,7 +697,7 @@ void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type,
cmSystemTools::ConvertToUnixSlashes(out);
}
if (type == cmStateEnums::BOOL) {
if (cmSystemTools::IsOff(out)) {
if (cmIsOff(out)) {
out = "OFF";
} else {
out = "ON";
......
......@@ -7,6 +7,7 @@
#include "cmExternalMakefileProjectGenerator.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#ifdef Q_OS_WIN
......@@ -312,7 +313,7 @@ QCMakePropertyList QCMake::properties() const
prop.Advanced = state->GetCacheEntryPropertyAsBool(key, "ADVANCED");
if (t == cmStateEnums::BOOL) {
prop.Type = QCMakeProperty::BOOL;
prop.Value = cmSystemTools::IsOn(cachedValue);
prop.Value = cmIsOn(cachedValue);
} else if (t == cmStateEnums::PATH) {
prop.Type = QCMakeProperty::PATH;
} else if (t == cmStateEnums::FILEPATH) {
......
......@@ -12,7 +12,7 @@
#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
bool cmAddLibraryCommand(std::vector<std::string> const& args,
......@@ -27,7 +27,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 (cmSystemTools::IsOff(mf.GetDefinition("BUILD_SHARED_LIBS"))) {
if (cmIsOff(mf.GetDefinition("BUILD_SHARED_LIBS"))) {
type = cmStateEnums::STATIC_LIBRARY;
}
bool excludeFromAll = false;
......
......@@ -608,7 +608,7 @@ int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
if (cmSourceFile* rsf = sf->RealSourceFile) {
return rsf->GetPropertyAsBool(prop) ? 1 : 0;
}
return cmSystemTools::IsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
return cmIsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
}
void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
......
......@@ -323,12 +323,11 @@ cmCTest::cmCTest()
{
std::string envValue;
if (cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE", envValue)) {
this->Impl->OutputTestOutputOnTestFailure =
!cmSystemTools::IsOff(envValue);
this->Impl->OutputTestOutputOnTestFailure = !cmIsOff(envValue);
}
envValue.clear();
if (cmSystemTools::GetEnv("CTEST_PROGRESS_OUTPUT", envValue)) {
this->Impl->TestProgressOutput = !cmSystemTools::IsOff(envValue);
this->Impl->TestProgressOutput = !cmIsOff(envValue);
}
this->Impl->Parts[PartStart].SetName("Start");
......@@ -763,7 +762,7 @@ bool cmCTest::UpdateCTestConfiguration()
}
if (this->Impl->ProduceXML) {
this->Impl->CompressXMLFiles =
cmSystemTools::IsOn(this->GetCTestConfiguration("CompressSubmission"));
cmIsOn(this->GetCTestConfiguration("CompressSubmission"));
}
return true;
}
......@@ -2001,7 +2000,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--interactive-debug-mode") &&
i < args.size() - 1) {
i++;
this->Impl->InteractiveDebugMode = cmSystemTools::IsOn(args[i]);
this->Impl->InteractiveDebugMode = cmIsOn(args[i]);
}
if (this->CheckArgument(arg, "--submit-index") && i < args.size() - 1) {
i++;
......
......@@ -616,7 +616,7 @@ void cmCacheManager::CacheIterator::SetValue(const char* value)
bool cmCacheManager::CacheIterator::GetValueAsBool() const
{
return cmSystemTools::IsOn(this->GetEntry().Value);
return cmIsOn(this->GetEntry().Value);
}
std::vector<std::string> cmCacheManager::CacheEntry::GetPropertyList() const
......@@ -696,7 +696,7 @@ bool cmCacheManager::CacheIterator::GetPropertyAsBool(
const std::string& prop) const
{
if (const char* value = this->GetProperty(prop)) {
return cmSystemTools::IsOn(value);
return cmIsOn(value);
}
return false;
}
......
......@@ -480,7 +480,7 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
const char* lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
if (cmSystemTools::IsOn(lss)) {
if (cmIsOn(lss)) {
this->SetCurrentLinkType(LinkStatic);
} else {
this->SetCurrentLinkType(this->StartLinkType);
......@@ -787,7 +787,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
// Lookup the starting link type from the target (linked statically?).
const char* lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
this->StartLinkType = cmSystemTools::IsOn(lss) ? LinkStatic : LinkShared;
this->StartLinkType = cmIsOn(lss) ? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}
......
......@@ -220,10 +220,10 @@ bool cmConditionEvaluator::GetBooleanValue(
}
// Check named constants.
if (cmSystemTools::IsOn(arg.c_str())) {
if (cmIsOn(arg.GetValue())) {
return true;
}
if (cmSystemTools::IsOff(arg.c_str())) {
if (cmIsOff(arg.GetValue())) {
return false;
}
......@@ -239,7 +239,7 @@ bool cmConditionEvaluator::GetBooleanValue(
// Check definition.
const char* def = this->GetDefinitionIfUnquoted(arg);
return !cmSystemTools::IsOff(def);
return !cmIsOff(def);
}
//=========================================================================
......@@ -256,14 +256,14 @@ bool cmConditionEvaluator::GetBooleanValueOld(
return true;
}
const char* def = this->GetDefinitionIfUnquoted(arg);
return !cmSystemTools::IsOff(def);
return !cmIsOff(def);
}
// Old GetVariableOrNumber behavior.
const char* def = this->GetDefinitionIfUnquoted(arg);
if (!def && atoi(arg.c_str())) {
def = arg.c_str();
}
return !cmSystemTools::IsOff(def);
return !cmIsOff(def);
}
//=========================================================================
......
......@@ -235,7 +235,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// Also we can disable external (outside the project) files by setting ON
// CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES variable.
const bool excludeExternal =
cmSystemTools::IsOn(it.second[0]->GetMakefile()->GetSafeDefinition(
cmIsOn(it.second[0]->GetMakefile()->GetSafeDefinition(
"CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES"));
if (!splitted.empty() &&
(!excludeExternal || (relative.find("..") == std::string::npos)) &&
......@@ -381,7 +381,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// Do not add this file if it has ".." in relative path and
// if CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES variable is on.
const bool excludeExternal =
cmSystemTools::IsOn(lg->GetMakefile()->GetSafeDefinition(
cmIsOn(lg->GetMakefile()->GetSafeDefinition(
"CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES"));
if (excludeExternal &&
(relative.find("..") != std::string::npos)) {
......
......@@ -445,7 +445,7 @@ bool cmExtraSublimeTextGenerator::Open(const std::string& bindir,
if (!sublExecutable) {
return false;
}
if (cmSystemTools::IsNOTFOUND(sublExecutable)) {
if (cmIsNOTFOUND(sublExecutable)) {
return false;
}
......
......@@ -703,10 +703,10 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
if (*i == "LIST_DIRECTORIES") {
++i; // skip LIST_DIRECTORIES
if (i != args.end()) {
if (cmSystemTools::IsOn(*i)) {
if (cmIsOn(*i)) {
g.SetListDirs(true);
g.SetRecurseListDirs(true);
} else if (cmSystemTools::IsOff(*i)) {
} else if (cmIsOff(*i)) {
g.SetListDirs(false);
g.SetRecurseListDirs(false);
} else {
......@@ -1656,7 +1656,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
} else if (*i == "TLS_VERIFY") {
++i;
if (i != args.end()) {
tls_verify = cmSystemTools::IsOn(*i);
tls_verify = cmIsOn(*i);
} else {
status.SetError("TLS_VERIFY missing bool value.");
return false;
......
......@@ -6,6 +6,7 @@
#include "cmExecutionStatus.h"
#include "cmFSPermissions.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
......@@ -28,7 +29,7 @@ cmFileInstaller::cmFileInstaller(cmExecutionStatus& status)
// Check whether to copy files always or only if they have changed.
std::string install_always;
if (cmSystemTools::GetEnv("CMAKE_INSTALL_ALWAYS", install_always)) {
this->Always = cmSystemTools::IsOn(install_always);
this->Always = cmIsOn(install_always);
}
// Get the current manifest.
this->Manifest =
......
......@@ -324,7 +324,7 @@ bool cmFindBase::CheckForVariableInCache()
this->Makefile->GetDefinition(this->VariableName)) {
cmState* state = this->Makefile->GetState();
const char* cacheEntry = state->GetCacheEntryValue(this->VariableName);
bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
bool found = !cmIsNOTFOUND(cacheValue);
bool cached = cacheEntry != nullptr;
if (found) {
// If the user specifies the entry on the command line without a
......
......@@ -161,7 +161,7 @@ void cmFindCommon::SelectDefaultSearchModes()
for (auto& path : search_paths) {
const char* def = this->Makefile->GetDefinition(path.second);
if (def) {
path.first = !cmSystemTools::IsOn(def);
path.first = !cmIsOn(def);
}
}
}
......
......@@ -194,7 +194,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
if (const char* def =
this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
this->NoUserRegistry = !cmSystemTools::IsOn(def);
this->NoUserRegistry = !cmIsOn(def);
} else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
}
......@@ -752,7 +752,7 @@ bool cmFindPackageCommand::HandlePackageMode(
// Try to load the config file if the directory is known
bool fileFound = false;
if (this->UseConfigFiles) {
if (!cmSystemTools::IsOff(def)) {
if (!cmIsOff(def)) {
// Get the directory from the variable value.
std::string dir = def;
cmSystemTools::ConvertToUnixSlashes(dir);
......@@ -772,7 +772,7 @@ bool cmFindPackageCommand::HandlePackageMode(
}
// Search for the config file if it is not already found.
if (cmSystemTools::IsOff(def) || !fileFound) {
if (cmIsOff(def) || !fileFound) {
fileFound = this->FindConfig();
}
......@@ -1148,8 +1148,7 @@ void cmFindPackageCommand::AppendSuccessInformation()
const char* upperResult = this->Makefile->GetDefinition(upperFound);
const char* result = this->Makefile->GetDefinition(found);
bool packageFound =
((cmSystemTools::IsOn(result)) || (cmSystemTools::IsOn(upperResult)));
bool packageFound = ((cmIsOn(result)) || (cmIsOn(upperResult)));
this->AppendToFoundProperty(packageFound);
......
......@@ -169,7 +169,7 @@ static const struct BoolNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent* /*content*/,
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
{
return !cmSystemTools::IsOff(parameters.front()) ? "1" : "0";
return !cmIsOff(parameters.front()) ? "1" : "0";
}
} boolNode;
......
......@@ -825,7 +825,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
std::string const& config) const
{
const char* feature = "INTERPROCEDURAL_OPTIMIZATION";
const bool result = cmSystemTools::IsOn(this->GetFeature(feature, config));
const bool result = cmIsOn(this->GetFeature(feature, config));
if (!result) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies
......@@ -1972,7 +1972,7 @@ bool cmGeneratorTarget::MacOSXUseInstallNameDir() const
const char* build_with_install_name =
this->GetProperty("BUILD_WITH_INSTALL_NAME_DIR");
if (build_with_install_name) {
return cmSystemTools::IsOn(build_with_install_name);
return cmIsOn(build_with_install_name);
}
cmPolicies::PolicyStatus cmp0068 = this->GetPolicyStatusCMP0068();
......@@ -3033,7 +3033,7 @@ void processIncludeDirectories(
}
}
if (!cmSystemTools::IsOff(entryInclude)) {
if (!cmIsOff(entryInclude)) {
cmSystemTools::ConvertToUnixSlashes(entryInclude);
}
......@@ -4608,7 +4608,7 @@ bool getTypedProperty<bool>(cmGeneratorTarget const* tgt,
}
const char* value = tgt->GetProperty(prop);
return cmSystemTools::IsOn(genexInterpreter->Evaluate(value, prop));
return cmIsOn(genexInterpreter->Evaluate(value, prop));
}
template <>
......@@ -4726,7 +4726,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
switch (t) {
case BoolType: {
bool same = cmSystemTools::IsOn(lhs) == cmSystemTools::IsOn(rhs);
bool same = cmIsOn(lhs) == cmIsOn(rhs);
return std::make_pair(same, same ? lhs : nullptr);
}
case StringType:
......@@ -4757,7 +4757,7 @@ std::pair<bool, std::string> consistentProperty(const std::string& lhs,
switch (t) {
case BoolType: {
bool same = cmSystemTools::IsOn(lhs) == cmSystemTools::IsOn(rhs);
bool same = cmIsOn(lhs) == cmIsOn(rhs);
return std::make_pair(same, same ? lhs : null_ptr);
}
case StringType:
......@@ -5868,10 +5868,10 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
std::string soProp = "IMPORTED_NO_SONAME";
soProp += suffix;
if (const char* config_no_soname = this->GetProperty(soProp)) {
info.NoSOName = cmSystemTools::IsOn(config_no_soname);
info.NoSOName = cmIsOn(config_no_soname);
} else if (const char* no_soname =
this->GetProperty("IMPORTED_NO_SONAME")) {
info.NoSOName = cmSystemTools::IsOn(no_soname);