diff options
author | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2024-03-17 23:00:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@users.noreply.gitlab.com> | 2024-03-17 23:05:37 (GMT) |
commit | 1a49b439a548a5ccc573e85c86ef42ece1d267ae (patch) | |
tree | 5cb159207f37bb6665f8f089330bbb868c11adf4 /Source/CPack | |
parent | f440439dee558273a32e4efa39e10a9ff6b479d5 (diff) | |
download | CMake-1a49b439a548a5ccc573e85c86ef42ece1d267ae.zip CMake-1a49b439a548a5ccc573e85c86ef42ece1d267ae.tar.gz CMake-1a49b439a548a5ccc573e85c86ef42ece1d267ae.tar.bz2 |
Source: Use cmValue::IsOn and IsOff
Speed up a bit by calling members directly.
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackExternalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/CPack/cmCPackInnoSetupGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 6 |
7 files changed, 20 insertions, 20 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); |