Merge topic 'rename-cmProp-in-cmValue'

59ad7a1c24 Move helpers functions from cmStringAlgorithms.h to cmValue.h
edf67dd039 cmValue: add IsInternallyOn methods
cc56dc7468 Rename cmProp in cmValue

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6554
This commit is contained in:
Brad King
2021-09-22 13:10:29 +00:00
committed by Kitware Robot
199 changed files with 1870 additions and 1817 deletions
+2 -1
View File
@@ -381,7 +381,8 @@ set(SRCS
cmProcessOutput.h
cmProcessTools.cxx
cmProcessTools.h
cmProperty.cxx
cmValue.cxx
cmValue.h
cmProperty.h
cmPropertyDefinition.cxx
cmPropertyDefinition.h
+1 -1
View File
@@ -21,7 +21,7 @@ cmCPackIFWCommon::cmCPackIFWCommon()
{
}
cmProp cmCPackIFWCommon::GetOption(const std::string& op) const
cmValue cmCPackIFWCommon::GetOption(const std::string& op) const
{
return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op)
: nullptr;
+2 -2
View File
@@ -7,7 +7,7 @@
#include <map>
#include <string>
#include "cmProperty.h"
#include "cmValue.h"
class cmCPackIFWGenerator;
class cmXMLWriter;
@@ -28,7 +28,7 @@ public:
public:
// Internal implementation
cmProp GetOption(const std::string& op) const;
cmValue GetOption(const std::string& op) const;
bool IsOn(const std::string& op) const;
bool IsSetToOff(const std::string& op) const;
bool IsSetToEmpty(const std::string& op) const;
+18 -16
View File
@@ -14,9 +14,9 @@
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCPackIFWGenerator::cmCPackIFWGenerator()
{
@@ -274,7 +274,7 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'binarycreator' executable (needs)
cmProp BinCreatorStr = this->GetOption(BinCreatorOpt);
cmValue BinCreatorStr = this->GetOption(BinCreatorOpt);
if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) {
this->BinCreator.clear();
} else {
@@ -291,7 +291,7 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'repogen' executable (optional)
cmProp repoGen = this->GetOption(RepoGenOpt);
cmValue repoGen = this->GetOption(RepoGenOpt);
if (!repoGen || cmIsNOTFOUND(repoGen)) {
this->RepoGen.clear();
} else {
@@ -299,7 +299,7 @@ int cmCPackIFWGenerator::InitializeInternal()
}
// Framework version
if (cmProp frameworkVersion = this->GetOption(FrameworkVersionOpt)) {
if (cmValue frameworkVersion = this->GetOption(FrameworkVersionOpt)) {
this->FrameworkVersion = *frameworkVersion;
} else {
this->FrameworkVersion = "1.9.9";
@@ -313,13 +313,13 @@ int cmCPackIFWGenerator::InitializeInternal()
// Additional packages dirs
this->PkgsDirsVector.clear();
if (cmProp dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) {
if (cmValue dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) {
cmExpandList(dirs, this->PkgsDirsVector);
}
// Additional repositories dirs
this->RepoDirsVector.clear();
if (cmProp dirs = this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
if (cmValue dirs = this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
cmExpandList(dirs, this->RepoDirsVector);
}
@@ -330,22 +330,23 @@ int cmCPackIFWGenerator::InitializeInternal()
// Repository
this->Repository.Generator = this;
this->Repository.Name = "Unspecified";
if (cmProp site = this->GetOption("CPACK_DOWNLOAD_SITE")) {
if (cmValue site = this->GetOption("CPACK_DOWNLOAD_SITE")) {
this->Repository.Url = *site;
this->Installer.RemoteRepositories.push_back(&this->Repository);
}
// Repositories
if (cmProp RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
if (cmValue RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
std::vector<std::string> RepoAllVector = cmExpandedList(RepoAllStr);
for (std::string const& r : RepoAllVector) {
this->GetRepository(r);
}
}
if (cmProp ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
if (cmValue ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
this->OnlineOnly = cmIsOn(ifwDownloadAll);
} else if (cmProp cpackDownloadAll = this->GetOption("CPACK_DOWNLOAD_ALL")) {
} else if (cmValue cpackDownloadAll =
this->GetOption("CPACK_DOWNLOAD_ALL")) {
this->OnlineOnly = cmIsOn(cpackDownloadAll);
} else {
this->OnlineOnly = false;
@@ -373,7 +374,8 @@ int cmCPackIFWGenerator::InitializeInternal()
}
// Output extension
if (cmProp optOutExt = this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
if (cmValue optOutExt =
this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
this->OutputExtension = *optOutExt;
} else if (sysName == "Darwin") {
this->OutputExtension = ".dmg";
@@ -506,18 +508,18 @@ std::string cmCPackIFWGenerator::GetRootPackageName()
{
// Default value
std::string name = "root";
if (cmProp optIFW_PACKAGE_GROUP =
if (cmValue optIFW_PACKAGE_GROUP =
this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
// Configure from root group
cmCPackIFWPackage package;
package.Generator = this;
package.ConfigureFromGroup(optIFW_PACKAGE_GROUP);
name = package.Name;
} else if (cmProp optIFW_PACKAGE_NAME =
} else if (cmValue optIFW_PACKAGE_NAME =
this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
// Configure from root package name
name = *optIFW_PACKAGE_NAME;
} else if (cmProp optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
} else if (cmValue optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
// Configure from package name
name = *optPACKAGE_NAME;
}
@@ -534,7 +536,7 @@ std::string cmCPackIFWGenerator::GetGroupPackageName(
if (cmCPackIFWPackage* package = this->GetGroupPackage(group)) {
return package->Name;
}
cmProp option =
cmValue option =
this->GetOption("CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(group->Name) + "_NAME");
name = option ? *option : group->Name;
@@ -560,7 +562,7 @@ std::string cmCPackIFWGenerator::GetComponentPackageName(
}
std::string prefix = "CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_";
cmProp option = this->GetOption(prefix + "NAME");
cmValue option = this->GetOption(prefix + "NAME");
name = option ? *option : component->Name;
if (component->Group) {
cmCPackIFWPackage* package = this->GetGroupPackage(component->Group);
+31 -30
View File
@@ -12,9 +12,9 @@
#include "cmCPackIFWRepository.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLParser.h"
#include "cmXMLWriter.h"
@@ -34,19 +34,20 @@ void cmCPackIFWInstaller::printSkippedOptionWarning(
void cmCPackIFWInstaller::ConfigureFromOptions()
{
// Name;
if (cmProp optIFW_PACKAGE_NAME = this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
if (cmValue optIFW_PACKAGE_NAME =
this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
this->Name = *optIFW_PACKAGE_NAME;
} else if (cmProp optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
} else if (cmValue optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
this->Name = *optPACKAGE_NAME;
} else {
this->Name = "Your package";
}
// Title;
if (cmProp optIFW_PACKAGE_TITLE =
if (cmValue optIFW_PACKAGE_TITLE =
this->GetOption("CPACK_IFW_PACKAGE_TITLE")) {
this->Title = *optIFW_PACKAGE_TITLE;
} else if (cmProp optPACKAGE_DESCRIPTION_SUMMARY =
} else if (cmValue optPACKAGE_DESCRIPTION_SUMMARY =
this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
this->Title = *optPACKAGE_DESCRIPTION_SUMMARY;
} else {
@@ -54,28 +55,28 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Version;
if (cmProp option = this->GetOption("CPACK_PACKAGE_VERSION")) {
if (cmValue option = this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = *option;
} else {
this->Version = "1.0.0";
}
// Publisher
if (cmProp optIFW_PACKAGE_PUBLISHER =
if (cmValue optIFW_PACKAGE_PUBLISHER =
this->GetOption("CPACK_IFW_PACKAGE_PUBLISHER")) {
this->Publisher = *optIFW_PACKAGE_PUBLISHER;
} else if (cmProp optPACKAGE_VENDOR =
} else if (cmValue optPACKAGE_VENDOR =
this->GetOption("CPACK_PACKAGE_VENDOR")) {
this->Publisher = *optPACKAGE_VENDOR;
}
// ProductUrl
if (cmProp option = this->GetOption("CPACK_IFW_PRODUCT_URL")) {
if (cmValue option = this->GetOption("CPACK_IFW_PRODUCT_URL")) {
this->ProductUrl = *option;
}
// ApplicationIcon
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) {
if (cmSystemTools::FileExists(option)) {
this->InstallerApplicationIcon = *option;
} else {
@@ -84,7 +85,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// WindowIcon
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) {
if (cmSystemTools::FileExists(option)) {
this->InstallerWindowIcon = *option;
} else {
@@ -102,7 +103,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Logo
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) {
if (cmSystemTools::FileExists(option)) {
this->Logo = *option;
} else {
@@ -111,7 +112,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Watermark
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
if (cmSystemTools::FileExists(option)) {
this->Watermark = *option;
} else {
@@ -120,7 +121,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Banner
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) {
if (cmSystemTools::FileExists(option)) {
this->Banner = *option;
} else {
@@ -129,7 +130,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Background
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
if (cmSystemTools::FileExists(option)) {
this->Background = *option;
} else {
@@ -138,7 +139,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// WizardStyle
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WIZARD_STYLE")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WIZARD_STYLE")) {
// Setting the user value in any case
this->WizardStyle = *option;
// Check known values
@@ -153,7 +154,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// StyleSheet
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) {
if (cmSystemTools::FileExists(option)) {
this->StyleSheet = *option;
} else {
@@ -162,19 +163,19 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// WizardDefaultWidth
if (cmProp option =
if (cmValue option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) {
this->WizardDefaultWidth = *option;
}
// WizardDefaultHeight
if (cmProp option =
if (cmValue option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT")) {
this->WizardDefaultHeight = *option;
}
// WizardShowPageList
if (cmProp option =
if (cmValue option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
if (!this->IsVersionLess("4.0")) {
if (this->IsSetToOff("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
@@ -203,12 +204,12 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// TitleColor
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
this->TitleColor = *option;
}
// Start menu
if (cmProp optIFW_START_MENU_DIR =
if (cmValue optIFW_START_MENU_DIR =
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
this->StartMenuDir = *optIFW_START_MENU_DIR;
} else {
@@ -216,10 +217,10 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Default target directory for installation
if (cmProp optIFW_TARGET_DIRECTORY =
if (cmValue optIFW_TARGET_DIRECTORY =
this->GetOption("CPACK_IFW_TARGET_DIRECTORY")) {
this->TargetDir = *optIFW_TARGET_DIRECTORY;
} else if (cmProp optPACKAGE_INSTALL_DIRECTORY =
} else if (cmValue optPACKAGE_INSTALL_DIRECTORY =
this->GetOption("CPACK_PACKAGE_INSTALL_DIRECTORY")) {
this->TargetDir =
cmStrCat("@ApplicationsDir@/", optPACKAGE_INSTALL_DIRECTORY);
@@ -228,18 +229,18 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Default target directory for installation with administrator rights
if (cmProp option = this->GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) {
if (cmValue option = this->GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) {
this->AdminTargetDir = *option;
}
// Maintenance tool
if (cmProp optIFW_MAINTENANCE_TOOL =
if (cmValue optIFW_MAINTENANCE_TOOL =
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME")) {
this->MaintenanceToolName = *optIFW_MAINTENANCE_TOOL;
}
// Maintenance tool ini file
if (cmProp optIFW_MAINTENANCE_TOOL_INI =
if (cmValue optIFW_MAINTENANCE_TOOL_INI =
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE")) {
this->MaintenanceToolIniFile = *optIFW_MAINTENANCE_TOOL_INI;
}
@@ -263,13 +264,13 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Control script
if (cmProp optIFW_CONTROL_SCRIPT =
if (cmValue optIFW_CONTROL_SCRIPT =
this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) {
this->ControlScript = *optIFW_CONTROL_SCRIPT;
}
// Resources
if (cmProp optIFW_PACKAGE_RESOURCES =
if (cmValue optIFW_PACKAGE_RESOURCES =
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
this->Resources.clear();
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
@@ -539,7 +540,7 @@ void cmCPackIFWInstaller::GeneratePackageFiles()
package.Generator = this->Generator;
package.Installer = this;
// Check package group
if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
package.ConfigureFromGroup(option);
std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION";
+30 -30
View File
@@ -15,10 +15,10 @@
#include "cmCPackIFWInstaller.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
//---------------------------------------------------------- CompareStruct ---
@@ -125,7 +125,7 @@ std::string cmCPackIFWPackage::GetComponentName(cmCPackComponent* component)
if (!component) {
return "";
}
cmProp option =
cmValue option =
this->GetOption("CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_NAME");
return option ? *option : component->Name;
@@ -160,21 +160,21 @@ int cmCPackIFWPackage::ConfigureFromOptions()
this->Name = this->Generator->GetRootPackageName();
// Display name
if (cmProp option = this->GetOption("CPACK_PACKAGE_NAME")) {
if (cmValue option = this->GetOption("CPACK_PACKAGE_NAME")) {
this->DisplayName[""] = *option;
} else {
this->DisplayName[""] = "Your package";
}
// Description
if (cmProp option = this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
if (cmValue option = this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
this->Description[""] = *option;
} else {
this->Description[""] = "Your package description";
}
// Version
if (cmProp option = this->GetOption("CPACK_PACKAGE_VERSION")) {
if (cmValue option = this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = *option;
} else {
this->Version = "1.0.0";
@@ -204,9 +204,9 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
this->Description[""] = component->Description;
// Version
if (cmProp optVERSION = this->GetOption(prefix + "VERSION")) {
if (cmValue optVERSION = this->GetOption(prefix + "VERSION")) {
this->Version = *optVERSION;
} else if (cmProp optPACKAGE_VERSION =
} else if (cmValue optPACKAGE_VERSION =
this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = *optPACKAGE_VERSION;
} else {
@@ -214,12 +214,12 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
}
// Script
if (cmProp option = this->GetOption(prefix + "SCRIPT")) {
if (cmValue option = this->GetOption(prefix + "SCRIPT")) {
this->Script = *option;
}
// User interfaces
if (cmProp option = this->GetOption(prefix + "USER_INTERFACES")) {
if (cmValue option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear();
cmExpandList(option, this->UserInterfaces);
}
@@ -232,7 +232,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
}
// Licenses
if (cmProp option = this->GetOption(prefix + "LICENSES")) {
if (cmValue option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear();
cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) {
@@ -246,7 +246,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
}
// Priority
if (cmProp option = this->GetOption(prefix + "PRIORITY")) {
if (cmValue option = this->GetOption(prefix + "PRIORITY")) {
this->SortingPriority = *option;
cmCPackIFWLogger(
WARNING,
@@ -289,9 +289,9 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
this->Description[""] = group->Description;
// Version
if (cmProp optVERSION = this->GetOption(prefix + "VERSION")) {
if (cmValue optVERSION = this->GetOption(prefix + "VERSION")) {
this->Version = *optVERSION;
} else if (cmProp optPACKAGE_VERSION =
} else if (cmValue optPACKAGE_VERSION =
this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = *optPACKAGE_VERSION;
} else {
@@ -299,18 +299,18 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
}
// Script
if (cmProp option = this->GetOption(prefix + "SCRIPT")) {
if (cmValue option = this->GetOption(prefix + "SCRIPT")) {
this->Script = *option;
}
// User interfaces
if (cmProp option = this->GetOption(prefix + "USER_INTERFACES")) {
if (cmValue option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear();
cmExpandList(option, this->UserInterfaces);
}
// Licenses
if (cmProp option = this->GetOption(prefix + "LICENSES")) {
if (cmValue option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear();
cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) {
@@ -324,7 +324,7 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
}
// Priority
if (cmProp option = this->GetOption(prefix + "PRIORITY")) {
if (cmValue option = this->GetOption(prefix + "PRIORITY")) {
this->SortingPriority = *option;
cmCPackIFWLogger(
WARNING,
@@ -346,13 +346,13 @@ int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName)
std::string prefix =
"CPACK_COMPONENT_GROUP_" + cmsys::SystemTools::UpperCase(groupName) + "_";
if (cmProp option = this->GetOption(prefix + "DISPLAY_NAME")) {
if (cmValue option = this->GetOption(prefix + "DISPLAY_NAME")) {
group.DisplayName = *option;
} else {
group.DisplayName = group.Name;
}
if (cmProp option = this->GetOption(prefix + "DESCRIPTION")) {
if (cmValue option = this->GetOption(prefix + "DESCRIPTION")) {
group.Description = *option;
}
group.IsBold = this->IsOn(prefix + "BOLD_TITLE");
@@ -381,7 +381,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DISPLAY_NAME";
if (this->IsSetToEmpty(option)) {
this->DisplayName.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName);
}
@@ -389,7 +389,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DESCRIPTION";
if (this->IsSetToEmpty(option)) {
this->Description.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
cmCPackIFWPackage::ExpandListArgument(value, this->Description);
}
@@ -397,7 +397,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "RELEASE_DATE";
if (this->IsSetToEmpty(option)) {
this->ReleaseDate.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
this->ReleaseDate = *value;
}
@@ -405,7 +405,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "SORTING_PRIORITY";
if (this->IsSetToEmpty(option)) {
this->SortingPriority.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
this->SortingPriority = *value;
}
@@ -413,7 +413,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "UPDATE_TEXT";
if (this->IsSetToEmpty(option)) {
this->UpdateText.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
this->UpdateText = *value;
}
@@ -421,7 +421,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "TRANSLATIONS";
if (this->IsSetToEmpty(option)) {
this->Translations.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
this->Translations.clear();
cmExpandList(value, this->Translations);
}
@@ -429,11 +429,11 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
// QtIFW dependencies
std::vector<std::string> deps;
option = prefix + "DEPENDS";
if (cmProp value = this->GetOption(option)) {
if (cmValue value = this->GetOption(option)) {
cmExpandList(value, deps);
}
option = prefix + "DEPENDENCIES";
if (cmProp value = this->GetOption(option)) {
if (cmValue value = this->GetOption(option)) {
cmExpandList(value, deps);
}
for (std::string const& d : deps) {
@@ -454,7 +454,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "AUTO_DEPEND_ON";
if (this->IsSetToEmpty(option)) {
this->AlienAutoDependOn.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
std::vector<std::string> depsOn = cmExpandedList(value);
for (std::string const& d : depsOn) {
DependenceStruct dep(d);
@@ -483,7 +483,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DEFAULT";
if (this->IsSetToEmpty(option)) {
this->Default.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
std::string lowerValue = cmsys::SystemTools::LowerCase(value);
if (lowerValue == "true") {
this->Default = "true";
@@ -510,7 +510,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "REPLACES";
if (this->IsSetToEmpty(option)) {
this->Replaces.clear();
} else if (cmProp value = this->GetOption(option)) {
} else if (cmValue value = this->GetOption(option)) {
this->Replaces.clear();
cmExpandList(value, this->Replaces);
}
+7 -7
View File
@@ -6,8 +6,8 @@
#include "cmCPackIFWGenerator.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLParser.h"
#include "cmXMLWriter.h"
@@ -56,21 +56,21 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
}
// Url
if (cmProp url = this->GetOption(prefix + "URL")) {
if (cmValue url = this->GetOption(prefix + "URL")) {
this->Url = *url;
} else {
this->Url.clear();
}
// Old url
if (cmProp oldUrl = this->GetOption(prefix + "OLD_URL")) {
if (cmValue oldUrl = this->GetOption(prefix + "OLD_URL")) {
this->OldUrl = *oldUrl;
} else {
this->OldUrl.clear();
}
// New url
if (cmProp newUrl = this->GetOption(prefix + "NEW_URL")) {
if (cmValue newUrl = this->GetOption(prefix + "NEW_URL")) {
this->NewUrl = *newUrl;
} else {
this->NewUrl.clear();
@@ -84,21 +84,21 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
}
// Username
if (cmProp username = this->GetOption(prefix + "USERNAME")) {
if (cmValue username = this->GetOption(prefix + "USERNAME")) {
this->Username = *username;
} else {
this->Username.clear();
}
// Password
if (cmProp password = this->GetOption(prefix + "PASSWORD")) {
if (cmValue password = this->GetOption(prefix + "PASSWORD")) {
this->Password = *password;
} else {
this->Password.clear();
}
// DisplayName
if (cmProp displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
if (cmValue displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
this->DisplayName = *displayName;
} else {
this->DisplayName.clear();
+21 -21
View File
@@ -18,10 +18,10 @@
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
#include "cmInstalledFile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmUuid.h"
#include "cmValue.h"
#include "cmWIXDirectoriesSourceWriter.h"
#include "cmWIXFeaturesSourceWriter.h"
#include "cmWIXFilesSourceWriter.h"
@@ -126,7 +126,7 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles)
command << " -ext " << QuotePath(ext);
}
cmProp const cultures = GetOption("CPACK_WIX_CULTURES");
cmValue const cultures = GetOption("CPACK_WIX_CULTURES");
if (cultures) {
command << " -cultures:" << cultures;
}
@@ -211,7 +211,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
SetOption("CPACK_WIX_UI_REF", defaultRef);
}
cmProp packageContact = GetOption("CPACK_PACKAGE_CONTACT");
cmValue packageContact = GetOption("CPACK_PACKAGE_CONTACT");
if (packageContact && !GetOption("CPACK_WIX_PROPERTY_ARPCONTACT")) {
SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact);
}
@@ -224,7 +224,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", this->LightExtensions);
CollectXmlNamespaces("CPACK_WIX_CUSTOM_XMLNS", this->CustomXmlNamespaces);
cmProp patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
cmValue patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if (patchFilePath) {
std::vector<std::string> patchFilePaths = cmExpandedList(patchFilePath);
@@ -296,7 +296,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
{
cmProp cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
cmValue cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
if (!cpackWixExtraSources)
return;
@@ -305,7 +305,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
{
cmProp cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS");
cmValue cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS");
if (!cpackWixExtraObjects)
return;
@@ -406,7 +406,7 @@ void cmCPackWIXGenerator::CopyDefinition(cmWIXSourceWriter& source,
std::string const& name,
DefinitionType type)
{
cmProp value = GetOption(name);
cmValue value = GetOption(name);
if (value) {
if (type == DefinitionType::PATH) {
AddDefinition(source, name, CMakeToWixPath(value));
@@ -486,17 +486,17 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
}
std::string featureTitle = cpackPackageName;
if (cmProp title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) {
if (cmValue title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) {
featureTitle = *title;
}
featureDefinitions.AddAttribute("Title", featureTitle);
if (cmProp desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) {
if (cmValue desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) {
featureDefinitions.AddAttribute("Description", desc);
}
featureDefinitions.AddAttribute("Level", "1");
this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions);
cmProp package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY");
cmValue package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY");
if (package) {
featureDefinitions.CreateCMakePackageRegistryEntry(
package, GetOption("CPACK_WIX_UPGRADE_GUID"));
@@ -541,7 +541,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
}
bool emitUninstallShortcut = true;
cmProp cpackWixProgramMenuFolder =
cmValue cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == ".") {
emitUninstallShortcut = false;
@@ -595,7 +595,7 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
std::string result = "ProgramFiles<64>Folder";
cmProp rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID");
cmValue rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID");
if (rootFolderId) {
result = *rootFolderId;
}
@@ -612,7 +612,7 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
{
std::string wixTemplate = FindTemplate("WIX.template.in");
if (cmProp wixtpl = GetOption("CPACK_WIX_TEMPLATE")) {
if (cmValue wixtpl = GetOption("CPACK_WIX_TEMPLATE")) {
wixTemplate = *wixtpl;
}
@@ -669,7 +669,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
featureDefinitions.AddAttribute("Id", featureId);
std::vector<std::string> cpackPackageExecutablesList;
cmProp cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
cmValue cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) {
cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList);
if (cpackPackageExecutablesList.size() % 2 != 0) {
@@ -683,7 +683,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
}
std::vector<std::string> cpackPackageDesktopLinksList;
cmProp cpackPackageDesktopLinks = GetOption("CPACK_CREATE_DESKTOP_LINKS");
cmValue cpackPackageDesktopLinks = GetOption("CPACK_CREATE_DESKTOP_LINKS");
if (cpackPackageDesktopLinks) {
cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList);
}
@@ -742,7 +742,7 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
std::string directoryId;
switch (type) {
case cmWIXShortcuts::START_MENU: {
cmProp cpackWixProgramMenuFolder =
cmValue cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == ".") {
directoryId = "ProgramMenuFolder";
@@ -803,7 +803,7 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
fileDefinitions);
if (type == cmWIXShortcuts::START_MENU) {
cmProp cpackWixProgramMenuFolder =
cmValue cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder != ".") {
fileDefinitions.EmitRemoveFolder("CM_REMOVE_PROGRAM_MENU_FOLDER" +
@@ -970,7 +970,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions(
bool cmCPackWIXGenerator::RequireOption(std::string const& name,
std::string& value) const
{
cmProp tmp = GetOption(name);
cmValue tmp = GetOption(name);
if (tmp) {
value = *tmp;
@@ -1143,7 +1143,7 @@ bool cmCPackWIXGenerator::IsLegalIdCharacter(char c)
void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
extension_set_t& extensions)
{
cmProp variableContent = GetOption(variableName);
cmValue variableContent = GetOption(variableName);
if (!variableContent)
return;
@@ -1154,7 +1154,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
xmlns_map_t& namespaces)
{
cmProp variableContent = GetOption(variableName);
cmValue variableContent = GetOption(variableName);
if (!variableContent) {
return;
}
@@ -1183,7 +1183,7 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
std::ostream& stream)
{
cmProp variableContent = GetOption(variableName);
cmValue variableContent = GetOption(variableName);
if (!variableContent)
return;
+2 -2
View File
@@ -12,9 +12,9 @@
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmWorkingDirectory.h"
cmCPackGenerator* cmCPackArchiveGenerator::Create7ZGenerator()
@@ -118,7 +118,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) {
filePrefix = cmStrCat(this->GetOption("CPACK_PACKAGE_FILE_NAME"), '/');
}
cmProp installPrefix = this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
cmValue installPrefix = this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
if (installPrefix && installPrefix->size() > 1 &&
(*installPrefix)[0] == '/') {
// add to file prefix and remove the leading '/'
+9 -8
View File
@@ -6,9 +6,9 @@
#include <vector>
#include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCPackBundleGenerator::cmCPackBundleGenerator() = default;
@@ -16,7 +16,7 @@ cmCPackBundleGenerator::~cmCPackBundleGenerator() = default;
int cmCPackBundleGenerator::InitializeInternal()
{
cmProp name = this->GetOption("CPACK_BUNDLE_NAME");
cmValue name = this->GetOption("CPACK_BUNDLE_NAME");
if (!name) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set to use the Bundle generator."
@@ -52,7 +52,7 @@ int cmCPackBundleGenerator::ConstructBundle()
{
// Get required arguments ...
cmProp cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME");
cmValue cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME");
if (cpack_bundle_name->empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set." << std::endl);
@@ -60,7 +60,7 @@ int cmCPackBundleGenerator::ConstructBundle()
return 0;
}
cmProp cpack_bundle_plist = this->GetOption("CPACK_BUNDLE_PLIST");
cmValue cpack_bundle_plist = this->GetOption("CPACK_BUNDLE_PLIST");
if (cpack_bundle_plist->empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_PLIST must be set." << std::endl);
@@ -68,7 +68,7 @@ int cmCPackBundleGenerator::ConstructBundle()
return 0;
}
cmProp cpack_bundle_icon = this->GetOption("CPACK_BUNDLE_ICON");
cmValue cpack_bundle_icon = this->GetOption("CPACK_BUNDLE_ICON");
if (cpack_bundle_icon->empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_ICON must be set." << std::endl);
@@ -77,7 +77,7 @@ int cmCPackBundleGenerator::ConstructBundle()
}
// Get optional arguments ...
cmProp cpack_bundle_startup_command =
cmValue cpack_bundle_startup_command =
this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND");
// The staging directory contains everything that will end-up inside the
@@ -173,7 +173,8 @@ bool cmCPackBundleGenerator::SupportsComponentInstallation() const
int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
{
cmProp cpack_apple_cert_app = this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP");
cmValue cpack_apple_cert_app =
this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP");
// codesign the application.
if (!cpack_apple_cert_app->empty()) {
@@ -188,7 +189,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
? *this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
: "--deep -f";
cmProp sign_files = this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES");
cmValue sign_files = this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES");
std::vector<std::string> relFiles = cmExpandedList(sign_files);
@@ -8,8 +8,8 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
cmCPackCygwinBinaryGenerator::cmCPackCygwinBinaryGenerator()
@@ -60,7 +60,7 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
cmProp patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
cmValue patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patchNumber) {
this->OutputExtension += "1";
cmCPackLogger(cmCPackLog::LOG_WARNING,
@@ -8,8 +8,8 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
// Includes needed for implementation of RenameFile. This is not in
@@ -95,7 +95,7 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
}
std::string outerTarFile =
cmStrCat(this->GetOption("CPACK_TEMPORARY_DIRECTORY"), '-');
cmProp patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
cmValue patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER"
@@ -147,7 +147,7 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
cmProp patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
cmValue patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER"
+31 -31
View File
@@ -20,9 +20,9 @@
#include "cmCPackLog.h"
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
namespace {
@@ -31,12 +31,12 @@ class DebGenerator
public:
DebGenerator(cmCPackLog* logger, std::string outputName, std::string workDir,
std::string topLevelDir, std::string temporaryDir,
cmProp debianCompressionType, cmProp numThreads,
cmProp debianArchiveType,
cmValue debianCompressionType, cmValue numThreads,
cmValue debianArchiveType,
std::map<std::string, std::string> controlValues,
bool genShLibs, std::string shLibsFilename, bool genPostInst,
std::string postInst, bool genPostRm, std::string postRm,
cmProp controlExtra, bool permissionStrctPolicy,
cmValue controlExtra, bool permissionStrctPolicy,
std::vector<std::string> packageFiles);
bool generate() const;
@@ -64,22 +64,20 @@ private:
const std::string PostInst;
const bool GenPostRm;
const std::string PostRm;
cmProp ControlExtra;
cmValue ControlExtra;
const bool PermissionStrictPolicy;
const std::vector<std::string> PackageFiles;
cmArchiveWrite::Compress TarCompressionType;
};
DebGenerator::DebGenerator(cmCPackLog* logger, std::string outputName,
std::string workDir, std::string topLevelDir,
std::string temporaryDir, cmProp debCompressionType,
cmProp numThreads, cmProp debianArchiveType,
std::map<std::string, std::string> controlValues,
bool genShLibs, std::string shLibsFilename,
bool genPostInst, std::string postInst,
bool genPostRm, std::string postRm,
cmProp controlExtra, bool permissionStrictPolicy,
std::vector<std::string> packageFiles)
DebGenerator::DebGenerator(
cmCPackLog* logger, std::string outputName, std::string workDir,
std::string topLevelDir, std::string temporaryDir,
cmValue debCompressionType, cmValue numThreads, cmValue debianArchiveType,
std::map<std::string, std::string> controlValues, bool genShLibs,
std::string shLibsFilename, bool genPostInst, std::string postInst,
bool genPostRm, std::string postRm, cmValue controlExtra,
bool permissionStrictPolicy, std::vector<std::string> packageFiles)
: Logger(logger)
, OutputName(std::move(outputName))
, WorkDir(std::move(workDir))
@@ -703,7 +701,7 @@ bool cmCPackDebGenerator::createDebPackages()
bool retval =
make_package(this->GetOption("GEN_WDIR"), "GEN_CPACK_OUTPUT_FILE_NAME",
&cmCPackDebGenerator::createDeb);
cmProp dbgsymdir_path = this->GetOption("GEN_DBGSYMDIR");
cmValue dbgsymdir_path = this->GetOption("GEN_DBGSYMDIR");
if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") && dbgsymdir_path) {
retval = make_package(dbgsymdir_path, "GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME",
&cmCPackDebGenerator::createDbgsymDDeb) &&
@@ -732,54 +730,56 @@ bool cmCPackDebGenerator::createDeb()
controlValues["Description"] =
*this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DESCRIPTION");
cmProp debian_pkg_source =
cmValue debian_pkg_source =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
if (cmNonempty(debian_pkg_source)) {
controlValues["Source"] = *debian_pkg_source;
}
cmProp debian_pkg_dep = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DEPENDS");
cmValue debian_pkg_dep = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DEPENDS");
if (cmNonempty(debian_pkg_dep)) {
controlValues["Depends"] = *debian_pkg_dep;
}
cmProp debian_pkg_rec =
cmValue debian_pkg_rec =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS");
if (cmNonempty(debian_pkg_rec)) {
controlValues["Recommends"] = *debian_pkg_rec;
}
cmProp debian_pkg_sug = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS");
cmValue debian_pkg_sug =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS");
if (cmNonempty(debian_pkg_sug)) {
controlValues["Suggests"] = *debian_pkg_sug;
}
cmProp debian_pkg_url = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_HOMEPAGE");
cmValue debian_pkg_url =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_HOMEPAGE");
if (cmNonempty(debian_pkg_url)) {
controlValues["Homepage"] = *debian_pkg_url;
}
cmProp debian_pkg_predep =
cmValue debian_pkg_predep =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PREDEPENDS");
if (cmNonempty(debian_pkg_predep)) {
controlValues["Pre-Depends"] = *debian_pkg_predep;
}
cmProp debian_pkg_enhances =
cmValue debian_pkg_enhances =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ENHANCES");
if (cmNonempty(debian_pkg_enhances)) {
controlValues["Enhances"] = *debian_pkg_enhances;
}
cmProp debian_pkg_breaks =
cmValue debian_pkg_breaks =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_BREAKS");
if (cmNonempty(debian_pkg_breaks)) {
controlValues["Breaks"] = *debian_pkg_breaks;
}
cmProp debian_pkg_conflicts =
cmValue debian_pkg_conflicts =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONFLICTS");
if (cmNonempty(debian_pkg_conflicts)) {
controlValues["Conflicts"] = *debian_pkg_conflicts;
}
cmProp debian_pkg_provides =
cmValue debian_pkg_provides =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PROVIDES");
if (cmNonempty(debian_pkg_provides)) {
controlValues["Provides"] = *debian_pkg_provides;
}
cmProp debian_pkg_replaces =
cmValue debian_pkg_replaces =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_REPLACES");
if (cmNonempty(debian_pkg_replaces)) {
controlValues["Replaces"] = *debian_pkg_replaces;
@@ -788,7 +788,7 @@ bool cmCPackDebGenerator::createDeb()
const std::string strGenWDIR(this->GetOption("GEN_WDIR"));
const std::string shlibsfilename = strGenWDIR + "/shlibs";
cmProp debian_pkg_shlibs =
cmValue debian_pkg_shlibs =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SHLIBS");
const bool gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") &&
cmNonempty(debian_pkg_shlibs);
@@ -845,7 +845,7 @@ bool cmCPackDebGenerator::createDbgsymDDeb()
// debian policy enforce lower case for package name
std::string packageNameLower = cmsys::SystemTools::LowerCase(
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME"));
cmProp debian_pkg_version =
cmValue debian_pkg_version =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_VERSION");
controlValues["Package"] = packageNameLower + "-dbgsym";
@@ -864,12 +864,12 @@ bool cmCPackDebGenerator::createDbgsymDDeb()
controlValues["Description"] =
std::string("debug symbols for ") + packageNameLower;
cmProp debian_pkg_source =
cmValue debian_pkg_source =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
if (cmNonempty(debian_pkg_source)) {
controlValues["Source"] = *debian_pkg_source;
}
cmProp debian_build_ids = this->GetOption("GEN_BUILD_IDS");
cmValue debian_build_ids = this->GetOption("GEN_BUILD_IDS");
if (cmNonempty(debian_build_ids)) {
controlValues["Build-Ids"] = *debian_build_ids;
}
+7 -7
View File
@@ -18,9 +18,9 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
#ifdef HAVE_CoreServices
@@ -261,7 +261,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
const std::string& output_file)
{
// Get optional arguments ...
cmProp cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON");
cmValue cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON");
const std::string cpack_dmg_volume_name =
this->GetOption("CPACK_DMG_VOLUME_NAME")
@@ -281,14 +281,14 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string cpack_license_file =
*this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
cmProp cpack_dmg_background_image =
cmValue cpack_dmg_background_image =
this->GetOption("CPACK_DMG_BACKGROUND_IMAGE");
cmProp cpack_dmg_ds_store = this->GetOption("CPACK_DMG_DS_STORE");
cmValue cpack_dmg_ds_store = this->GetOption("CPACK_DMG_DS_STORE");
cmProp cpack_dmg_languages = this->GetOption("CPACK_DMG_SLA_LANGUAGES");
cmValue cpack_dmg_languages = this->GetOption("CPACK_DMG_SLA_LANGUAGES");
cmProp cpack_dmg_ds_store_setup_script =
cmValue cpack_dmg_ds_store_setup_script =
this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT");
const bool cpack_dmg_disable_applications_symlink =
@@ -706,7 +706,7 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to.
std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
cmProp _groupName = this->GetOption(groupVar);
cmValue _groupName = this->GetOption(groupVar);
if (_groupName) {
std::string groupName = _groupName;
+9 -9
View File
@@ -16,9 +16,9 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
int cmCPackExternalGenerator::InitializeInternal()
{
@@ -61,7 +61,7 @@ int cmCPackExternalGenerator::PackageFiles()
return 0;
}
cmProp packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT");
cmValue packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT");
if (cmNonempty(packageScript)) {
if (!cmSystemTools::FileIsFullPath(packageScript)) {
cmCPackLogger(
@@ -77,7 +77,7 @@ int cmCPackExternalGenerator::PackageFiles()
return 0;
}
cmProp builtPackages = this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES");
cmValue builtPackages = this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES");
if (builtPackages) {
cmExpandList(builtPackages, this->packageFileNames, false);
}
@@ -181,34 +181,34 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
return 0;
}
cmProp packageName = this->Parent->GetOption("CPACK_PACKAGE_NAME");
cmValue packageName = this->Parent->GetOption("CPACK_PACKAGE_NAME");
if (packageName) {
root["packageName"] = *packageName;
}
cmProp packageVersion = this->Parent->GetOption("CPACK_PACKAGE_VERSION");
cmValue packageVersion = this->Parent->GetOption("CPACK_PACKAGE_VERSION");
if (packageVersion) {
root["packageVersion"] = *packageVersion;
}
cmProp packageDescriptionFile =
cmValue packageDescriptionFile =
this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
if (packageDescriptionFile) {
root["packageDescriptionFile"] = *packageDescriptionFile;
}
cmProp packageDescriptionSummary =
cmValue packageDescriptionSummary =
this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY");
if (packageDescriptionSummary) {
root["packageDescriptionSummary"] = *packageDescriptionSummary;
}
cmProp buildConfigCstr = this->Parent->GetOption("CPACK_BUILD_CONFIG");
cmValue buildConfigCstr = this->Parent->GetOption("CPACK_BUILD_CONFIG");
if (buildConfigCstr) {
root["buildConfig"] = *buildConfigCstr;
}
cmProp defaultDirectoryPermissions =
cmValue defaultDirectoryPermissions =
this->Parent->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(defaultDirectoryPermissions)) {
root["defaultDirectoryPermissions"] = *defaultDirectoryPermissions;
+1 -1
View File
@@ -203,7 +203,7 @@ cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
// basically a wrapper that handles the NULL-ptr return from GetOption().
std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name)
{
cmProp pv = this->GetOption(var_name);
cmValue pv = this->GetOption(var_name);
if (!pv) {
return std::string();
}
+48 -48
View File
@@ -20,11 +20,11 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmWorkingDirectory.h"
#include "cmXMLSafe.h"
@@ -78,14 +78,14 @@ int cmCPackGenerator::PrepareNames()
std::string tempDirectory =
cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/_CPack_Packages/");
cmProp toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG");
cmValue toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG");
if (toplevelTag) {
tempDirectory += *toplevelTag;
tempDirectory += "/";
}
tempDirectory += *this->GetOption("CPACK_GENERATOR");
std::string topDirectory = tempDirectory;
cmProp pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME");
cmValue pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME");
if (!pfname) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
@@ -99,7 +99,7 @@ int cmCPackGenerator::PrepareNames()
return 0;
}
outName += this->GetOutputExtension();
cmProp pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY");
cmValue pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY");
if (!pdir) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_DIRECTORY not specified" << std::endl);
@@ -123,7 +123,7 @@ int cmCPackGenerator::PrepareNames()
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl);
cmProp descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
cmValue descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
if (descFileName && !this->GetOption("CPACK_PACKAGE_DESCRIPTION")) {
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: " << descFileName << std::endl);
@@ -149,7 +149,7 @@ int cmCPackGenerator::PrepareNames()
ostr << cmXMLSafe(line) << std::endl;
}
this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str());
cmProp defFileName =
cmValue defFileName =
this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE");
if (defFileName && (defFileName == descFileName)) {
this->SetOption("CPACK_USED_DEFAULT_PACKAGE_DESCRIPTION_FILE", "ON");
@@ -163,7 +163,7 @@ int cmCPackGenerator::PrepareNames()
<< std::endl);
return 0;
}
cmProp algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
cmValue algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
if (algoSignature) {
if (!cmCryptoHash::New(*algoSignature)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -213,7 +213,7 @@ int cmCPackGenerator::InstallProject()
// prepare default created directory permissions
mode_t default_dir_mode_v = 0;
mode_t* default_dir_mode = nullptr;
cmProp default_dir_install_permissions =
cmValue default_dir_install_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(default_dir_install_permissions)) {
std::vector<std::string> items =
@@ -264,7 +264,7 @@ int cmCPackGenerator::InstallProject()
}
// Run pre-build actions
cmProp preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
cmValue preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
if (preBuildScripts) {
const auto scripts = cmExpandedList(preBuildScripts, false);
for (const auto& script : scripts) {
@@ -291,7 +291,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
bool setDestDir, const std::string& tempInstallDirectory)
{
(void)setDestDir;
cmProp installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
cmValue installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
if (cmNonempty(installCommands)) {
std::string tempInstallDirectoryEnv =
cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory);
@@ -331,7 +331,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
(void)setDestDir;
(void)tempInstallDirectory;
std::vector<cmsys::RegularExpression> ignoreFilesRegex;
cmProp cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES");
cmValue cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES");
if (cpackIgnoreFiles) {
std::vector<std::string> ignoreFilesRegexString =
cmExpandedList(cpackIgnoreFiles);
@@ -341,7 +341,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
ignoreFilesRegex.emplace_back(ifr);
}
}
cmProp installDirectories = this->GetOption("CPACK_INSTALLED_DIRECTORIES");
cmValue installDirectories = this->GetOption("CPACK_INSTALLED_DIRECTORIES");
if (cmNonempty(installDirectories)) {
std::vector<std::string> installDirectoriesVector =
cmExpandedList(installDirectories);
@@ -469,9 +469,9 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
int cmCPackGenerator::InstallProjectViaInstallScript(
bool setDestDir, const std::string& tempInstallDirectory)
{
cmProp cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS");
cmValue cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS");
{
cmProp const cmakeScript = this->GetOption("CPACK_INSTALL_SCRIPT");
cmValue const cmakeScript = this->GetOption("CPACK_INSTALL_SCRIPT");
if (cmakeScript && cmakeScripts) {
cmCPackLogger(
cmCPackLog::LOG_WARNING,
@@ -537,8 +537,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
bool setDestDir, const std::string& baseTempInstallDirectory,
const mode_t* default_dir_mode)
{
cmProp cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
cmProp cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
cmValue cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
cmValue cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
std::string absoluteDestFiles;
if (cmNonempty(cmakeProjects)) {
if (!cmakeGenerator) {
@@ -592,7 +592,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// Determine the installation types for this project (if provided).
std::string installTypesVar = "CPACK_" +
cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
cmProp installTypes = this->GetOption(installTypesVar);
cmValue installTypes = this->GetOption(installTypesVar);
if (cmNonempty(installTypes)) {
std::vector<std::string> installTypesVector =
cmExpandedList(installTypes);
@@ -605,7 +605,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// Determine the set of components that will be used in this project
std::string componentsVar =
"CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component);
cmProp components = this->GetOption(componentsVar);
cmValue components = this->GetOption(componentsVar);
if (cmNonempty(components)) {
cmExpandList(components, componentsVector);
for (std::string const& comp : componentsVector) {
@@ -762,7 +762,7 @@ int cmCPackGenerator::InstallCMakeProject(
}
}
cmProp default_dir_inst_permissions =
cmValue default_dir_inst_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(default_dir_inst_permissions)) {
mf.AddDefinition("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS",
@@ -915,7 +915,7 @@ int cmCPackGenerator::InstallCMakeProject(
// forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES
// to CPack (may be used by generators like CPack RPM or DEB)
// in order to transparently handle ABSOLUTE PATH
if (cmProp def = mf.GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")) {
if (cmValue def = mf.GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")) {
mf.AddDefinition("CPACK_ABSOLUTE_DESTINATION_FILES", *def);
}
@@ -949,7 +949,7 @@ int cmCPackGenerator::InstallCMakeProject(
}
}
if (cmProp d = mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
if (cmValue d = mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
if (!absoluteDestFiles.empty()) {
absoluteDestFiles += ";";
}
@@ -993,7 +993,7 @@ template <typename ValueType>
void cmCPackGenerator::StoreOptionIfNotSet(const std::string& op,
ValueType value)
{
cmProp def = this->MakefileMap->GetDefinition(op);
cmValue def = this->MakefileMap->GetDefinition(op);
if (cmNonempty(def)) {
return;
}
@@ -1005,7 +1005,7 @@ void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
{
this->StoreOptionIfNotSet(op, value);
}
void cmCPackGenerator::SetOptionIfNotSet(const std::string& op, cmProp value)
void cmCPackGenerator::SetOptionIfNotSet(const std::string& op, cmValue value)
{
this->StoreOptionIfNotSet(op, value);
}
@@ -1027,7 +1027,7 @@ void cmCPackGenerator::SetOption(const std::string& op, const char* value)
{
this->StoreOption(op, value);
}
void cmCPackGenerator::SetOption(const std::string& op, cmProp value)
void cmCPackGenerator::SetOption(const std::string& op, cmValue value)
{
this->StoreOption(op, value);
}
@@ -1049,7 +1049,7 @@ int cmCPackGenerator::DoPackage()
}
if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
cmProp toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
cmValue toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (cmSystemTools::FileExists(toplevelDirectory)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove toplevel directory: " << toplevelDirectory
@@ -1070,9 +1070,9 @@ int cmCPackGenerator::DoPackage()
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Done install project " << std::endl);
cmProp tempPackageFileName =
cmValue tempPackageFileName =
this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME");
cmProp tempDirectory = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
cmValue tempDirectory = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
cmsys::Glob gl;
@@ -1124,7 +1124,7 @@ int cmCPackGenerator::DoPackage()
}
}
// Run post-build actions
cmProp postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS");
cmValue postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS");
if (postBuildScripts) {
this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES",
cmJoin(this->packageFileNames, ";"));
@@ -1144,7 +1144,7 @@ int cmCPackGenerator::DoPackage()
}
/* Prepare checksum algorithm*/
cmProp algo = this->GetOption("CPACK_PACKAGE_CHECKSUM");
cmValue algo = this->GetOption("CPACK_PACKAGE_CHECKSUM");
std::unique_ptr<cmCryptoHash> crypto = cmCryptoHash::New(*algo);
/*
@@ -1160,7 +1160,7 @@ int cmCPackGenerator::DoPackage()
for (std::string const& pkgFileName : this->packageFileNames) {
std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
std::string filename(cmSystemTools::GetFilenameName(pkgFileName));
tempPackageFileName = cmProp(pkgFileName);
tempPackageFileName = cmValue(pkgFileName);
tmpPF += "/" + filename;
const char* packageFileName = tmpPF.c_str();
cmCPackLogger(cmCPackLog::LOG_DEBUG,
@@ -1209,7 +1209,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
// set the running generator name
this->SetOption("CPACK_GENERATOR", this->Name);
// Load the project specific config file
cmProp config = this->GetOption("CPACK_PROJECT_CONFIG_FILE");
cmValue config = this->GetOption("CPACK_PROJECT_CONFIG_FILE");
if (config) {
mf->ReadListFile(config);
}
@@ -1243,7 +1243,7 @@ bool cmCPackGenerator::IsOn(const std::string& name) const
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
{
cmProp ret = this->MakefileMap->GetDefinition(op);
cmValue ret = this->MakefileMap->GetDefinition(op);
if (cmNonempty(ret)) {
return cmIsOff(*ret);
}
@@ -1252,16 +1252,16 @@ bool cmCPackGenerator::IsSetToOff(const std::string& op) const
bool cmCPackGenerator::IsSetToEmpty(const std::string& op) const
{
cmProp ret = this->MakefileMap->GetDefinition(op);
cmValue ret = this->MakefileMap->GetDefinition(op);
if (ret) {
return ret->empty();
}
return false;
}
cmProp cmCPackGenerator::GetOption(const std::string& op) const
cmValue cmCPackGenerator::GetOption(const std::string& op) const
{
cmProp ret = this->MakefileMap->GetDefinition(op);
cmValue ret = this->MakefileMap->GetDefinition(op);
if (!ret) {
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Warning, GetOption return NULL for: " << op << std::endl);
@@ -1481,7 +1481,7 @@ std::string cmCPackGenerator::GetComponentPackageFileName(
if (isGroupName) {
std::string groupDispVar = "CPACK_COMPONENT_GROUP_" +
cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
cmProp groupDispName = this->GetOption(groupDispVar);
cmValue groupDispName = this->GetOption(groupDispVar);
if (groupDispName) {
suffix = "-" + *groupDispName;
}
@@ -1490,7 +1490,7 @@ std::string cmCPackGenerator::GetComponentPackageFileName(
else {
std::string dispVar = "CPACK_COMPONENT_" +
cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
cmProp dispName = this->GetOption(dispVar);
cmValue dispName = this->GetOption(dispVar);
if (dispName) {
suffix = "-" + *dispName;
}
@@ -1535,7 +1535,7 @@ cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
"CPACK_INSTALL_TYPE_" + cmsys::SystemTools::UpperCase(name);
installType->Name = name;
cmProp displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
cmValue displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
if (cmNonempty(displayName)) {
installType->DisplayName = *displayName;
} else {
@@ -1557,7 +1557,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
std::string macroPrefix =
"CPACK_COMPONENT_" + cmsys::SystemTools::UpperCase(name);
component->Name = name;
cmProp displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
cmValue displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
if (cmNonempty(displayName)) {
component->DisplayName = *displayName;
} else {
@@ -1569,17 +1569,17 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") ||
cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
cmProp archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
cmValue archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
if (cmNonempty(archiveFile)) {
component->ArchiveFile = *archiveFile;
}
cmProp plist = this->GetOption(macroPrefix + "_PLIST");
cmValue plist = this->GetOption(macroPrefix + "_PLIST");
if (cmNonempty(plist)) {
component->Plist = *plist;
}
cmProp groupName = this->GetOption(macroPrefix + "_GROUP");
cmValue groupName = this->GetOption(macroPrefix + "_GROUP");
if (cmNonempty(groupName)) {
component->Group = this->GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component);
@@ -1587,13 +1587,13 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->Group = nullptr;
}
cmProp description = this->GetOption(macroPrefix + "_DESCRIPTION");
cmValue description = this->GetOption(macroPrefix + "_DESCRIPTION");
if (cmNonempty(description)) {
component->Description = *description;
}
// Determine the installation types.
cmProp installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
cmValue installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
if (cmNonempty(installTypes)) {
std::vector<std::string> installTypesVector =
cmExpandedList(installTypes);
@@ -1604,7 +1604,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
}
// Determine the component dependencies.
cmProp depends = this->GetOption(macroPrefix + "_DEPENDS");
cmValue depends = this->GetOption(macroPrefix + "_DEPENDS");
if (cmNonempty(depends)) {
std::vector<std::string> dependsVector = cmExpandedList(depends);
for (std::string const& depend : dependsVector) {
@@ -1628,20 +1628,20 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
if (!hasGroup) {
// Define the group
group->Name = name;
cmProp displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
cmValue displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
if (cmNonempty(displayName)) {
group->DisplayName = *displayName;
} else {
group->DisplayName = group->Name;
}
cmProp description = this->GetOption(macroPrefix + "_DESCRIPTION");
cmValue description = this->GetOption(macroPrefix + "_DESCRIPTION");
if (cmNonempty(description)) {
group->Description = *description;
}
group->IsBold = this->IsOn(macroPrefix + "_BOLD_TITLE");
group->IsExpandedByDefault = this->IsOn(macroPrefix + "_EXPANDED");
cmProp parentGroupName = this->GetOption(macroPrefix + "_PARENT_GROUP");
cmValue parentGroupName = this->GetOption(macroPrefix + "_PARENT_GROUP");
if (cmNonempty(parentGroupName)) {
group->ParentGroup =
this->GetComponentGroup(projectName, parentGroupName);
+6 -6
View File
@@ -12,8 +12,8 @@
#include "cm_sys_stat.h"
#include "cmCPackComponentGroup.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
class cmCPackLog;
class cmGlobalGenerator;
@@ -87,16 +87,16 @@ public:
void SetOption(const std::string& op, const char* value);
void SetOption(const std::string& op, const std::string& value)
{
this->SetOption(op, cmProp(value));
this->SetOption(op, cmValue(value));
}
void SetOption(const std::string& op, cmProp value);
void SetOption(const std::string& op, cmValue value);
void SetOptionIfNotSet(const std::string& op, const char* value);
void SetOptionIfNotSet(const std::string& op, const std::string& value)
{
this->SetOptionIfNotSet(op, cmProp(value));
this->SetOptionIfNotSet(op, cmValue(value));
}
void SetOptionIfNotSet(const std::string& op, cmProp value);
cmProp GetOption(const std::string& op) const;
void SetOptionIfNotSet(const std::string& op, cmValue value);
cmValue GetOption(const std::string& op) const;
std::vector<std::string> GetOptions() const;
bool IsSet(const std::string& name) const;
bool IsOn(const std::string& name) const;
+8 -8
View File
@@ -19,9 +19,9 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
/* NSIS uses different command line syntax on Windows and others */
#ifdef _WIN32
@@ -476,7 +476,7 @@ int cmCPackNSISGenerator::InitializeInternal()
cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs");
if (!resS || retVal ||
(!versionRex.find(output) && !versionRexCVS.find(output))) {
cmProp topDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
cmValue topDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
std::string tmpFile = cmStrCat(topDir ? *topDir : ".", "/NSISOutput.log");
cmGeneratedFileStream ofs(tmpFile);
ofs << "# Run command: " << nsisCmd << std::endl
@@ -509,11 +509,11 @@ int cmCPackNSISGenerator::InitializeInternal()
}
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath);
this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
cmProp cpackPackageExecutables =
cmValue cpackPackageExecutables =
this->GetOption("CPACK_PACKAGE_EXECUTABLES");
cmProp cpackPackageDeskTopLinks =
cmValue cpackPackageDeskTopLinks =
this->GetOption("CPACK_CREATE_DESKTOP_LINKS");
cmProp cpackNsisExecutablesDirectory =
cmValue cpackNsisExecutablesDirectory =
this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
std::vector<std::string> cpackPackageDesktopLinksVector;
if (cpackPackageDeskTopLinks) {
@@ -586,7 +586,7 @@ int cmCPackNSISGenerator::InitializeInternal()
void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
std::ostream& deleteStr)
{
cmProp cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS");
cmValue cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS");
if (!cpackMenuLinks) {
return;
}
@@ -725,7 +725,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
}
// Create the directory for the upload area
cmProp userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
cmValue userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
std::string uploadDirectory;
if (cmNonempty(userUploadDirectory)) {
uploadDirectory = *userUploadDirectory;
@@ -964,7 +964,7 @@ std::string cmCPackNSISGenerator::CreateComponentGroupDescription(
std::string cmCPackNSISGenerator::CustomComponentInstallDirectory(
cm::string_view componentName)
{
cmProp outputDir = this->GetOption(
cmValue outputDir = this->GetOption(
cmStrCat("CPACK_NSIS_", componentName, "_INSTALL_DIRECTORY"));
return outputDir ? *outputDir : "$INSTDIR";
}
+2 -2
View File
@@ -12,9 +12,9 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
bool cmCPackNuGetGenerator::SupportsComponentInstallation() const
{
@@ -120,7 +120,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup)
void cmCPackNuGetGenerator::AddGeneratedPackageNames()
{
cmProp const files_list = this->GetOption("GEN_CPACK_OUTPUT_FILES");
cmValue const files_list = this->GetOption("GEN_CPACK_OUTPUT_FILES");
if (!files_list) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
+3 -3
View File
@@ -10,9 +10,9 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCPackOSXX11Generator::cmCPackOSXX11Generator() = default;
@@ -23,7 +23,7 @@ int cmCPackOSXX11Generator::PackageFiles()
// TODO: Use toplevel ?
// It is used! Is this an obsolete comment?
cmProp cpackPackageExecutables =
cmValue cpackPackageExecutables =
this->GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) {
cmCPackLogger(cmCPackLog::LOG_DEBUG,
@@ -70,7 +70,7 @@ int cmCPackOSXX11Generator::PackageFiles()
const char* scrDir = scriptDirectory.c_str();
const char* contDir = contentsDirectory.c_str();
const char* rsrcFile = resourceFileName.c_str();
cmProp iconFile = this->GetOption("CPACK_PACKAGE_ICON");
cmValue iconFile = this->GetOption("CPACK_PACKAGE_ICON");
if (iconFile) {
std::string iconFileName = cmsys::SystemTools::GetFilenameName(iconFile);
if (!cmSystemTools::FileExists(iconFile)) {
+4 -4
View File
@@ -7,9 +7,9 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
cmCPackPKGGenerator::cmCPackPKGGenerator()
@@ -57,7 +57,7 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName,
std::string opt = (themeName == nullptr)
? cmStrCat("CPACK_", genName, "_BACKGROUND")
: cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix);
cmProp bgFileName = this->GetOption(opt);
cmValue bgFileName = this->GetOption(opt);
if (bgFileName == nullptr) {
return;
}
@@ -79,7 +79,7 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName,
xout.Attribute("file", bgFileName);
cmProp param = this->GetOption(cmStrCat(opt, "_ALIGNMENT"));
cmValue param = this->GetOption(cmStrCat(opt, "_ALIGNMENT"));
if (param != nullptr) {
xout.Attribute("alignment", param);
}
@@ -316,7 +316,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
{
std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
cmProp inFileName = this->GetOption(cpackVar);
cmValue inFileName = this->GetOption(cpackVar);
if (!inFileName) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack option: " << cpackVar.c_str()
@@ -16,9 +16,9 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
static inline unsigned int getVersion(unsigned int major, unsigned int minor)
@@ -80,9 +80,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
resDir += "/en.lproj";
}
cmProp preflight = this->GetOption("CPACK_PREFLIGHT_SCRIPT");
cmProp postflight = this->GetOption("CPACK_POSTFLIGHT_SCRIPT");
cmProp postupgrade = this->GetOption("CPACK_POSTUPGRADE_SCRIPT");
cmValue preflight = this->GetOption("CPACK_PREFLIGHT_SCRIPT");
cmValue postflight = this->GetOption("CPACK_POSTFLIGHT_SCRIPT");
cmValue postupgrade = this->GetOption("CPACK_POSTUPGRADE_SCRIPT");
if (this->Components.empty()) {
// Create directory structure
@@ -168,7 +168,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
// Create the directory where downloaded component packages will
// be placed.
cmProp userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
cmValue userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
std::string uploadDirectory;
if (userUploadDirectory && !userUploadDirectory->empty()) {
uploadDirectory = userUploadDirectory;
@@ -352,7 +352,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
"/PackageMaker.app/Contents/MacOS");
std::string pkgPath;
cmProp inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM");
cmValue inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM");
if (inst_program && !inst_program->empty()) {
pkgPath = inst_program;
} else {
@@ -427,7 +427,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
// Determine the package compatibility version. If it wasn't
// specified by the user, we define it based on which features the
// user requested.
cmProp packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
cmValue packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
if (packageCompat && !packageCompat->empty()) {
unsigned int majorVersion = 10;
unsigned int minorVersion = 5;
@@ -10,9 +10,9 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCPackProductBuildGenerator::cmCPackProductBuildGenerator()
{
@@ -88,11 +88,11 @@ int cmCPackProductBuildGenerator::PackageFiles()
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string productbuild = this->GetOption("CPACK_COMMAND_PRODUCTBUILD");
std::string identityName;
if (cmProp n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) {
if (cmValue n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) {
identityName = n;
}
std::string keychainPath;
if (cmProp p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) {
if (cmValue p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) {
keychainPath = p;
}
@@ -174,8 +174,8 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
const char* comp_name = component ? component->Name.c_str() : nullptr;
cmProp preflight = this->GetComponentScript("PREFLIGHT", comp_name);
cmProp postflight = this->GetComponentScript("POSTFLIGHT", comp_name);
cmValue preflight = this->GetComponentScript("PREFLIGHT", comp_name);
cmValue postflight = this->GetComponentScript("POSTFLIGHT", comp_name);
std::string resDir = packageFileDir;
if (component) {
@@ -214,11 +214,11 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string pkgbuild = this->GetOption("CPACK_COMMAND_PKGBUILD");
std::string identityName;
if (cmProp n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) {
if (cmValue n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) {
identityName = n;
}
std::string keychainPath;
if (cmProp p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) {
if (cmValue p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) {
keychainPath = p;
}
@@ -240,7 +240,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
return RunProductBuild(pkgCmd.str());
}
cmProp cmCPackProductBuildGenerator::GetComponentScript(
cmValue cmCPackProductBuildGenerator::GetComponentScript(
const char* script, const char* component_name)
{
std::string scriptname = std::string("CPACK_") + script + "_";
+2 -2
View File
@@ -8,7 +8,7 @@
#include "cmCPackGenerator.h"
#include "cmCPackPKGGenerator.h"
#include "cmProperty.h"
#include "cmValue.h"
class cmCPackComponent;
@@ -46,5 +46,5 @@ protected:
const std::string& packageDir,
const cmCPackComponent* component);
cmProp GetComponentScript(const char* script, const char* script_component);
cmValue GetComponentScript(const char* script, const char* script_component);
};
+2 -2
View File
@@ -12,9 +12,9 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCPackRPMGenerator::cmCPackRPMGenerator() = default;
@@ -102,7 +102,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
this->packageFileNames.clear();
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
cmProp mainComponent = this->GetOption("CPACK_RPM_MAIN_COMPONENT");
cmValue mainComponent = this->GetOption("CPACK_RPM_MAIN_COMPONENT");
if (this->IsOn("CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE") &&
!this->IsOn("CPACK_RPM_DEBUGINFO_PACKAGE")) {
+1 -1
View File
@@ -14,8 +14,8 @@
#include "cmArchiveWrite.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCPackSTGZGenerator::cmCPackSTGZGenerator()
: cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, "paxr", ".sh")
+8 -8
View File
@@ -22,11 +22,11 @@
#include "cmDocumentationFormatter.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
namespace {
@@ -326,11 +326,11 @@ int main(int argc, char const* const* argv)
cmSystemTools::CollapseFullPath(cpackProjectDirectory);
globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory);
cmProp cpackModulesPath = globalMF.GetDefinition("CPACK_MODULE_PATH");
cmValue cpackModulesPath = globalMF.GetDefinition("CPACK_MODULE_PATH");
if (cpackModulesPath) {
globalMF.AddDefinition("CMAKE_MODULE_PATH", *cpackModulesPath);
}
cmProp genList = globalMF.GetDefinition("CPACK_GENERATOR");
cmValue genList = globalMF.GetDefinition("CPACK_GENERATOR");
if (!genList) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"CPack generator not specified" << std::endl);
@@ -408,20 +408,20 @@ int main(int argc, char const* const* argv)
parsed = 0;
}
if (parsed) {
cmProp projName = mf->GetDefinition("CPACK_PACKAGE_NAME");
cmValue projName = mf->GetDefinition("CPACK_PACKAGE_NAME");
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Use generator: " << cpackGenerator->GetNameOfClass()
<< std::endl);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"For project: " << *projName << std::endl);
cmProp projVersion = mf->GetDefinition("CPACK_PACKAGE_VERSION");
cmValue projVersion = mf->GetDefinition("CPACK_PACKAGE_VERSION");
if (!projVersion) {
cmProp projVersionMajor =
cmValue projVersionMajor =
mf->GetDefinition("CPACK_PACKAGE_VERSION_MAJOR");
cmProp projVersionMinor =
cmValue projVersionMinor =
mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR");
cmProp projVersionPatch =
cmValue projVersionPatch =
mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH");
std::ostringstream ostr;
ostr << *projVersionMajor << "." << *projVersionMinor << "."
+6 -6
View File
@@ -11,9 +11,9 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
class cmExecutionStatus;
@@ -39,13 +39,13 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
this->Handler = handler;
cmProp ctestBuildCommand =
cmValue ctestBuildCommand =
this->Makefile->GetDefinition("CTEST_BUILD_COMMAND");
if (cmNonempty(ctestBuildCommand)) {
this->CTest->SetCTestConfiguration("MakeCommand", *ctestBuildCommand,
this->Quiet);
} else {
cmProp cmakeGeneratorName =
cmValue cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
// Build configuration is determined by: CONFIGURATION argument,
@@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
// CTEST_CONFIGURATION_TYPE script variable, or ctest -C command
// line argument... in that order.
//
cmProp ctestBuildConfiguration =
cmValue ctestBuildConfiguration =
this->Makefile->GetDefinition("CTEST_BUILD_CONFIGURATION");
std::string cmakeBuildConfiguration = cmNonempty(this->Configuration)
? this->Configuration
@@ -119,13 +119,13 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
}
}
if (cmProp useLaunchers =
if (cmValue useLaunchers =
this->Makefile->GetDefinition("CTEST_USE_LAUNCHERS")) {
this->CTest->SetCTestConfiguration("UseLaunchers", *useLaunchers,
this->Quiet);
}
if (cmProp labelsForSubprojects =
if (cmValue labelsForSubprojects =
this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
*labelsForSubprojects, this->Quiet);
+3 -3
View File
@@ -19,10 +19,10 @@
#include "cmGeneratedFileStream.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmStringReplaceHelper.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
static const char* cmCTestErrorMatches[] = {
@@ -249,11 +249,11 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile* mf)
}
// Record the user-specified custom warning rules.
if (cmProp customWarningMatchers =
if (cmValue customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH")) {
cmExpandList(*customWarningMatchers, this->ReallyCustomWarningMatches);
}
if (cmProp customWarningExceptions =
if (cmValue customWarningExceptions =
mf->GetDefinition("CTEST_CUSTOM_WARNING_EXCEPTION")) {
cmExpandList(*customWarningExceptions,
this->ReallyCustomWarningExceptions);
+6 -6
View File
@@ -12,9 +12,9 @@
#include "cmCTestConfigureHandler.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
void cmCTestConfigureCommand::BindArguments()
@@ -39,14 +39,14 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
return nullptr;
}
cmProp ctestConfigureCommand =
cmValue ctestConfigureCommand =
this->Makefile->GetDefinition("CTEST_CONFIGURE_COMMAND");
if (cmNonempty(ctestConfigureCommand)) {
this->CTest->SetCTestConfiguration("ConfigureCommand",
*ctestConfigureCommand, this->Quiet);
} else {
cmProp cmakeGeneratorName =
cmValue cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
if (cmNonempty(cmakeGeneratorName)) {
const std::string& source_dir =
@@ -106,7 +106,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmakeConfigureCommand += *cmakeGeneratorName;
cmakeConfigureCommand += "\"";
cmProp cmakeGeneratorPlatform =
cmValue cmakeGeneratorPlatform =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_PLATFORM");
if (cmNonempty(cmakeGeneratorPlatform)) {
cmakeConfigureCommand += " \"-A";
@@ -114,7 +114,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmakeConfigureCommand += "\"";
}
cmProp cmakeGeneratorToolset =
cmValue cmakeGeneratorToolset =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_TOOLSET");
if (cmNonempty(cmakeGeneratorToolset)) {
cmakeConfigureCommand += " \"-T";
@@ -137,7 +137,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
}
if (cmProp labelsForSubprojects =
if (cmValue labelsForSubprojects =
this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
*labelsForSubprojects, this->Quiet);
+1
View File
@@ -18,6 +18,7 @@
#include "cmProcessTools.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
static unsigned int cmCTestGITVersion(unsigned int epic, unsigned int major,
unsigned int minor, unsigned int fix)
+5 -5
View File
@@ -36,7 +36,7 @@ void SetMapValue(cmCTestGenericHandler::t_StringToString& map,
map[op] = value;
}
void SetMapValue(cmCTestGenericHandler::t_StringToString& map,
const std::string& op, cmProp value)
const std::string& op, cmValue value)
{
if (!value) {
map.erase(op);
@@ -51,7 +51,7 @@ void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
{
SetMapValue(this->Options, op, value);
}
void cmCTestGenericHandler::SetOption(const std::string& op, cmProp value)
void cmCTestGenericHandler::SetOption(const std::string& op, cmValue value)
{
SetMapValue(this->Options, op, value);
}
@@ -63,7 +63,7 @@ void cmCTestGenericHandler::SetPersistentOption(const std::string& op,
SetMapValue(this->PersistentOptions, op, value);
}
void cmCTestGenericHandler::SetPersistentOption(const std::string& op,
cmProp value)
cmValue value)
{
this->SetOption(op, value);
SetMapValue(this->PersistentOptions, op, value);
@@ -94,13 +94,13 @@ void cmCTestGenericHandler::Initialize()
this->MultiOptions = this->PersistentMultiOptions;
}
cmProp cmCTestGenericHandler::GetOption(const std::string& op)
cmValue cmCTestGenericHandler::GetOption(const std::string& op)
{
auto remit = this->Options.find(op);
if (remit == this->Options.end()) {
return nullptr;
}
return cmProp(remit->second);
return cmValue(remit->second);
}
std::vector<std::string> cmCTestGenericHandler::GetMultiOption(
+6 -6
View File
@@ -11,8 +11,8 @@
#include <stddef.h>
#include "cmCTest.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
class cmGeneratedFileStream;
class cmMakefile;
@@ -89,16 +89,16 @@ public:
void SetPersistentOption(const std::string& op, const char* value);
void SetPersistentOption(const std::string& op, const std::string& value)
{
this->SetPersistentOption(op, cmProp(value));
this->SetPersistentOption(op, cmValue(value));
}
void SetPersistentOption(const std::string& op, cmProp value);
void SetPersistentOption(const std::string& op, cmValue value);
void SetOption(const std::string& op, const char* value);
void SetOption(const std::string& op, const std::string& value)
{
this->SetOption(op, cmProp(value));
this->SetOption(op, cmValue(value));
}
void SetOption(const std::string& op, cmProp value);
cmProp GetOption(const std::string& op);
void SetOption(const std::string& op, cmValue value);
cmValue GetOption(const std::string& op);
/**
* Multi-Options collect one or more values from flags; passing
+3 -3
View File
@@ -14,9 +14,9 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmWorkingDirectory.h"
namespace {
@@ -126,7 +126,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
// CTEST_CONFIGURATION_TYPE script variable if it is defined.
// The current script value trumps the -C argument on the command
// line.
cmProp ctestConfigType =
cmValue ctestConfigType =
this->Makefile->GetDefinition("CTEST_CONFIGURATION_TYPE");
if (ctestConfigType) {
this->CTest->SetConfigType(*ctestConfigType);
@@ -161,7 +161,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
this->Quiet);
}
if (cmProp changeId = this->Makefile->GetDefinition("CTEST_CHANGE_ID")) {
if (cmValue changeId = this->Makefile->GetDefinition("CTEST_CHANGE_ID")) {
this->CTest->SetCTestConfiguration("ChangeId", *changeId, this->Quiet);
}
+5 -5
View File
@@ -34,12 +34,12 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
#ifdef _WIN32
@@ -372,8 +372,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
int cmCTestScriptHandler::ExtractVariables()
{
// Temporary variables
cmProp minInterval;
cmProp contDuration;
cmValue minInterval;
cmValue contDuration;
this->SourceDir =
this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY");
@@ -412,7 +412,7 @@ int cmCTestScriptHandler::ExtractVariables()
int i;
for (i = 1; i < 10; ++i) {
sprintf(updateVar, "CTEST_EXTRA_UPDATES_%i", i);
cmProp updateVal = this->Makefile->GetDefinition(updateVar);
cmValue updateVal = this->Makefile->GetDefinition(updateVar);
if (updateVal) {
if (this->UpdateCmd.empty()) {
cmSystemTools::Error(
@@ -930,7 +930,7 @@ cmDuration cmCTestScriptHandler::GetRemainingTimeAllowed()
return cmCTest::MaxDuration();
}
cmProp timelimitS = this->Makefile->GetDefinition("CTEST_TIME_LIMIT");
cmValue timelimitS = this->Makefile->GetDefinition("CTEST_TIME_LIMIT");
if (!timelimitS) {
return cmCTest::MaxDuration();
+6 -6
View File
@@ -9,8 +9,8 @@
#include "cmCTestVC.h"
#include "cmGeneratedFileStream.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
class cmExecutionStatus;
@@ -30,8 +30,8 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
size_t cnt = 0;
const char* smodel = nullptr;
cmProp src_dir;
cmProp bld_dir;
cmValue src_dir;
cmValue bld_dir;
while (cnt < args.size()) {
if (args[cnt] == "GROUP" || args[cnt] == "TRACK") {
@@ -55,10 +55,10 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
smodel = args[cnt].c_str();
cnt++;
} else if (!src_dir) {
src_dir = cmProp(args[cnt]);
src_dir = cmValue(args[cnt]);
cnt++;
} else if (!bld_dir) {
bld_dir = cmProp(args[cnt]);
bld_dir = cmValue(args[cnt]);
cnt++;
} else {
this->SetError("Too many arguments");
@@ -162,7 +162,7 @@ bool cmCTestStartCommand::InitialCheckout(std::ostream& ofs,
std::string const& sourceDir)
{
// Use the user-provided command to create the source tree.
cmProp initialCheckoutCommand =
cmValue initialCheckoutCommand =
this->Makefile->GetDefinition("CTEST_CHECKOUT_COMMAND");
if (!initialCheckoutCommand) {
initialCheckoutCommand =
+5 -5
View File
@@ -16,10 +16,10 @@
#include "cmCommand.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
class cmExecutionStatus;
@@ -36,8 +36,8 @@ std::unique_ptr<cmCommand> cmCTestSubmitCommand::Clone()
cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
{
cmProp submitURL = !this->SubmitURL.empty()
? cmProp(this->SubmitURL)
cmValue submitURL = !this->SubmitURL.empty()
? cmValue(this->SubmitURL)
: this->Makefile->GetDefinition("CTEST_SUBMIT_URL");
if (submitURL) {
@@ -59,14 +59,14 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet);
cmProp notesFilesVariable =
cmValue notesFilesVariable =
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
if (notesFilesVariable) {
std::vector<std::string> notesFiles = cmExpandedList(*notesFilesVariable);
this->CTest->GenerateNotesFile(notesFiles);
}
cmProp extraFilesVariable =
cmValue extraFilesVariable =
this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES");
if (extraFilesVariable) {
std::vector<std::string> extraFiles = cmExpandedList(*extraFilesVariable);
+5 -5
View File
@@ -21,10 +21,10 @@
#include "cmCurl.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLParser.h"
#include "cmake.h"
@@ -261,7 +261,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
cmCTestScriptHandler* ch = this->CTest->GetScriptHandler();
cmake* cm = ch->GetCMake();
if (cm) {
cmProp subproject = cm->GetState()->GetGlobalProperty("SubProject");
cmValue subproject = cm->GetState()->GetGlobalProperty("SubProject");
if (subproject) {
upload_as += "&subproject=";
upload_as += ctest_curl.Escape(*subproject);
@@ -548,7 +548,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
// a "&subproject=subprojectname" to the first POST.
cmCTestScriptHandler* ch = this->CTest->GetScriptHandler();
cmake* cm = ch->GetCMake();
cmProp subproject = cm->GetState()->GetGlobalProperty("SubProject");
cmValue subproject = cm->GetState()->GetGlobalProperty("SubProject");
// TODO: Encode values for a URL instead of trusting caller.
std::ostringstream str;
if (subproject) {
@@ -708,8 +708,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
int cmCTestSubmitHandler::ProcessHandler()
{
cmProp cdashUploadFile = this->GetOption("CDashUploadFile");
cmProp cdashUploadType = this->GetOption("CDashUploadType");
cmValue cdashUploadFile = this->GetOption("CDashUploadFile");
cmValue cdashUploadType = this->GetOption("CDashUploadType");
if (cdashUploadFile && cdashUploadType) {
return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType);
}
+5 -5
View File
@@ -12,8 +12,8 @@
#include "cmCTestTestHandler.h"
#include "cmDuration.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmValue.h"
void cmCTestTestCommand::BindArguments()
{
@@ -40,7 +40,7 @@ void cmCTestTestCommand::BindArguments()
cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
{
cmProp ctestTimeout = this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
cmValue ctestTimeout = this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
cmDuration timeout;
if (ctestTimeout) {
@@ -54,7 +54,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
}
this->CTest->SetTimeOut(timeout);
cmProp resourceSpecFile =
cmValue resourceSpecFile =
this->Makefile->GetDefinition("CTEST_RESOURCE_SPEC_FILE");
if (this->ResourceSpecFile.empty() && resourceSpecFile) {
this->ResourceSpecFile = *resourceSpecFile;
@@ -114,7 +114,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
// or CTEST_TEST_LOAD script variable, or ctest --test-load
// command line argument... in that order.
unsigned long testLoad;
cmProp ctestTestLoad = this->Makefile->GetDefinition("CTEST_TEST_LOAD");
cmValue ctestTestLoad = this->Makefile->GetDefinition("CTEST_TEST_LOAD");
if (!this->TestLoad.empty()) {
if (!cmStrToULong(this->TestLoad, &testLoad)) {
testLoad = 0;
@@ -134,7 +134,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
}
handler->SetTestLoad(testLoad);
if (cmProp labelsForSubprojects =
if (cmValue labelsForSubprojects =
this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
*labelsForSubprojects, this->Quiet);
+5 -5
View File
@@ -38,12 +38,12 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cmValue.h"
#include "cmWorkingDirectory.h"
#include "cmXMLWriter.h"
#include "cmake.h"
@@ -521,7 +521,7 @@ bool cmCTestTestHandler::ProcessOptions()
if (cmIsOn(this->GetOption("ScheduleRandom"))) {
this->CTest->SetScheduleType("Random");
}
if (cmProp repeat = this->GetOption("Repeat")) {
if (cmValue repeat = this->GetOption("Repeat")) {
cmsys::RegularExpression repeatRegex(
"^(UNTIL_FAIL|UNTIL_PASS|AFTER_TIMEOUT):([0-9]+)$");
if (repeatRegex.find(repeat)) {
@@ -557,7 +557,7 @@ bool cmCTestTestHandler::ProcessOptions()
this->IncludeLabelRegularExpressions);
BuildLabelRE(this->GetMultiOption("ExcludeLabelRegularExpression"),
this->ExcludeLabelRegularExpressions);
cmProp val = this->GetOption("IncludeRegularExpression");
cmValue val = this->GetOption("IncludeRegularExpression");
if (val) {
this->UseIncludeRegExp();
this->SetIncludeRegExp(val);
@@ -1829,7 +1829,7 @@ bool cmCTestTestHandler::GetListOfTests()
// SEND_ERROR or FATAL_ERROR in CTestTestfile or TEST_INCLUDE_FILES
return false;
}
cmProp specFile = mf.GetDefinition("CTEST_RESOURCE_SPEC_FILE");
cmValue specFile = mf.GetDefinition("CTEST_RESOURCE_SPEC_FILE");
if (this->ResourceSpecFile.empty() && specFile) {
this->ResourceSpecFile = *specFile;
}
@@ -2091,7 +2091,7 @@ void cmCTestTestHandler::SetExcludeRegExp(const std::string& arg)
this->ExcludeRegExp = arg;
}
void cmCTestTestHandler::SetTestsToRunInformation(cmProp in)
void cmCTestTestHandler::SetTestsToRunInformation(cmValue in)
{
if (!in) {
return;
+2 -2
View File
@@ -22,7 +22,7 @@
#include "cmCTestResourceSpec.h"
#include "cmDuration.h"
#include "cmListFileCache.h"
#include "cmProperty.h"
#include "cmValue.h"
class cmMakefile;
class cmXMLWriter;
@@ -82,7 +82,7 @@ public:
}
//! pass the -I argument down
void SetTestsToRunInformation(cmProp);
void SetTestsToRunInformation(cmValue);
cmCTestTestHandler();
+2 -2
View File
@@ -17,9 +17,9 @@
#include "cmCTestSVN.h"
#include "cmCTestVC.h"
#include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmXMLWriter.h"
@@ -109,7 +109,7 @@ int cmCTestUpdateHandler::ProcessHandler()
static_cast<void>(fixLocale);
// Get source dir
cmProp sourceDirectory = this->GetOption("SourceDirectory");
cmValue sourceDirectory = this->GetOption("SourceDirectory");
if (!sourceDirectory) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find SourceDirectory key in the DartConfiguration.tcl"
+1 -1
View File
@@ -10,8 +10,8 @@
#include "cmsys/Process.h"
#include "cmCTest.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
cmCTestVC::cmCTestVC(cmCTest* ct, std::ostream& log)
@@ -15,11 +15,11 @@
#include "cmCursesPathWidget.h"
#include "cmCursesStringWidget.h"
#include "cmCursesWidget.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
const std::string& key, int labelwidth, int entrywidth)
@@ -49,7 +49,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, " ");
}
cmProp value = state->GetCacheEntryValue(key);
cmValue value = state->GetCacheEntryValue(key);
assert(value);
switch (state->GetCacheEntryType(key)) {
case cmStateEnums::BOOL: {
@@ -72,7 +72,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
break;
}
case cmStateEnums::STRING: {
cmProp stringsProp = state->GetCacheEntryProperty(key, "STRINGS");
cmValue stringsProp = state->GetCacheEntryProperty(key, "STRINGS");
if (stringsProp) {
auto ow =
cm::make_unique<cmCursesOptionsWidget>(this->EntryWidth, 1, 1, 1);
+10 -10
View File
@@ -17,11 +17,11 @@
#include "cmCursesStandardIncludes.h"
#include "cmCursesStringWidget.h"
#include "cmCursesWidget.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmake.h"
@@ -162,7 +162,7 @@ void cmCursesMainForm::RePost()
// If normal mode, count only non-advanced entries
this->NumberOfVisibleEntries = 0;
for (cmCursesCacheEntryComposite& entry : this->Entries) {
cmProp existingValue =
cmValue existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue());
bool advanced =
this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool(
@@ -183,7 +183,7 @@ void cmCursesMainForm::RePost()
// Assign fields
for (cmCursesCacheEntryComposite& entry : this->Entries) {
cmProp existingValue =
cmValue existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue());
bool advanced =
this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool(
@@ -242,7 +242,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
// If normal, display only non-advanced entries
this->NumberOfVisibleEntries = 0;
for (cmCursesCacheEntryComposite& entry : this->Entries) {
cmProp existingValue =
cmValue existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue());
bool advanced =
this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool(
@@ -260,7 +260,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
bool isNewPage;
int i = 0;
for (cmCursesCacheEntryComposite& entry : this->Entries) {
cmProp existingValue =
cmValue existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue());
bool advanced =
this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool(
@@ -406,9 +406,9 @@ void cmCursesMainForm::UpdateStatusBar(cm::optional<std::string> message)
// Get the help string of the current entry
// and add it to the help string
auto* cmakeState = this->CMakeInstance->GetState();
cmProp existingValue = cmakeState->GetCacheEntryValue(labelValue);
cmValue existingValue = cmakeState->GetCacheEntryValue(labelValue);
if (existingValue) {
cmProp help =
cmValue help =
cmakeState->GetCacheEntryProperty(labelValue, "HELPSTRING");
if (help) {
bar += *help;
@@ -618,7 +618,7 @@ void cmCursesMainForm::FillCacheManagerFromUI()
{
for (cmCursesCacheEntryComposite& entry : this->Entries) {
const std::string& cacheKey = entry.Key;
cmProp existingValue =
cmValue existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(cacheKey);
if (existingValue) {
std::string oldValue = *existingValue;
@@ -804,9 +804,9 @@ void cmCursesMainForm::HandleInput()
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2]));
const char* curField = lbl->GetValue();
cmProp helpString = nullptr;
cmValue helpString = nullptr;
cmProp existingValue =
cmValue existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(curField);
if (existingValue) {
helpString = this->CMakeInstance->GetState()->GetCacheEntryProperty(
+8 -8
View File
@@ -122,13 +122,13 @@ void QCMake::setBinaryDirectory(const QString& _dir)
QCMakePropertyList props = this->properties();
emit this->propertiesChanged(props);
cmProp homeDir = state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY");
cmValue homeDir = state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY");
if (homeDir) {
setSourceDirectory(QString::fromLocal8Bit(homeDir->c_str()));
}
cmProp gen = state->GetCacheEntryValue("CMAKE_GENERATOR");
cmValue gen = state->GetCacheEntryValue("CMAKE_GENERATOR");
if (gen) {
cmProp extraGen =
cmValue extraGen =
state->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR");
std::string curGen =
cmExternalMakefileProjectGenerator::CreateFullGeneratorName(*gen,
@@ -136,12 +136,12 @@ void QCMake::setBinaryDirectory(const QString& _dir)
this->setGenerator(QString::fromLocal8Bit(curGen.c_str()));
}
cmProp platform = state->GetCacheEntryValue("CMAKE_GENERATOR_PLATFORM");
cmValue platform = state->GetCacheEntryValue("CMAKE_GENERATOR_PLATFORM");
if (platform) {
this->setPlatform(QString::fromLocal8Bit(platform->c_str()));
}
cmProp toolset = state->GetCacheEntryValue("CMAKE_GENERATOR_TOOLSET");
cmValue toolset = state->GetCacheEntryValue("CMAKE_GENERATOR_TOOLSET");
if (toolset) {
this->setToolset(QString::fromLocal8Bit(toolset->c_str()));
}
@@ -396,11 +396,11 @@ QCMakePropertyList QCMake::properties() const
continue;
}
cmProp cachedValue = state->GetCacheEntryValue(key);
cmValue cachedValue = state->GetCacheEntryValue(key);
QCMakeProperty prop;
prop.Key = QString::fromLocal8Bit(key.c_str());
if (cmProp hs = state->GetCacheEntryProperty(key, "HELPSTRING")) {
if (cmValue hs = state->GetCacheEntryProperty(key, "HELPSTRING")) {
prop.Help = QString::fromLocal8Bit(hs->c_str());
}
prop.Value = QString::fromLocal8Bit(cachedValue->c_str());
@@ -414,7 +414,7 @@ QCMakePropertyList QCMake::properties() const
prop.Type = QCMakeProperty::FILEPATH;
} else if (t == cmStateEnums::STRING) {
prop.Type = QCMakeProperty::STRING;
cmProp stringsProperty = state->GetCacheEntryProperty(key, "STRINGS");
cmValue stringsProperty = state->GetCacheEntryProperty(key, "STRINGS");
if (stringsProperty) {
prop.Strings =
QString::fromLocal8Bit(stringsProperty->c_str()).split(";");
+1
View File
@@ -12,6 +12,7 @@
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmValue.h"
bool cmAddLibraryCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
+2 -2
View File
@@ -6,10 +6,10 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
namespace {
@@ -102,7 +102,7 @@ bool TwoArgsSignature(std::vector<std::string> const& args,
cmMakefile& mf = status.GetMakefile();
std::string const& define = args[0];
cmProp cacheValue = mf.GetDefinition(define);
cmValue cacheValue = mf.GetDefinition(define);
std::string configType;
if (!cmSystemTools::GetEnv("CMAKE_CONFIG_TYPE", configType) ||
+2 -2
View File
@@ -8,9 +8,9 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmValue.h"
bool cmBuildNameCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
@@ -20,7 +20,7 @@ bool cmBuildNameCommand(std::vector<std::string> const& args,
return false;
}
cmMakefile& mf = status.GetMakefile();
cmProp cacheValue = mf.GetDefinition(args[0]);
cmValue cacheValue = mf.GetDefinition(args[0]);
if (cacheValue) {
// do we need to correct the value?
cmsys::RegularExpression reg("[()/]");
+2 -2
View File
@@ -18,11 +18,11 @@
#include "cmCMakePath.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmSubcommandTable.h"
#include "cmSystemTools.h"
#include "cmValue.h"
namespace {
// Helper classes for argument parsing
@@ -150,7 +150,7 @@ public:
bool getInputPath(const std::string& arg, cmExecutionStatus& status,
std::string& path)
{
cmProp def = status.GetMakefile().GetDefinition(arg);
cmValue def = status.GetMakefile().GetDefinition(arg);
if (!def) {
status.SetError("undefined variable for input path.");
return false;
+1 -1
View File
@@ -6,10 +6,10 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmValue.h"
namespace {
bool HandleSetMode(std::vector<std::string> const& args,
+7 -7
View File
@@ -56,12 +56,12 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmVersionConfig.h"
#include "cmXMLWriter.h"
@@ -1457,11 +1457,11 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml)
return;
}
// This code should go when cdash is changed to use labels only
cmProp subproject = cm->GetState()->GetGlobalProperty("SubProject");
cmValue subproject = cm->GetState()->GetGlobalProperty("SubProject");
if (subproject) {
xml.StartElement("Subproject");
xml.Attribute("name", *subproject);
cmProp labels =
cmValue labels =
ch->GetCMake()->GetState()->GetGlobalProperty("SubProjectLabels");
if (labels) {
xml.StartElement("Labels");
@@ -1475,7 +1475,7 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml)
}
// This code should stay when cdash only does label based sub-projects
cmProp label = cm->GetState()->GetGlobalProperty("Label");
cmValue label = cm->GetState()->GetGlobalProperty("Label");
if (label) {
xml.StartElement("Labels");
xml.Element("Label", *label);
@@ -3056,7 +3056,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const std::string& dir,
void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
std::vector<std::string>& vec)
{
cmProp dval = mf->GetDefinition(def);
cmValue dval = mf->GetDefinition(def);
if (!dval) {
return;
}
@@ -3073,7 +3073,7 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
void cmCTest::PopulateCustomInteger(cmMakefile* mf, const std::string& def,
int& val)
{
cmProp dval = mf->GetDefinition(def);
cmValue dval = mf->GetDefinition(def);
if (!dval) {
return;
}
@@ -3407,7 +3407,7 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(
cmMakefile* mf, const char* dconfig, const std::string& cmake_var,
bool suppress)
{
cmProp ctvar = mf->GetDefinition(cmake_var);
cmValue ctvar = mf->GetDefinition(cmake_var);
if (!ctvar) {
return false;
}
+14 -14
View File
@@ -118,13 +118,13 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
}
this->CacheMajorVersion = 0;
this->CacheMinorVersion = 0;
if (cmProp cmajor =
if (cmValue cmajor =
this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION")) {
unsigned int v = 0;
if (sscanf(cmajor->c_str(), "%u", &v) == 1) {
this->CacheMajorVersion = v;
}
if (cmProp cminor =
if (cmValue cminor =
this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION")) {
if (sscanf(cminor->c_str(), "%u", &v) == 1) {
this->CacheMinorVersion = v;
@@ -144,7 +144,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
}
// check to make sure the cache directory has not
// been moved
cmProp oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
cmValue oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
if (internal && oldDir) {
std::string currentcwd = path;
std::string oldcwd = *oldDir;
@@ -152,7 +152,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
currentcwd += "/CMakeCache.txt";
oldcwd += "/CMakeCache.txt";
if (!cmSystemTools::SameFile(oldcwd, currentcwd)) {
cmProp dir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
cmValue dir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
std::ostringstream message;
message << "The current CMakeCache.txt directory " << currentcwd
<< " is different than the directory " << (dir ? *dir : "")
@@ -203,7 +203,7 @@ void cmCacheManager::WritePropertyEntries(std::ostream& os,
cmMessenger* messenger) const
{
for (const char* p : cmCacheManager::PersistentProperties) {
if (cmProp value = e.GetProperty(p)) {
if (cmValue value = e.GetProperty(p)) {
std::string helpstring =
cmStrCat(p, " property for variable: ", entryKey);
cmCacheManager::OutputHelpString(os, helpstring);
@@ -296,7 +296,7 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
*/
} else if (t != cmStateEnums::INTERNAL) {
// Format is key:type=value
if (cmProp help = ce.GetProperty("HELPSTRING")) {
if (cmValue help = ce.GetProperty("HELPSTRING")) {
cmCacheManager::OutputHelpString(fout, *help);
} else {
cmCacheManager::OutputHelpString(fout, "Missing description");
@@ -326,7 +326,7 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
this->WritePropertyEntries(fout, i.first, i.second, messenger);
if (t == cmStateEnums::INTERNAL) {
// Format is key:type=value
if (cmProp help = i.second.GetProperty("HELPSTRING")) {
if (cmValue help = i.second.GetProperty("HELPSTRING")) {
cmCacheManager::OutputHelpString(fout, *help);
}
cmCacheManager::OutputKey(fout, i.first);
@@ -496,11 +496,11 @@ const cmCacheManager::CacheEntry* cmCacheManager::GetCacheEntry(
return nullptr;
}
cmProp cmCacheManager::GetInitializedCacheValue(const std::string& key) const
cmValue cmCacheManager::GetInitializedCacheValue(const std::string& key) const
{
if (const auto* entry = this->GetCacheEntry(key)) {
if (entry->Initialized) {
return cmProp(entry->GetValue());
return cmValue(entry->GetValue());
}
}
return nullptr;
@@ -521,7 +521,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
"=================================================\n";
}
void cmCacheManager::AddCacheEntry(const std::string& key, cmProp value,
void cmCacheManager::AddCacheEntry(const std::string& key, cmValue value,
const char* helpString,
cmStateEnums::CacheEntryType type)
{
@@ -550,7 +550,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, cmProp value,
: "(This variable does not exist and should not be used)");
}
void cmCacheManager::CacheEntry::SetValue(cmProp value)
void cmCacheManager::CacheEntry::SetValue(cmValue value)
{
if (value) {
this->Value = *value;
@@ -565,13 +565,13 @@ std::vector<std::string> cmCacheManager::CacheEntry::GetPropertyList() const
return this->Properties.GetKeys();
}
cmProp cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
cmValue cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
{
if (prop == "TYPE") {
return cmProp(cmState::CacheEntryTypeToString(this->Type));
return cmValue(cmState::CacheEntryTypeToString(this->Type));
}
if (prop == "VALUE") {
return cmProp(this->Value);
return cmValue(this->Value);
}
return this->Properties.GetPropertyValue(prop);
}
+12 -12
View File
@@ -11,9 +11,9 @@
#include <utility>
#include <vector>
#include "cmProperty.h"
#include "cmPropertyMap.h"
#include "cmStateTypes.h"
#include "cmValue.h"
class cmMessenger;
@@ -31,13 +31,13 @@ class cmCacheManager
public:
const std::string& GetValue() const { return this->Value; }
void SetValue(cmProp);
void SetValue(cmValue);
cmStateEnums::CacheEntryType GetType() const { return this->Type; }
void SetType(cmStateEnums::CacheEntryType ty) { this->Type = ty; }
std::vector<std::string> GetPropertyList() const;
cmProp GetProperty(const std::string& property) const;
cmValue GetProperty(const std::string& property) const;
bool GetPropertyAsBool(const std::string& property) const;
void SetProperty(const std::string& property, const char* value);
void SetProperty(const std::string& property, bool value);
@@ -70,12 +70,12 @@ public:
bool IsCacheLoaded() const { return this->CacheLoaded; }
//! Get a value from the cache given a key
cmProp GetInitializedCacheValue(const std::string& key) const;
cmValue GetInitializedCacheValue(const std::string& key) const;
cmProp GetCacheEntryValue(const std::string& key) const
cmValue GetCacheEntryValue(const std::string& key) const
{
if (const auto* entry = this->GetCacheEntry(key)) {
return cmProp(entry->GetValue());
return cmValue(entry->GetValue());
}
return nullptr;
}
@@ -83,7 +83,7 @@ public:
void SetCacheEntryValue(std::string const& key, std::string const& value)
{
if (auto* entry = this->GetCacheEntry(key)) {
entry->SetValue(cmProp(value));
entry->SetValue(cmValue(value));
}
}
@@ -104,8 +104,8 @@ public:
return {};
}
cmProp GetCacheEntryProperty(std::string const& key,
std::string const& propName) const
cmValue GetCacheEntryProperty(std::string const& key,
std::string const& propName) const
{
if (const auto* entry = this->GetCacheEntry(key)) {
return entry->GetProperty(propName);
@@ -176,15 +176,15 @@ public:
const char* helpString, cmStateEnums::CacheEntryType type)
{
this->AddCacheEntry(key,
value ? cmProp(std::string(value)) : cmProp(nullptr),
value ? cmValue(std::string(value)) : cmValue(nullptr),
helpString, type);
}
void AddCacheEntry(const std::string& key, const std::string& value,
const char* helpString, cmStateEnums::CacheEntryType type)
{
this->AddCacheEntry(key, cmProp(value), helpString, type);
this->AddCacheEntry(key, cmValue(value), helpString, type);
}
void AddCacheEntry(const std::string& key, cmProp value,
void AddCacheEntry(const std::string& key, cmValue value,
const char* helpString,
cmStateEnums::CacheEntryType type);
+4 -3
View File
@@ -14,10 +14,10 @@
#include "cmCommandArgumentLexer.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
int cmCommandArgument_yyparse(yyscan_t yyscanner);
//
@@ -73,7 +73,8 @@ const char* cmCommandArgumentParserHelper::ExpandSpecialVariable(
return "";
}
if (strcmp(key, "CACHE") == 0) {
if (cmProp c = this->Makefile->GetState()->GetInitializedCacheValue(var)) {
if (cmValue c =
this->Makefile->GetState()->GetInitializedCacheValue(var)) {
if (this->EscapeQuotes) {
return this->AddString(cmEscapeQuotes(*c));
}
@@ -103,7 +104,7 @@ const char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
}
return this->AddString(line);
}
cmProp value = this->Makefile->GetDefinition(var);
cmValue value = this->Makefile->GetDefinition(var);
if (!value) {
this->Makefile->MaybeWarnUninitialized(var, this->FileName);
if (!this->RemoveEmpty) {
+7 -7
View File
@@ -14,12 +14,12 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmOutputConverter.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmValue.h"
cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
: GeneratorTarget(gt)
@@ -39,8 +39,8 @@ std::vector<std::string> const& cmCommonTargetGenerator::GetConfigNames() const
return this->ConfigNames;
}
cmProp cmCommonTargetGenerator::GetFeature(const std::string& feature,
const std::string& config)
cmValue cmCommonTargetGenerator::GetFeature(const std::string& feature,
const std::string& config)
{
return this->GeneratorTarget->GetFeature(feature, config);
}
@@ -56,7 +56,7 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(
}
// TODO: Create a per-language flag variable.
cmProp defFileFlag =
cmValue defFileFlag =
this->Makefile->GetDefinition("CMAKE_LINK_DEF_FILE_FLAG");
if (!defFileFlag) {
return;
@@ -259,7 +259,7 @@ std::string cmCommonTargetGenerator::GetAIXExports(std::string const&)
{
std::string aixExports;
if (this->GeneratorTarget->Target->IsAIX()) {
if (cmProp exportAll =
if (cmValue exportAll =
this->GeneratorTarget->GetProperty("AIX_EXPORT_ALL_SYMBOLS")) {
if (cmIsOff(*exportAll)) {
aixExports = "-n";
@@ -275,7 +275,7 @@ void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
{
// Lookup the flag to specify the version.
std::string fvar = cmStrCat("CMAKE_", lang, "_OSX_", name, "_VERSION_FLAG");
cmProp flag = this->Makefile->GetDefinition(fvar);
cmValue flag = this->Makefile->GetDefinition(fvar);
// Skip if no such flag.
if (!flag) {
@@ -302,7 +302,7 @@ std::string cmCommonTargetGenerator::GetLinkerLauncher(
const std::string& config)
{
std::string lang = this->GeneratorTarget->GetLinkerLanguage(config);
cmProp launcherProp =
cmValue launcherProp =
this->GeneratorTarget->GetProperty(lang + "_LINKER_LAUNCHER");
if (cmNonempty(launcherProp)) {
// Convert ;-delimited list to single string
+2 -2
View File
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
#include "cmProperty.h"
#include "cmValue.h"
class cmGeneratorTarget;
class cmGlobalCommonGenerator;
@@ -30,7 +30,7 @@ public:
protected:
// Feature query methods.
cmProp GetFeature(const std::string& feature, const std::string& config);
cmValue GetFeature(const std::string& feature, const std::string& config);
// Helper to add flag for windows .def file.
void AddModuleDefinitionFlag(cmLinkLineComputer* linkLineComputer,
+3 -3
View File
@@ -18,11 +18,11 @@
#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmValue.h"
#include "cmake.h"
/*
@@ -322,7 +322,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
} else {
// Look for an old-style <item>_LIB_DEPENDS variable.
std::string var = cmStrCat(entry.Item.Value, "_LIB_DEPENDS");
if (cmProp val = this->Makefile->GetDefinition(var)) {
if (cmValue val = this->Makefile->GetDefinition(var)) {
// The item dependencies are known. Follow them.
BFSEntry qe = { index, val->c_str() };
this->BFSQueue.push(qe);
@@ -489,7 +489,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
// lower.
if (!haveLLT) {
std::string var = cmStrCat(d, "_LINK_TYPE");
if (cmProp val = this->Makefile->GetDefinition(var)) {
if (cmValue val = this->Makefile->GetDefinition(var)) {
if (*val == "debug") {
llt = DEBUG_LibraryType;
} else if (*val == "optimized") {
+19 -18
View File
@@ -20,12 +20,12 @@
#include "cmOrderDirectories.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
#include "cmake.h"
//#define CM_COMPUTE_LINK_INFO_DEBUG
@@ -286,28 +286,28 @@ cmComputeLinkInformation::cmComputeLinkInformation(
}
// Get options needed to link libraries.
if (cmProp flag = this->Makefile->GetDefinition(
if (cmValue flag = this->Makefile->GetDefinition(
"CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_FLAG")) {
this->LibLinkFlag = *flag;
} else {
this->LibLinkFlag =
this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FLAG");
}
if (cmProp flag = this->Makefile->GetDefinition(
if (cmValue flag = this->Makefile->GetDefinition(
"CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_FILE_FLAG")) {
this->LibLinkFileFlag = *flag;
} else {
this->LibLinkFileFlag =
this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FILE_FLAG");
}
if (cmProp suffix = this->Makefile->GetDefinition(
if (cmValue suffix = this->Makefile->GetDefinition(
"CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_SUFFIX")) {
this->LibLinkSuffix = *suffix;
} else {
this->LibLinkSuffix =
this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX");
}
if (cmProp flag = this->Makefile->GetDefinition(
if (cmValue flag = this->Makefile->GetDefinition(
"CMAKE_" + this->LinkLanguage + "_LINK_OBJECT_FILE_FLAG")) {
this->ObjLinkFileFlag = *flag;
} else {
@@ -526,7 +526,7 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
cmProp lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
cmValue lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
if (cmIsOn(lss)) {
this->SetCurrentLinkType(LinkStatic);
} else {
@@ -605,7 +605,7 @@ void cmComputeLinkInformation::AddRuntimeLinkLibrary(std::string const& lang)
if (runtimeLibrary.empty()) {
return;
}
if (cmProp runtimeLinkOptions = this->Makefile->GetDefinition(
if (cmValue runtimeLinkOptions = this->Makefile->GetDefinition(
"CMAKE_" + lang + "_RUNTIME_LIBRARY_LINK_OPTIONS_" + runtimeLibrary)) {
std::vector<std::string> libsVec = cmExpandedList(*runtimeLinkOptions);
for (std::string const& i : libsVec) {
@@ -621,7 +621,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
// Add libraries for this language that are not implied by the
// linker language.
std::string libVar = cmStrCat("CMAKE_", lang, "_IMPLICIT_LINK_LIBRARIES");
if (cmProp libs = this->Makefile->GetDefinition(libVar)) {
if (cmValue libs = this->Makefile->GetDefinition(libVar)) {
std::vector<std::string> libsVec = cmExpandedList(*libs);
for (std::string const& i : libsVec) {
if (!cm::contains(this->ImplicitLinkLibs, i)) {
@@ -633,7 +633,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
// Add linker search paths for this language that are not
// implied by the linker language.
std::string dirVar = cmStrCat("CMAKE_", lang, "_IMPLICIT_LINK_DIRECTORIES");
if (cmProp dirs = this->Makefile->GetDefinition(dirVar)) {
if (cmValue dirs = this->Makefile->GetDefinition(dirVar)) {
std::vector<std::string> dirsVec = cmExpandedList(*dirs);
this->OrderLinkerSearchPath->AddLanguageDirectories(dirsVec);
}
@@ -836,8 +836,8 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
this->LinkTypeEnabled = false;
// Lookup link type selection flags.
cmProp static_link_type_flag = nullptr;
cmProp shared_link_type_flag = nullptr;
cmValue static_link_type_flag = nullptr;
cmValue shared_link_type_flag = nullptr;
const char* target_type_str = nullptr;
switch (this->Target->GetType()) {
case cmStateEnums::EXECUTABLE:
@@ -875,7 +875,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
}
// Lookup the starting link type from the target (linked statically?).
cmProp lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
cmValue lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
this->StartLinkType = cmIsOn(lss) ? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}
@@ -897,13 +897,14 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
LinkShared);
this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX"),
LinkUnknown);
if (cmProp linkSuffixes = mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) {
if (cmValue linkSuffixes =
mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) {
std::vector<std::string> linkSuffixVec = cmExpandedList(*linkSuffixes);
for (std::string const& i : linkSuffixVec) {
this->AddLinkExtension(i, LinkUnknown);
}
}
if (cmProp sharedSuffixes =
if (cmValue sharedSuffixes =
mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) {
std::vector<std::string> sharedSuffixVec = cmExpandedList(*sharedSuffixes);
for (std::string const& i : sharedSuffixVec) {
@@ -1589,7 +1590,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
// Append library architecture to all implicit platform directories
// and add them to the set
if (cmProp libraryArch =
if (cmValue libraryArch =
this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE")) {
for (std::string const& i : implicitDirVec) {
this->ImplicitLinkDirs.insert(i + "/" + *libraryArch);
@@ -1782,13 +1783,13 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
}
if (use_build_rpath || use_link_rpath) {
std::string rootPath;
if (cmProp sysrootLink =
if (cmValue sysrootLink =
this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK")) {
rootPath = *sysrootLink;
} else {
rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
}
cmProp stagePath = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
cmValue stagePath = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
std::string const& installPrefix =
this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
cmSystemTools::ConvertToUnixSlashes(rootPath);
@@ -1856,7 +1857,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
"CMAKE_" + li + "_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH";
if (this->Makefile->IsOn(useVar)) {
std::string dirVar = "CMAKE_" + li + "_IMPLICIT_LINK_DIRECTORIES";
if (cmProp dirs = this->Makefile->GetDefinition(dirVar)) {
if (cmValue dirs = this->Makefile->GetDefinition(dirVar)) {
cmCLI_ExpandListUnique(*dirs, runtimeDirs, emitted);
}
}
+2 -2
View File
@@ -14,7 +14,7 @@
#include "cmsys/RegularExpression.hxx"
#include "cmListFileCache.h"
#include "cmProperty.h"
#include "cmValue.h"
class cmGeneratorTarget;
class cmGlobalGenerator;
@@ -138,7 +138,7 @@ private:
SharedDepModeLink // List file on link line
};
cmProp LoaderFlag;
cmValue LoaderFlag;
std::string LibLinkFlag;
std::string LibLinkFileFlag;
std::string ObjLinkFileFlag;
+2 -3
View File
@@ -17,16 +17,15 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocationKind.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetDepend.h"
#include "cmValue.h"
#include "cmake.h"
/*
@@ -469,7 +468,7 @@ void cmComputeTargetDepends::ComputeIntermediateGraph()
gt->GetType() != cmStateEnums::OBJECT_LIBRARY) {
intermediateEdges = initialEdges;
} else {
if (cmProp optimizeDependencies =
if (cmValue optimizeDependencies =
gt->GetProperty("OPTIMIZE_DEPENDENCIES")) {
if (cmIsOn(optimizeDependencies)) {
this->OptimizeLinkDependencies(gt, intermediateEdges, initialEdges);
+19 -19
View File
@@ -19,10 +19,10 @@
#include "cmExpandedCommandArgument.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
namespace {
@@ -285,7 +285,7 @@ bool cmConditionEvaluator::IsTrue(
}
//=========================================================================
cmProp cmConditionEvaluator::GetDefinitionIfUnquoted(
cmValue cmConditionEvaluator::GetDefinitionIfUnquoted(
cmExpandedCommandArgument const& argument) const
{
if ((this->Policy54Status != cmPolicies::WARN &&
@@ -294,7 +294,7 @@ cmProp cmConditionEvaluator::GetDefinitionIfUnquoted(
return nullptr;
}
cmProp def = this->Makefile.GetDefinition(argument.GetValue());
cmValue def = this->Makefile.GetDefinition(argument.GetValue());
if (def && argument.WasQuoted() &&
this->Policy54Status == cmPolicies::WARN) {
@@ -317,13 +317,13 @@ cmProp cmConditionEvaluator::GetDefinitionIfUnquoted(
}
//=========================================================================
cmProp cmConditionEvaluator::GetVariableOrString(
cmValue cmConditionEvaluator::GetVariableOrString(
const cmExpandedCommandArgument& argument) const
{
cmProp def = this->GetDefinitionIfUnquoted(argument);
cmValue def = this->GetDefinitionIfUnquoted(argument);
if (!def) {
def = cmProp(argument.GetValue());
def = cmValue(argument.GetValue());
}
return def;
@@ -386,7 +386,7 @@ bool cmConditionEvaluator::GetBooleanValue(
}
// Check definition.
cmProp def = this->GetDefinitionIfUnquoted(arg);
cmValue def = this->GetDefinitionIfUnquoted(arg);
return !cmIsOff(def);
}
@@ -403,13 +403,13 @@ bool cmConditionEvaluator::GetBooleanValueOld(
if (arg == "1") {
return true;
}
cmProp def = this->GetDefinitionIfUnquoted(arg);
cmValue def = this->GetDefinitionIfUnquoted(arg);
return !cmIsOff(def);
}
// Old GetVariableOrNumber behavior.
cmProp def = this->GetDefinitionIfUnquoted(arg);
cmValue def = this->GetDefinitionIfUnquoted(arg);
if (!def && std::atoi(arg.GetValue().c_str())) {
def = cmProp(arg.GetValue());
def = cmValue(arg.GetValue());
}
return !cmIsOff(def);
}
@@ -651,17 +651,17 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
}
else if (this->IsKeyword(keyMATCHES, *args.next)) {
cmProp def = this->GetDefinitionIfUnquoted(*args.current);
cmValue def = this->GetDefinitionIfUnquoted(*args.current);
std::string def_buf;
if (!def) {
def = cmProp(args.current->GetValue());
def = cmValue(args.current->GetValue());
} else if (cmHasLiteralPrefix(args.current->GetValue(),
"CMAKE_MATCH_")) {
// The string to match is owned by our match result variables.
// Move it to our own buffer before clearing them.
def_buf = *def;
def = cmProp(def_buf);
def = cmValue(def_buf);
}
this->Makefile.ClearMatches();
@@ -687,8 +687,8 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
this->matchKeys(*args.next, keyLESS, keyLESS_EQUAL, keyGREATER,
keyGREATER_EQUAL, keyEQUAL))) {
cmProp ldef = this->GetVariableOrString(*args.current);
cmProp rdef = this->GetVariableOrString(*args.nextnext);
cmValue ldef = this->GetVariableOrString(*args.current);
cmValue rdef = this->GetVariableOrString(*args.nextnext);
double lhs;
double rhs;
@@ -711,8 +711,8 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
keySTRLESS_EQUAL, keySTRGREATER,
keySTRGREATER_EQUAL, keySTREQUAL))) {
const cmProp lhs = this->GetVariableOrString(*args.current);
const cmProp rhs = this->GetVariableOrString(*args.nextnext);
const cmValue lhs = this->GetVariableOrString(*args.current);
const cmValue rhs = this->GetVariableOrString(*args.nextnext);
const auto val = (*lhs).compare(*rhs);
// clang-format off
const auto result = cmRt2CtSelector<
@@ -749,8 +749,8 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
if (this->Policy57Status != cmPolicies::OLD &&
this->Policy57Status != cmPolicies::WARN) {
cmProp lhs = this->GetVariableOrString(*args.current);
cmProp rhs = this->Makefile.GetDefinition(args.nextnext->GetValue());
cmValue lhs = this->GetVariableOrString(*args.current);
cmValue rhs = this->Makefile.GetDefinition(args.nextnext->GetValue());
newArgs.ReduceTwoArgs(
rhs && cm::contains(cmExpandedList(*rhs, true), *lhs), args);
+3 -3
View File
@@ -12,7 +12,7 @@
#include "cmListFileCache.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmValue.h"
class cmExpandedCommandArgument;
class cmMakefile;
@@ -32,10 +32,10 @@ private:
class cmArgumentList;
// Filter the given variable definition based on policy CMP0054.
cmProp GetDefinitionIfUnquoted(
cmValue GetDefinitionIfUnquoted(
const cmExpandedCommandArgument& argument) const;
cmProp GetVariableOrString(const cmExpandedCommandArgument& argument) const;
cmValue GetVariableOrString(const cmExpandedCommandArgument& argument) const;
bool IsKeyword(cm::static_string_view keyword,
const cmExpandedCommandArgument& argument) const;
+15 -15
View File
@@ -19,11 +19,11 @@
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmake.h"
@@ -246,7 +246,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
this->SrcFileSignature = true;
cmStateEnums::TargetType targetType = cmStateEnums::EXECUTABLE;
cmProp tt = this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_TARGET_TYPE");
cmValue tt = this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_TARGET_TYPE");
if (!isTryRun && cmNonempty(tt)) {
if (*tt == cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE)) {
targetType = cmStateEnums::EXECUTABLE;
@@ -540,7 +540,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
return -1;
}
cmProp def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
cmValue def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
fprintf(fout, "cmake_minimum_required(VERSION %u.%u.%u.%u)\n",
cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion(),
cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion());
@@ -549,7 +549,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
/* Set MSVC runtime library policy to match our selection. */
if (cmProp msvcRuntimeLibraryDefault =
if (cmValue msvcRuntimeLibraryDefault =
this->Makefile->GetDefinition(kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT)) {
fprintf(fout, "cmake_policy(SET CMP0091 %s)\n",
!msvcRuntimeLibraryDefault->empty() ? "NEW" : "OLD");
@@ -564,7 +564,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
/* Set ARMClang cpu/arch policy to match outer project. */
if (cmProp cmp0123 =
if (cmValue cmp0123 =
this->Makefile->GetDefinition(kCMAKE_ARMClang_CMP0123)) {
fprintf(fout, "cmake_policy(SET CMP0123 %s)\n",
*cmp0123 == "NEW"_s ? "NEW" : "OLD");
@@ -582,11 +582,11 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
projectLangs += " " + li;
std::string rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE";
std::string rulesOverrideLang = cmStrCat(rulesOverrideBase, "_", li);
if (cmProp rulesOverridePath =
if (cmValue rulesOverridePath =
this->Makefile->GetDefinition(rulesOverrideLang)) {
fprintf(fout, "set(%s \"%s\")\n", rulesOverrideLang.c_str(),
rulesOverridePath->c_str());
} else if (cmProp rulesOverridePath2 =
} else if (cmValue rulesOverridePath2 =
this->Makefile->GetDefinition(rulesOverrideBase)) {
fprintf(fout, "set(%s \"%s\")\n", rulesOverrideBase.c_str(),
rulesOverridePath2->c_str());
@@ -604,7 +604,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
fprintf(fout, "set(CMAKE_VERBOSE_MAKEFILE 1)\n");
for (std::string const& li : testLangs) {
std::string langFlags = "CMAKE_" + li + "_FLAGS";
cmProp flags = this->Makefile->GetDefinition(langFlags);
cmValue flags = this->Makefile->GetDefinition(langFlags);
fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li.c_str(),
cmOutputConverter::EscapeForCMake(*flags).c_str());
fprintf(fout,
@@ -643,7 +643,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
for (std::string const& li : testLangs) {
std::string const langFlagsCfg =
cmStrCat("CMAKE_", li, "_FLAGS_", cfg);
cmProp flagsCfg = this->Makefile->GetDefinition(langFlagsCfg);
cmValue flagsCfg = this->Makefile->GetDefinition(langFlagsCfg);
fprintf(fout, "set(%s %s)\n", langFlagsCfg.c_str(),
cmOutputConverter::EscapeForCMake(*flagsCfg).c_str());
}
@@ -675,7 +675,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
case cmPolicies::NEW:
// NEW behavior is to pass linker flags.
{
cmProp exeLinkFlags =
cmValue exeLinkFlags =
this->Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS %s)\n",
cmOutputConverter::EscapeForCMake(*exeLinkFlags).c_str());
@@ -760,7 +760,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
vars.insert(kCMAKE_WARN_DEPRECATED);
vars.emplace("CMAKE_MSVC_RUNTIME_LIBRARY"_s);
if (cmProp varListStr = this->Makefile->GetDefinition(
if (cmValue varListStr = this->Makefile->GetDefinition(
kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES)) {
std::vector<std::string> varList = cmExpandedList(*varListStr);
vars.insert(varList.begin(), varList.end());
@@ -799,7 +799,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
cmLocalGenerator doesn't allow building for "the other"
architecture only via CMAKE_OSX_ARCHITECTURES.
*/
if (cmProp tcArchs = this->Makefile->GetDefinition(
if (cmValue tcArchs = this->Makefile->GetDefinition(
kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES)) {
vars.erase(kCMAKE_OSX_ARCHITECTURES);
std::string flag = "-DCMAKE_OSX_ARCHITECTURES=" + *tcArchs;
@@ -807,7 +807,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
for (std::string const& var : vars) {
if (cmProp val = this->Makefile->GetDefinition(var)) {
if (cmValue val = this->Makefile->GetDefinition(var)) {
std::string flag = "-D" + var + "=" + *val;
cmakeFlags.push_back(std::move(flag));
}
@@ -952,7 +952,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
if (this->Makefile->GetState()->UseGhsMultiIDE()) {
// Forward the GHS variables to the inner project cache.
for (std::string const& var : ghs_platform_vars) {
if (cmProp val = this->Makefile->GetDefinition(var)) {
if (cmValue val = this->Makefile->GetDefinition(var)) {
std::string flag = "-D" + var + "=" + "'" + *val + "'";
cmakeFlags.push_back(std::move(flag));
}
@@ -1094,7 +1094,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
std::vector<std::string> searchDirs;
searchDirs.emplace_back();
cmProp config =
cmValue config =
this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
// if a config was specified try that first
if (cmNonempty(config)) {
+2 -2
View File
@@ -19,11 +19,11 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTransformDepfile.h"
#include "cmValue.h"
namespace {
std::string EvaluateSplitConfigGenex(
@@ -284,7 +284,7 @@ void cmCustomCommandGenerator::FillEmulatorsWithArguments()
if (target && target->GetType() == cmStateEnums::EXECUTABLE &&
!target->IsImported()) {
cmProp emulator_property =
cmValue emulator_property =
target->GetProperty("CROSSCOMPILING_EMULATOR");
if (!emulator_property) {
continue;
+3 -3
View File
@@ -34,11 +34,11 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const std::string& key,
return begin->Map.emplace(key, def).first->second;
}
cmProp cmDefinitions::Get(const std::string& key, StackIter begin,
StackIter end)
cmValue cmDefinitions::Get(const std::string& key, StackIter begin,
StackIter end)
{
Def const& def = cmDefinitions::GetInternal(key, begin, end, false);
return def.Value ? cmProp(def.Value.str_if_stable()) : nullptr;
return def.Value ? cmValue(def.Value.str_if_stable()) : nullptr;
}
void cmDefinitions::Raise(const std::string& key, StackIter begin,
+2 -2
View File
@@ -12,8 +12,8 @@
#include <cm/string_view>
#include "cmLinkedTree.h"
#include "cmProperty.h"
#include "cmString.hxx"
#include "cmValue.h"
/** \class cmDefinitions
* \brief Store a scope of variable definitions for CMake language.
@@ -29,7 +29,7 @@ class cmDefinitions
public:
// -- Static member functions
static cmProp Get(const std::string& key, StackIter begin, StackIter end);
static cmValue Get(const std::string& key, StackIter begin, StackIter end);
static void Raise(const std::string& key, StackIter begin, StackIter end);
+2 -2
View File
@@ -11,9 +11,9 @@
#include "cmGeneratedFileStream.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmDepends::cmDepends(cmLocalUnixMakefileGenerator3* lg, std::string targetDir)
: LocalGenerator(lg)
@@ -232,7 +232,7 @@ void cmDepends::SetIncludePathFromLanguage(const std::string& lang)
std::string includePathVar =
cmStrCat("CMAKE_", lang, "_TARGET_INCLUDE_PATH");
cmMakefile* mf = this->LocalGenerator->GetMakefile();
cmProp includePath = mf->GetDefinition(includePathVar);
cmValue includePath = mf->GetDefinition(includePathVar);
if (includePath) {
cmExpandList(*includePath, this->IncludePath);
} else {
+3 -3
View File
@@ -10,9 +10,9 @@
#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#define INCLUDE_REGEX_LINE \
"^[ \t]*[#%][ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])"
@@ -40,12 +40,12 @@ cmDependsC::cmDependsC(cmLocalUnixMakefileGenerator3* lg,
std::string complainRegex = "^$";
{
std::string scanRegexVar = cmStrCat("CMAKE_", lang, "_INCLUDE_REGEX_SCAN");
if (cmProp sr = mf->GetDefinition(scanRegexVar)) {
if (cmValue sr = mf->GetDefinition(scanRegexVar)) {
scanRegex = *sr;
}
std::string complainRegexVar =
cmStrCat("CMAKE_", lang, "_INCLUDE_REGEX_COMPLAIN");
if (cmProp cr = mf->GetDefinition(complainRegexVar)) {
if (cmValue cr = mf->GetDefinition(complainRegexVar)) {
complainRegex = *cr;
}
}
+2 -2
View File
@@ -16,9 +16,9 @@
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmOutputConverter.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
// TODO: Test compiler for the case of the mod file. Some always
// use lower case and some always use upper case. I do not know if any
@@ -416,7 +416,7 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj,
makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile
<< ' ' << stampFileForShell;
cmMakefile* mf = this->LocalGenerator->GetMakefile();
cmProp cid = mf->GetDefinition("CMAKE_Fortran_COMPILER_ID");
cmValue cid = mf->GetDefinition("CMAKE_Fortran_COMPILER_ID");
if (cmNonempty(cid)) {
makeDepends << ' ' << *cid;
}
+1 -1
View File
@@ -18,11 +18,11 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmTargetExport.h"
#include "cmValue.h"
#include "cmake.h"
class cmSourceFile;
+15 -15
View File
@@ -21,12 +21,12 @@
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmPropertyMap.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
static std::string cmExportFileGeneratorEscape(std::string const& str)
{
@@ -125,7 +125,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName, cmGeneratorTarget const* target,
ImportPropertyMap& properties)
{
cmProp input = target->GetProperty(propName);
cmValue input = target->GetProperty(propName);
if (input) {
properties[propName] = *input;
}
@@ -137,7 +137,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap& properties, std::vector<std::string>& missingTargets)
{
cmProp input = target->GetProperty(propName);
cmValue input = target->GetProperty(propName);
if (input) {
if (input->empty()) {
// Set to empty
@@ -174,7 +174,7 @@ bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
if (!target->IsLinkable()) {
return false;
}
cmProp input = target->GetProperty("INTERFACE_LINK_LIBRARIES");
cmValue input = target->GetProperty("INTERFACE_LINK_LIBRARIES");
if (input) {
std::string prepro =
cmGeneratorExpression::Preprocess(*input, preprocessRule);
@@ -341,7 +341,7 @@ void cmExportFileGenerator::PopulateSourcesInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_SOURCES";
cmProp input = gt->GetProperty(propName);
cmValue input = gt->GetProperty(propName);
if (!input) {
return;
@@ -372,7 +372,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_INCLUDE_DIRECTORIES";
cmProp input = target->GetProperty(propName);
cmValue input = target->GetProperty(propName);
cmGeneratorExpression ge;
@@ -431,7 +431,7 @@ void cmExportFileGenerator::PopulateLinkDependsInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_LINK_DEPENDS";
cmProp input = gt->GetProperty(propName);
cmValue input = gt->GetProperty(propName);
if (!input) {
return;
@@ -462,7 +462,7 @@ void cmExportFileGenerator::PopulateLinkDirectoriesInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_LINK_DIRECTORIES";
cmProp input = gt->GetProperty(propName);
cmValue input = gt->GetProperty(propName);
if (!input) {
return;
@@ -497,7 +497,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
void getPropertyContents(cmGeneratorTarget const* tgt, const std::string& prop,
std::set<std::string>& ifaceProperties)
{
cmProp p = tgt->GetProperty(prop);
cmValue p = tgt->GetProperty(prop);
if (!p) {
return;
}
@@ -761,12 +761,12 @@ void cmExportFileGenerator::SetImportLinkInterface(
return;
}
cmProp propContent;
cmValue propContent;
if (cmProp prop_suffixed =
if (cmValue prop_suffixed =
target->GetProperty("LINK_INTERFACE_LIBRARIES" + suffix)) {
propContent = prop_suffixed;
} else if (cmProp prop = target->GetProperty("LINK_INTERFACE_LIBRARIES")) {
} else if (cmValue prop = target->GetProperty("LINK_INTERFACE_LIBRARIES")) {
propContent = prop;
} else {
return;
@@ -854,7 +854,7 @@ void cmExportFileGenerator::SetImportDetailProperties(
cmGeneratorTarget::ManagedType::Native) {
std::string prop = cmStrCat("IMPORTED_COMMON_LANGUAGE_RUNTIME", suffix);
std::string propval;
if (cmProp p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
if (cmValue p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
propval = *p;
} else if (target->IsCSharpOnly()) {
// C# projects do not have the /clr flag, so we set the property
@@ -1215,7 +1215,7 @@ bool cmExportFileGenerator::PopulateExportProperties(
std::string& errorMessage)
{
const auto& targetProperties = gte->Target->GetProperties();
if (cmProp exportProperties =
if (cmValue exportProperties =
targetProperties.GetPropertyValue("EXPORT_PROPERTIES")) {
for (auto& prop : cmExpandedList(*exportProperties)) {
/* Black list reserved properties */
@@ -1228,7 +1228,7 @@ bool cmExportFileGenerator::PopulateExportProperties(
errorMessage = e.str();
return false;
}
cmProp propertyValue = targetProperties.GetPropertyValue(prop);
cmValue propertyValue = targetProperties.GetPropertyValue(prop);
if (!propertyValue) {
// Asked to export a property that isn't defined on the target. Do not
// consider this an error, there's just nothing to export.
+1 -1
View File
@@ -16,12 +16,12 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetExport.h"
#include "cmValue.h"
cmExportInstallFileGenerator::cmExportInstallFileGenerator(
cmInstallExportGenerator* iegen)
@@ -14,12 +14,12 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetLinkLibraryType.h"
#include "cmValue.h"
#include "cmake.h"
class cmListFileBacktrace;
@@ -96,7 +96,7 @@ static void FinalAction(cmMakefile& makefile, std::string const& filename,
// Handle simple output name changes. This command is
// deprecated so we do not support full target name
// translation (which requires per-configuration info).
if (cmProp outname = libtgt->GetProperty("OUTPUT_NAME")) {
if (cmValue outname = libtgt->GetProperty("OUTPUT_NAME")) {
lib = *outname;
}
}
+2 -2
View File
@@ -13,10 +13,10 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmValue.h"
cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
cmGlobalGenerator* gg, const std::vector<std::string>& targets,
@@ -60,7 +60,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
const std::string& propName, cmGeneratorTarget const* tgt,
std::string const& language, std::set<cmGeneratorTarget const*>& emitted)
{
cmProp prop = tgt->GetProperty(propName);
cmValue prop = tgt->GetProperty(propName);
if (!prop) {
return std::string();
}
+3 -3
View File
@@ -16,12 +16,12 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
#include "cmake.h"
@@ -499,12 +499,12 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
if (target->GetType() == cmStateEnums::EXECUTABLE) {
// Determine the directory where the executable target is created, and
// set the working directory to this dir.
cmProp runtimeOutputDir =
cmValue runtimeOutputDir =
makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY");
if (runtimeOutputDir) {
workingDir = *runtimeOutputDir;
} else {
cmProp executableOutputDir =
cmValue executableOutputDir =
makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
if (executableOutputDir) {
workingDir = *executableOutputDir;
+8 -8
View File
@@ -19,13 +19,13 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmSourceFile.h"
#include "cmSourceGroup.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
#include "cmake.h"
@@ -189,7 +189,7 @@ void cmExtraEclipseCDT4Generator::CreateSettingsResourcePrefsFile()
}
fout << "eclipse.preferences.version=1\n";
cmProp encoding = mf->GetDefinition("CMAKE_ECLIPSE_RESOURCE_ENCODING");
cmValue encoding = mf->GetDefinition("CMAKE_ECLIPSE_RESOURCE_ENCODING");
if (encoding) {
fout << "encoding/<project>=" << *encoding << '\n';
}
@@ -244,7 +244,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
const bool envVarSet = cmSystemTools::GetEnv(envVar, envVarValue);
std::string cacheEntryName = cmStrCat("CMAKE_ECLIPSE_ENVVAR_", envVar);
cmProp cacheValue = lg.GetState()->GetInitializedCacheValue(cacheEntryName);
cmValue cacheValue = lg.GetState()->GetInitializedCacheValue(cacheEntryName);
// now we have both, decide which one to use
std::string valueToUse;
@@ -415,7 +415,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
xml.Element("nature", n);
}
if (cmProp extraNaturesProp =
if (cmValue extraNaturesProp =
mf->GetState()->GetGlobalProperty("ECLIPSE_EXTRA_NATURES")) {
std::vector<std::string> extraNatures = cmExpandedList(*extraNaturesProp);
for (std::string const& n : extraNatures) {
@@ -754,7 +754,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
emitted.clear();
for (const auto& lgen : this->GlobalGenerator->GetLocalGenerators()) {
if (cmProp cdefs =
if (cmValue cdefs =
lgen->GetMakefile()->GetProperty("COMPILE_DEFINITIONS")) {
// Expand the list.
std::vector<std::string> defs;
@@ -793,7 +793,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
}
// add system defined c macros
cmProp cDefs =
cmValue cDefs =
mf->GetDefinition("CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS");
if (this->CEnabled && cDefs) {
// Expand the list.
@@ -825,7 +825,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
}
// add system defined c++ macros
cmProp cxxDefs =
cmValue cxxDefs =
mf->GetDefinition("CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS");
if (this->CXXEnabled && cxxDefs) {
// Expand the list.
@@ -1032,7 +1032,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.EndElement(); // storageModule
// Append additional cproject contents without applying any XML formatting
if (cmProp extraCProjectContents =
if (cmValue extraCProjectContents =
mf->GetState()->GetGlobalProperty("ECLIPSE_EXTRA_CPROJECT_CONTENTS")) {
fout << *extraCProjectContents;
}
+2 -2
View File
@@ -13,11 +13,11 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
cmExtraKateGenerator::cmExtraKateGenerator() = default;
@@ -128,7 +128,7 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator& lg,
// only add the "edit_cache" target if it's not ccmake, because
// this will not work within the IDE
if (targetName == "edit_cache") {
cmProp editCommand =
cmValue editCommand =
localGen->GetMakefile()->GetDefinition("CMAKE_EDIT_COMMAND");
if (!editCommand ||
strstr(editCommand->c_str(), "ccmake") != nullptr) {
+7 -7
View File
@@ -17,11 +17,11 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
/*
@@ -364,12 +364,12 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
language);
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
if (cmProp cflags = source->GetProperty(COMPILE_FLAGS)) {
if (cmValue cflags = source->GetProperty(COMPILE_FLAGS)) {
lg->AppendFlags(flags, genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS));
}
const std::string COMPILE_OPTIONS("COMPILE_OPTIONS");
if (cmProp coptions = source->GetProperty(COMPILE_OPTIONS)) {
if (cmValue coptions = source->GetProperty(COMPILE_OPTIONS)) {
lg->AppendCompileOptions(
flags, genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS));
}
@@ -393,14 +393,14 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
// Add preprocessor definitions for this target and configuration.
lg->GetTargetDefines(target, config, language, defines);
const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
if (cmProp compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) {
if (cmValue compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) {
lg->AppendDefines(
defines, genexInterpreter.Evaluate(*compile_defs, COMPILE_DEFINITIONS));
}
std::string defPropName =
cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(config));
if (cmProp config_compile_defs = source->GetProperty(defPropName)) {
if (cmValue config_compile_defs = source->GetProperty(defPropName)) {
lg->AppendDefines(
defines,
genexInterpreter.Evaluate(*config_compile_defs, COMPILE_DEFINITIONS));
@@ -425,7 +425,7 @@ std::string cmExtraSublimeTextGenerator::ComputeIncludes(
// Add include directories for this source file
const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES");
if (cmProp cincludes = source->GetProperty(INCLUDE_DIRECTORIES)) {
if (cmValue cincludes = source->GetProperty(INCLUDE_DIRECTORIES)) {
lg->AppendIncludeDirectories(
includes, genexInterpreter.Evaluate(*cincludes, INCLUDE_DIRECTORIES),
*source);
@@ -445,7 +445,7 @@ bool cmExtraSublimeTextGenerator::Open(const std::string& bindir,
const std::string& projectName,
bool dryRun)
{
cmProp sublExecutable =
cmValue sublExecutable =
this->GlobalGenerator->GetCMakeInstance()->GetCacheDefinition(
"CMAKE_SUBLIMETEXT_EXECUTABLE");
if (!sublExecutable) {
+2 -2
View File
@@ -10,8 +10,8 @@
#include <cm3p/json/value.h>
#include "cmFileAPI.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmValue.h"
#include "cmake.h"
namespace {
@@ -95,7 +95,7 @@ Json::Value Cache::DumpEntryProperty(std::string const& name,
{
Json::Value property = Json::objectValue;
property["name"] = prop;
cmProp p = this->State->GetCacheEntryProperty(name, prop);
cmValue p = this->State->GetCacheEntryProperty(name, prop);
property["value"] = p ? *p : "";
return property;
}
+9 -9
View File
@@ -41,7 +41,6 @@
#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSourceFile.h"
#include "cmSourceGroup.h"
#include "cmState.h"
@@ -53,6 +52,7 @@
#include "cmTarget.h"
#include "cmTargetDepend.h"
#include "cmTargetExport.h"
#include "cmValue.h"
#include "cmake.h"
namespace {
@@ -813,7 +813,7 @@ Json::Value CodemodelConfig::DumpProject(Project& p)
Json::Value CodemodelConfig::DumpMinimumCMakeVersion(cmStateSnapshot s)
{
Json::Value minimumCMakeVersion;
if (cmProp def = s.GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION")) {
if (cmValue def = s.GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION")) {
minimumCMakeVersion = Json::objectValue;
minimumCMakeVersion["string"] = *def;
}
@@ -1187,10 +1187,10 @@ void Target::ProcessLanguage(std::string const& lang)
{
CompileData& cd = this->CompileDataMap[lang];
cd.Language = lang;
if (cmProp sysrootCompile =
if (cmValue sysrootCompile =
this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
cd.Sysroot = *sysrootCompile;
} else if (cmProp sysroot =
} else if (cmValue sysroot =
this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) {
cd.Sysroot = *sysroot;
}
@@ -1259,7 +1259,7 @@ CompileData Target::BuildCompileData(cmSourceFile* sf)
fd.Language);
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
if (cmProp cflags = sf->GetProperty(COMPILE_FLAGS)) {
if (cmValue cflags = sf->GetProperty(COMPILE_FLAGS)) {
std::string flags = genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS);
fd.Flags.emplace_back(std::move(flags), JBTIndex());
}
@@ -1353,7 +1353,7 @@ CompileData Target::BuildCompileData(cmSourceFile* sf)
std::set<std::string> configFileDefines;
const std::string defPropName =
"COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(this->Config);
if (cmProp config_defs = sf->GetProperty(defPropName)) {
if (cmValue config_defs = sf->GetProperty(defPropName)) {
lg->AppendDefines(
configFileDefines,
genexInterpreter.Evaluate(*config_defs, COMPILE_DEFINITIONS));
@@ -1739,10 +1739,10 @@ Json::Value Target::DumpLink()
link["commandFragments"] = std::move(commandFragments);
}
}
if (cmProp sysrootLink =
if (cmValue sysrootLink =
this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_LINK")) {
link["sysroot"] = this->DumpSysroot(*sysrootLink);
} else if (cmProp sysroot =
} else if (cmValue sysroot =
this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) {
link["sysroot"] = this->DumpSysroot(*sysroot);
}
@@ -1868,7 +1868,7 @@ Json::Value Target::DumpDependency(cmTargetDepend const& td)
Json::Value Target::DumpFolder()
{
Json::Value folder;
if (cmProp f = this->GT->GetProperty("FOLDER")) {
if (cmValue f = this->GT->GetProperty("FOLDER")) {
folder = Json::objectValue;
folder["name"] = *f;
}
+2 -2
View File
@@ -11,9 +11,9 @@
#include "cmFileAPI.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmValue.h"
#include "cmake.h"
namespace {
@@ -136,7 +136,7 @@ void Toolchains::DumpToolchainVariable(cmMakefile const* mf,
object[variable.ObjectKey] = jsonArray;
}
} else {
cmProp def = mf->GetDefinition(variableName);
cmValue def = mf->GetDefinition(variableName);
if (def) {
object[variable.ObjectKey] = *def;
}
+5 -5
View File
@@ -47,7 +47,6 @@
#include "cmMessageType.h"
#include "cmNewLineStyle.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmRuntimeDependencyArchive.h"
#include "cmState.h"
@@ -55,6 +54,7 @@
#include "cmSubcommandTable.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cmValue.h"
#include "cmWorkingDirectory.h"
#include "cmake.h"
@@ -1766,7 +1766,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
std::string logVar;
std::string statusVar;
bool tls_verify = status.GetMakefile().IsOn("CMAKE_TLS_VERIFY");
cmProp cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
cmValue cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
std::string netrc_level =
status.GetMakefile().GetSafeDefinition("CMAKE_NETRC");
std::string netrc_file =
@@ -1821,7 +1821,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
} else if (*i == "TLS_CAINFO") {
++i;
if (i != args.end()) {
cainfo = cmProp(*i);
cainfo = cmValue(*i);
} else {
status.SetError("DOWNLOAD missing file value for TLS_CAINFO.");
return false;
@@ -2152,7 +2152,7 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
std::string statusVar;
bool showProgress = false;
bool tls_verify = status.GetMakefile().IsOn("CMAKE_TLS_VERIFY");
cmProp cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
cmValue cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
std::string userpwd;
std::string netrc_level =
status.GetMakefile().GetSafeDefinition("CMAKE_NETRC");
@@ -2205,7 +2205,7 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
} else if (*i == "TLS_CAINFO") {
++i;
if (i != args.end()) {
cainfo = cmProp(*i);
cainfo = cmValue(*i);
} else {
status.SetError("UPLOAD missing file value for TLS_CAINFO.");
return false;
+2 -2
View File
@@ -10,9 +10,9 @@
#include "cmFSPermissions.h"
#include "cmFileTimes.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#ifdef _WIN32
# include "cmsys/FStream.hxx"
@@ -172,7 +172,7 @@ void cmFileCopier::DefaultDirectoryPermissions()
bool cmFileCopier::GetDefaultDirectoryPermissions(mode_t** mode)
{
// check if default dir creation permissions were set
cmProp default_dir_install_permissions = this->Makefile->GetDefinition(
cmValue default_dir_install_permissions = this->Makefile->GetDefinition(
"CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(default_dir_install_permissions)) {
std::vector<std::string> items =
+1
View File
@@ -17,6 +17,7 @@
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
using namespace cmFSPermissions;
+3 -3
View File
@@ -13,13 +13,13 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmSearchPath.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
class cmExecutionStatus;
@@ -301,9 +301,9 @@ void cmFindBase::FillUserGuessPath()
bool cmFindBase::CheckForVariableDefined()
{
if (cmProp value = this->Makefile->GetDefinition(this->VariableName)) {
if (cmValue value = this->Makefile->GetDefinition(this->VariableName)) {
cmState* state = this->Makefile->GetState();
cmProp cacheEntry = state->GetCacheEntryValue(this->VariableName);
cmValue cacheEntry = state->GetCacheEntryValue(this->VariableName);
bool found = !cmIsNOTFOUND(*value);
bool cached = cacheEntry != nullptr;
auto cacheType = cached ? state->GetCacheEntryType(this->VariableName)
+7 -7
View File
@@ -11,9 +11,9 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL");
@@ -183,7 +183,7 @@ void cmFindCommon::SelectDefaultSearchModes()
};
for (auto const& path : search_paths) {
cmProp def = this->Makefile->GetDefinition(path.second);
cmValue def = this->Makefile->GetDefinition(path.second);
if (def) {
path.first = !cmIsOn(*def);
}
@@ -203,11 +203,11 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
return;
}
cmProp sysroot = this->Makefile->GetDefinition("CMAKE_SYSROOT");
cmProp sysrootCompile =
cmValue sysroot = this->Makefile->GetDefinition("CMAKE_SYSROOT");
cmValue sysrootCompile =
this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE");
cmProp sysrootLink = this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK");
cmProp rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH");
cmValue sysrootLink = this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK");
cmValue rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH");
const bool noSysroot = !cmNonempty(sysroot);
const bool noCompileSysroot = !cmNonempty(sysrootCompile);
const bool noLinkSysroot = !cmNonempty(sysrootLink);
@@ -234,7 +234,7 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
cmSystemTools::ConvertToUnixSlashes(r);
}
cmProp stagePrefix = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
cmValue stagePrefix = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
// Copy the original set of unrooted paths.
std::vector<std::string> unrootedPaths = paths;
+4 -4
View File
@@ -12,11 +12,11 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
class cmExecutionStatus;
@@ -46,7 +46,7 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
// add custom lib<qual> paths instead of using fixed lib32, lib64 or
// libx32
if (cmProp customLib = this->Makefile->GetDefinition(
if (cmValue customLib = this->Makefile->GetDefinition(
"CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX")) {
this->AddArchitecturePaths(customLib->c_str());
}
@@ -268,7 +268,7 @@ std::string const& get_prefixes(cmMakefile* mf)
#else
static std::string defaultPrefix = "lib";
#endif
cmProp prefixProp = mf->GetDefinition("CMAKE_FIND_LIBRARY_PREFIXES");
cmValue prefixProp = mf->GetDefinition("CMAKE_FIND_LIBRARY_PREFIXES");
return (prefixProp) ? *prefixProp : defaultPrefix;
}
@@ -283,7 +283,7 @@ std::string const& get_suffixes(cmMakefile* mf)
#else
static std::string defaultSuffix = ".so;.a";
#endif
cmProp suffixProp = mf->GetDefinition("CMAKE_FIND_LIBRARY_SUFFIXES");
cmValue suffixProp = mf->GetDefinition("CMAKE_FIND_LIBRARY_SUFFIXES");
return (suffixProp) ? *suffixProp : defaultSuffix;
}
}
+11 -11
View File
@@ -25,13 +25,13 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmSearchPath.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmVersion.h"
#if defined(__HAIKU__)
@@ -137,7 +137,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
}
// Lookup required version of CMake.
if (cmProp rv =
if (cmValue rv =
this->Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION")) {
unsigned int v[3] = { 0, 0, 0 };
sscanf(rv->c_str(), "%u.%u.%u", &v[0], &v[1], &v[2]);
@@ -148,7 +148,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
this->DebugBuffer.clear();
// Lookup target architecture, if any.
if (cmProp arch =
if (cmValue arch =
this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE")) {
this->LibraryArchitecture = *arch;
}
@@ -177,7 +177,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
// Check if User Package Registry should be disabled
// The `CMAKE_FIND_USE_PACKAGE_REGISTRY` has
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
if (cmProp def =
if (cmValue def =
this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
this->NoUserRegistry = !cmIsOn(*def);
} else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
@@ -187,7 +187,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
// Check if System Package Registry should be disabled
// The `CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY` has
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
if (cmProp def = this->Makefile->GetDefinition(
if (cmValue def = this->Makefile->GetDefinition(
"CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY")) {
this->NoSystemRegistry = !cmIsOn(*def);
} else if (this->Makefile->IsOn(
@@ -201,7 +201,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
}
// Check if Sorting should be enabled
if (cmProp so =
if (cmValue so =
this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_SORT_ORDER")) {
if (*so == "NAME") {
@@ -212,7 +212,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
this->SortOrder = None;
}
}
if (cmProp sd =
if (cmValue sd =
this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_SORT_DIRECTION")) {
this->SortDirection = (*sd == "ASC") ? Asc : Dec;
}
@@ -753,7 +753,7 @@ void cmFindPackageCommand::SetModuleVariables(const std::string& components)
void cmFindPackageCommand::AddFindDefinition(const std::string& var,
cm::string_view value)
{
if (cmProp old = this->Makefile->GetDefinition(var)) {
if (cmValue old = this->Makefile->GetDefinition(var)) {
this->OriginalDefs[var].exists = true;
this->OriginalDefs[var].value = *old;
} else {
@@ -846,7 +846,7 @@ bool cmFindPackageCommand::HandlePackageMode(
this->ConsideredConfigs.clear();
// Try to find the config file.
cmProp def = this->Makefile->GetDefinition(this->Variable);
cmValue def = this->Makefile->GetDefinition(this->Variable);
// Try to load the config file if the directory is known
bool fileFound = false;
@@ -1206,7 +1206,7 @@ bool cmFindPackageCommand::ReadListFile(const std::string& f,
void cmFindPackageCommand::AppendToFoundProperty(bool found)
{
std::vector<std::string> foundContents;
cmProp foundProp =
cmValue foundProp =
this->Makefile->GetState()->GetGlobalProperty("PACKAGES_FOUND");
if (cmNonempty(foundProp)) {
cmExpandList(*foundProp, foundContents, false);
@@ -1218,7 +1218,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
}
std::vector<std::string> notFoundContents;
cmProp notFoundProp =
cmValue notFoundProp =
this->Makefile->GetState()->GetGlobalProperty("PACKAGES_NOT_FOUND");
if (cmNonempty(notFoundProp)) {
cmExpandList(*notFoundProp, notFoundContents, false);
+1 -1
View File
@@ -27,10 +27,10 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
namespace {
class cmForEachFunctionBlocker : public cmFunctionBlocker
+11 -10
View File
@@ -37,7 +37,6 @@
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmStandardLevelResolver.h"
#include "cmState.h"
@@ -46,6 +45,7 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
#include "cmake.h"
std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
@@ -914,8 +914,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
}
if (context->CurrentTarget && context->CurrentTarget->IsImported()) {
cmProp loc = nullptr;
cmProp imp = nullptr;
cmValue loc = nullptr;
cmValue imp = nullptr;
std::string suffix;
if (context->CurrentTarget->Target->GetMappedConfig(context->Config, loc,
imp, suffix)) {
@@ -925,7 +925,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
std::vector<std::string> mappedConfigs;
std::string mapProp = cmStrCat(
"MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(context->Config));
if (cmProp mapValue = context->CurrentTarget->GetProperty(mapProp)) {
if (cmValue mapValue = context->CurrentTarget->GetProperty(mapProp)) {
cmExpandList(cmSystemTools::UpperCase(*mapValue), mappedConfigs);
for (auto const& param : parameters) {
@@ -1502,7 +1502,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string result;
bool haveProp = false;
if (cmProp p = target->GetProperty(propertyName)) {
if (cmValue p = target->GetProperty(propertyName)) {
result = *p;
haveProp = true;
} else if (evaluatingLinkLibraries) {
@@ -1652,8 +1652,8 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
std::vector<std::string> objects;
if (gt->IsImported()) {
cmProp loc = nullptr;
cmProp imp = nullptr;
cmValue loc = nullptr;
cmValue imp = nullptr;
std::string suffix;
if (gt->Target->GetMappedConfig(context->Config, loc, imp, suffix)) {
cmExpandList(*loc, objects);
@@ -1775,7 +1775,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
testedFeatures[lang].push_back(p);
if (availableFeatures.find(lang) == availableFeatures.end()) {
cmProp featuresKnown =
cmValue featuresKnown =
standardResolver.CompileFeaturesAvailable(lang, &error);
if (!featuresKnown) {
reportError(context, content->GetOriginalExpression(), error);
@@ -1790,7 +1790,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
for (auto const& lit : testedFeatures) {
std::vector<std::string> const& langAvailable =
availableFeatures[lit.first];
cmProp standardDefault = context->LG->GetMakefile()->GetDefinition(
cmValue standardDefault = context->LG->GetMakefile()->GetDefinition(
"CMAKE_" + lit.first + "_STANDARD_DEFAULT");
for (std::string const& it : lit.second) {
if (!cm::contains(langAvailable, it)) {
@@ -1804,7 +1804,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
if (!standardResolver.HaveStandardAvailable(target, lit.first,
context->Config, it)) {
if (evalLL) {
cmProp l = target->GetLanguageStandard(lit.first, context->Config);
cmValue l =
target->GetLanguageStandard(lit.first, context->Config);
if (!l) {
l = standardDefault;
}
+127 -124
View File
@@ -58,7 +58,7 @@ const cmsys::RegularExpression FrameworkRegularExpression(
}
template <>
cmProp cmTargetPropertyComputer::GetSources<cmGeneratorTarget>(
cmValue cmTargetPropertyComputer::GetSources<cmGeneratorTarget>(
cmGeneratorTarget const* tgt, cmMessenger* /* messenger */,
cmListFileBacktrace const& /* context */)
{
@@ -322,7 +322,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
cmGeneratorTarget::~cmGeneratorTarget() = default;
cmProp cmGeneratorTarget::GetSourcesProperty() const
cmValue cmGeneratorTarget::GetSourcesProperty() const
{
std::vector<std::string> values;
for (auto const& se : this->SourceEntries) {
@@ -331,7 +331,7 @@ cmProp cmGeneratorTarget::GetSourcesProperty() const
static std::string value;
value.clear();
value = cmJoin(values, ";");
return cmProp(value);
return cmValue(value);
}
cmGlobalGenerator* cmGeneratorTarget::GetGlobalGenerator() const
@@ -356,7 +356,7 @@ const std::string& cmGeneratorTarget::GetName() const
std::string cmGeneratorTarget::GetExportName() const
{
cmProp exportName = this->GetProperty("EXPORT_NAME");
cmValue exportName = this->GetProperty("EXPORT_NAME");
if (cmNonempty(exportName)) {
if (!cmGeneratorExpression::IsValidTargetName(*exportName)) {
@@ -371,9 +371,9 @@ std::string cmGeneratorTarget::GetExportName() const
return this->GetName();
}
cmProp cmGeneratorTarget::GetProperty(const std::string& prop) const
cmValue cmGeneratorTarget::GetProperty(const std::string& prop) const
{
if (cmProp result = cmTargetPropertyComputer::GetProperty(
if (cmValue result = cmTargetPropertyComputer::GetProperty(
this, prop, this->Makefile->GetMessenger(), this->GetBacktrace())) {
return result;
}
@@ -475,7 +475,7 @@ std::string cmGeneratorTarget::GetOutputName(
std::string outName;
for (std::string const& p : props) {
if (cmProp outNameProp = this->GetProperty(p)) {
if (cmValue outNameProp = this->GetProperty(p)) {
outName = *outNameProp;
break;
}
@@ -503,7 +503,7 @@ std::string cmGeneratorTarget::GetFilePrefix(
const std::string& config, cmStateEnums::ArtifactType artifact) const
{
if (this->IsImported()) {
cmProp prefix = this->GetFilePrefixInternal(config, artifact);
cmValue prefix = this->GetFilePrefixInternal(config, artifact);
return prefix ? *prefix : std::string();
}
@@ -517,7 +517,7 @@ std::string cmGeneratorTarget::GetFileSuffix(
const std::string& config, cmStateEnums::ArtifactType artifact) const
{
if (this->IsImported()) {
cmProp suffix = this->GetFileSuffixInternal(config, artifact);
cmValue suffix = this->GetFileSuffixInternal(config, artifact);
return suffix ? *suffix : std::string();
}
@@ -530,7 +530,7 @@ std::string cmGeneratorTarget::GetFileSuffix(
std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const
{
cmProp postfix = nullptr;
cmValue postfix = nullptr;
std::string frameworkPostfix;
if (!config.empty()) {
std::string configProp =
@@ -548,7 +548,7 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const
// framework postfix.
frameworkPostfix = this->GetFrameworkMultiConfigPostfix(config);
if (!frameworkPostfix.empty()) {
postfix = cmProp(frameworkPostfix);
postfix = cmValue(frameworkPostfix);
}
}
return postfix ? *postfix : std::string();
@@ -557,7 +557,7 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const
std::string cmGeneratorTarget::GetFrameworkMultiConfigPostfix(
const std::string& config) const
{
cmProp postfix = nullptr;
cmValue postfix = nullptr;
if (!config.empty()) {
std::string configProp = cmStrCat("FRAMEWORK_MULTI_CONFIG_POSTFIX_",
cmSystemTools::UpperCase(config));
@@ -572,7 +572,7 @@ std::string cmGeneratorTarget::GetFrameworkMultiConfigPostfix(
return postfix ? *postfix : std::string();
}
cmProp cmGeneratorTarget::GetFilePrefixInternal(
cmValue cmGeneratorTarget::GetFilePrefixInternal(
std::string const& config, cmStateEnums::ArtifactType artifact,
const std::string& language) const
{
@@ -602,7 +602,7 @@ cmProp cmGeneratorTarget::GetFilePrefixInternal(
}
// Compute prefix value.
cmProp targetPrefix =
cmValue targetPrefix =
(isImportedLibraryArtifact ? this->GetProperty("IMPORT_PREFIX")
: this->GetProperty("PREFIX"));
@@ -623,7 +623,7 @@ cmProp cmGeneratorTarget::GetFilePrefixInternal(
return targetPrefix;
}
cmProp cmGeneratorTarget::GetFileSuffixInternal(
cmValue cmGeneratorTarget::GetFileSuffixInternal(
std::string const& config, cmStateEnums::ArtifactType artifact,
const std::string& language) const
{
@@ -653,7 +653,7 @@ cmProp cmGeneratorTarget::GetFileSuffixInternal(
}
// Compute suffix value.
cmProp targetSuffix =
cmValue targetSuffix =
(isImportedLibraryArtifact ? this->GetProperty("IMPORT_SUFFIX")
: this->GetProperty("SUFFIX"));
@@ -738,7 +738,7 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
std::vector<std::string>& result,
bool excludeImported, std::string const& language)
{
if (cmProp dirs =
if (cmValue dirs =
depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) {
cmExpandList(cmGeneratorExpression::Evaluate(*dirs, lg, config, headTarget,
dagChecker, depTgt, language),
@@ -748,7 +748,7 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
return;
}
if (cmProp dirs = depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) {
if (cmValue dirs = depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) {
cmExpandList(cmGeneratorExpression::Evaluate(*dirs, lg, config, headTarget,
dagChecker, depTgt, language),
result);
@@ -800,17 +800,17 @@ void cmGeneratorTarget::ComputeObjectMapping()
}
}
cmProp cmGeneratorTarget::GetFeature(const std::string& feature,
const std::string& config) const
cmValue cmGeneratorTarget::GetFeature(const std::string& feature,
const std::string& config) const
{
if (!config.empty()) {
std::string featureConfig =
cmStrCat(feature, '_', cmSystemTools::UpperCase(config));
if (cmProp value = this->GetProperty(featureConfig)) {
if (cmValue value = this->GetProperty(featureConfig)) {
return value;
}
}
if (cmProp value = this->GetProperty(feature)) {
if (cmValue value = this->GetProperty(feature)) {
return value;
}
return this->LocalGenerator->GetFeature(feature, config);
@@ -838,7 +838,7 @@ const char* cmGeneratorTarget::GetLinkPIEProperty(
bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
std::string const& config) const
{
cmProp feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config);
cmValue feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config);
if (!cmIsOn(feature)) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies
@@ -946,23 +946,23 @@ BTs<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty(
cmStrCat(lang, "_STANDARD"));
}
cmProp cmGeneratorTarget::GetLanguageStandard(std::string const& lang,
std::string const& config) const
cmValue cmGeneratorTarget::GetLanguageStandard(std::string const& lang,
std::string const& config) const
{
BTs<std::string> const* languageStandard =
this->GetLanguageStandardProperty(lang, config);
if (languageStandard) {
return cmProp(languageStandard->Value);
return cmValue(languageStandard->Value);
}
return nullptr;
}
cmProp cmGeneratorTarget::GetPropertyWithPairedLanguageSupport(
cmValue cmGeneratorTarget::GetPropertyWithPairedLanguageSupport(
std::string const& lang, const char* suffix) const
{
cmProp propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix));
cmValue propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix));
if (!propertyValue) {
// Check if we should use the value set by another language.
if (lang == "OBJC") {
@@ -975,7 +975,7 @@ cmProp cmGeneratorTarget::GetPropertyWithPairedLanguageSupport(
return propertyValue;
}
cmProp cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const
cmValue cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const
{
return this->GetPropertyWithPairedLanguageSupport(lang, "_EXTENSIONS");
}
@@ -1170,7 +1170,7 @@ const std::string& cmGeneratorTarget::GetLocationForBuild() const
// Now handle the deprecated build-time configuration location.
std::string const noConfig;
location = this->GetDirectory(noConfig);
cmProp cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
cmValue cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
if (cfgid && (*cfgid != ".")) {
location += "/";
location += *cfgid;
@@ -1330,7 +1330,7 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty(
cmGeneratorTarget const* headTarget =
context->HeadTarget ? context->HeadTarget : this;
if (cmProp p = this->GetProperty(prop)) {
if (cmValue p = this->GetProperty(prop)) {
result = cmGeneratorExpressionNode::EvaluateDependentExpression(
*p, context->LG, context, headTarget, &dagChecker, this);
}
@@ -1453,7 +1453,7 @@ void AddLangSpecificImplicitIncludeDirectories(
auto* lg = dependency->GetLocalGenerator();
EvaluatedTargetPropertyEntry entry{ library, library.Backtrace };
if (cmProp val = dependency->GetProperty(propertyName)) {
if (cmValue val = dependency->GetProperty(propertyName)) {
entry.Values.emplace_back(*val);
} else {
if (mode == IncludeDirectoryFallBack::BINARY) {
@@ -1985,12 +1985,12 @@ std::string cmGeneratorTarget::GetCompilePDBName(
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(config);
std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper);
cmProp config_name = this->GetProperty(configProp);
cmValue config_name = this->GetProperty(configProp);
if (cmNonempty(config_name)) {
return prefix + *config_name + ".pdb";
}
cmProp name = this->GetProperty("COMPILE_PDB_NAME");
cmValue name = this->GetProperty("COMPILE_PDB_NAME");
if (cmNonempty(name)) {
return prefix + *name + ".pdb";
}
@@ -2135,11 +2135,11 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
if (!ll.empty()) {
std::string sepVar =
cmStrCat("CMAKE_SHARED_LIBRARY_RUNTIME_", ll, "_FLAG_SEP");
cmProp sep = this->Makefile->GetDefinition(sepVar);
cmValue sep = this->Makefile->GetDefinition(sepVar);
if (cmNonempty(sep)) {
// TODO: Add binary format check to ABI detection and get rid of
// CMAKE_EXECUTABLE_FORMAT.
if (cmProp fmt =
if (cmValue fmt =
this->Makefile->GetDefinition("CMAKE_EXECUTABLE_FORMAT")) {
if (*fmt == "ELF") {
return true;
@@ -2192,7 +2192,7 @@ bool cmGeneratorTarget::DetermineHasMacOSXRpathInstallNameDir(
if (this->GetType() != cmStateEnums::SHARED_LIBRARY) {
return false;
}
cmProp install_name = this->GetProperty("INSTALL_NAME_DIR");
cmValue install_name = this->GetProperty("INSTALL_NAME_DIR");
bool use_install_name = this->MacOSXUseInstallNameDir();
if (install_name && use_install_name && *install_name == "@rpath") {
install_name_is_rpath = true;
@@ -2250,7 +2250,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const
return false;
}
cmProp macosx_rpath_str = this->GetProperty("MACOSX_RPATH");
cmValue macosx_rpath_str = this->GetProperty("MACOSX_RPATH");
if (macosx_rpath_str) {
return this->GetPropertyAsBool("MACOSX_RPATH");
}
@@ -2267,7 +2267,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const
bool cmGeneratorTarget::MacOSXUseInstallNameDir() const
{
cmProp build_with_install_name =
cmValue build_with_install_name =
this->GetProperty("BUILD_WITH_INSTALL_NAME_DIR");
if (build_with_install_name) {
return cmIsOn(*build_with_install_name);
@@ -2360,7 +2360,7 @@ std::string cmGeneratorTarget::GetAppBundleDirectory(
{
std::string fpath = cmStrCat(
this->GetFullName(config, cmStateEnums::RuntimeBinaryArtifact), '.');
cmProp ext = this->GetProperty("BUNDLE_EXTENSION");
cmValue ext = this->GetProperty("BUNDLE_EXTENSION");
fpath += (ext ? *ext : "app");
if (shouldAddContentLevel(level) &&
!this->Makefile->PlatformIsAppleEmbedded()) {
@@ -2390,7 +2390,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(
std::string fpath = cmStrCat(
this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact), '.');
std::string ext;
if (cmProp p = this->GetProperty("BUNDLE_EXTENSION")) {
if (cmValue p = this->GetProperty("BUNDLE_EXTENSION")) {
ext = *p;
} else {
if (this->IsXCTestOnApple()) {
@@ -2415,7 +2415,7 @@ std::string cmGeneratorTarget::GetFrameworkDirectory(
{
std::string fpath = cmStrCat(
this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact), '.');
cmProp ext = this->GetProperty("BUNDLE_EXTENSION");
cmValue ext = this->GetProperty("BUNDLE_EXTENSION");
fpath += (ext ? *ext : "framework");
if (shouldAddFullLevel(level) &&
!this->Makefile->PlatformIsAppleEmbedded()) {
@@ -2467,7 +2467,7 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree(
{
if (this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) {
std::string dir;
cmProp install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
cmValue install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
if (this->CanGenerateInstallNameDir(INSTALL_NAME_FOR_INSTALL)) {
if (cmNonempty(install_name_dir)) {
@@ -2516,7 +2516,7 @@ const std::string* cmGeneratorTarget::GetExportMacro() const
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->GetType() == cmStateEnums::MODULE_LIBRARY ||
this->IsExecutableWithExports()) {
if (cmProp custom_export_name = this->GetProperty("DEFINE_SYMBOL")) {
if (cmValue custom_export_name = this->GetProperty("DEFINE_SYMBOL")) {
this->ExportMacro = *custom_export_name;
} else {
std::string in = cmStrCat(this->GetName(), "_EXPORTS");
@@ -2814,7 +2814,7 @@ std::string cmGeneratorTarget::GetEffectiveFolderName() const
return effectiveFolder;
}
cmProp targetFolder = this->GetProperty("FOLDER");
cmValue targetFolder = this->GetProperty("FOLDER");
if (targetFolder) {
effectiveFolder += *targetFolder;
}
@@ -3042,7 +3042,7 @@ void cmTargetTraceDependencies::Trace()
this->CurrentEntry = &this->GeneratorTarget->SourceDepends[sf];
// Queue dependencies added explicitly by the user.
if (cmProp additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) {
if (cmValue additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> objDeps = cmExpandedList(*additionalDeps);
for (std::string& objDep : objDeps) {
if (cmSystemTools::FileIsFullPath(objDep)) {
@@ -3240,7 +3240,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
if (!this->Makefile->IsOn("APPLE")) {
return;
}
cmProp archs = nullptr;
cmValue archs = nullptr;
if (!config.empty()) {
std::string defVarName =
cmStrCat("OSX_ARCHITECTURES_", cmSystemTools::UpperCase(config));
@@ -3260,7 +3260,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
void cmGeneratorTarget::AddExplicitLanguageFlags(std::string& flags,
cmSourceFile const& sf) const
{
cmProp lang = sf.GetProperty("LANGUAGE");
cmValue lang = sf.GetProperty("LANGUAGE");
if (!lang) {
return;
}
@@ -3641,7 +3641,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
// If this target has ISPC sources make sure to add the header
// directory to other compilation units
if (cm::contains(this->GetAllConfigCompileLanguages(), "ISPC")) {
if (cmProp val = this->GetProperty(propertyName)) {
if (cmValue val = this->GetProperty(propertyName)) {
includes.emplace_back(*val);
} else {
includes.emplace_back(this->GetObjectDirectory(config));
@@ -3971,7 +3971,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions(
if (!config.empty()) {
std::string configPropName =
"COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config);
cmProp configProp = this->GetProperty(configPropName);
cmValue configProp = this->GetProperty(configPropName);
if (configProp) {
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0043)) {
case cmPolicies::WARN: {
@@ -4046,7 +4046,7 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config,
return std::string();
}
const cmGeneratorTarget* generatorTarget = this;
cmProp pchReuseFrom =
cmValue pchReuseFrom =
generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM");
const auto inserted =
@@ -4087,8 +4087,10 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config,
const std::string filename_tmp = cmStrCat(filename, ".tmp");
if (!pchReuseFrom) {
cmProp pchPrologue = this->Makefile->GetDefinition("CMAKE_PCH_PROLOGUE");
cmProp pchEpilogue = this->Makefile->GetDefinition("CMAKE_PCH_EPILOGUE");
cmValue pchPrologue =
this->Makefile->GetDefinition("CMAKE_PCH_PROLOGUE");
cmValue pchEpilogue =
this->Makefile->GetDefinition("CMAKE_PCH_EPILOGUE");
std::string firstHeaderOnDisk;
{
@@ -4159,7 +4161,7 @@ std::string cmGeneratorTarget::GetPchSource(const std::string& config,
std::string& filename = inserted.first->second;
const cmGeneratorTarget* generatorTarget = this;
cmProp pchReuseFrom =
cmValue pchReuseFrom =
generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM");
if (pchReuseFrom) {
generatorTarget =
@@ -4257,7 +4259,7 @@ std::string cmGeneratorTarget::GetPchFile(const std::string& config,
};
cmGeneratorTarget* generatorTarget = this;
cmProp pchReuseFrom =
cmValue pchReuseFrom =
generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM");
if (pchReuseFrom) {
generatorTarget =
@@ -4553,7 +4555,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions(
nullptr, nullptr);
EvaluatedTargetPropertyEntries entries;
if (cmProp linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
if (cmValue linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
std::vector<std::string> options = cmExpandedList(*linkOptions);
for (const auto& option : options) {
std::unique_ptr<TargetPropertyEntry> entry =
@@ -4704,7 +4706,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends(
nullptr);
EvaluatedTargetPropertyEntries entries;
if (cmProp linkDepends = this->GetProperty("LINK_DEPENDS")) {
if (cmValue linkDepends = this->GetProperty("LINK_DEPENDS")) {
std::vector<std::string> depends = cmExpandedList(*linkDepends);
for (const auto& depend : depends) {
std::unique_ptr<TargetPropertyEntry> entry =
@@ -4785,7 +4787,7 @@ bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const
}
std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang);
cmProp currentLanguageStandard = this->GetLanguageStandard(lang, config);
cmValue currentLanguageStandard = this->GetLanguageStandard(lang, config);
std::string newRequiredStandard;
if (!standardResolver.GetNewRequiredStandard(
@@ -4825,7 +4827,7 @@ bool cmGeneratorTarget::ComputeCompileFeatures(
this->LanguageStandardMap[key] = *standardToCopy;
generatorTargetLanguageStandard = &this->LanguageStandardMap[key];
} else {
cmProp defaultStandard = this->Makefile->GetDefinition(
cmValue defaultStandard = this->Makefile->GetDefinition(
cmStrCat("CMAKE_", language.second, "_STANDARD_DEFAULT"));
if (defaultStandard) {
this->LanguageStandardMap[key] = BTs<std::string>(*defaultStandard);
@@ -4928,8 +4930,8 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames(
}
// Check for library version properties.
cmProp version = this->GetProperty("VERSION");
cmProp soversion = this->GetProperty("SOVERSION");
cmValue version = this->GetProperty("VERSION");
cmValue soversion = this->GetProperty("SOVERSION");
if (!this->HasSOName(config) ||
this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") ||
this->IsFrameworkOnApple()) {
@@ -5007,10 +5009,10 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames(
// This versioning is supported only for executables and then only
// when the platform supports symbolic links.
#if defined(_WIN32) && !defined(__CYGWIN__)
cmProp version;
cmValue version;
#else
// Check for executable version properties.
cmProp version = this->GetProperty("VERSION");
cmValue version = this->GetProperty("VERSION");
if (this->GetType() != cmStateEnums::EXECUTABLE ||
this->Makefile->IsOn("XCODE")) {
version = nullptr;
@@ -5104,8 +5106,8 @@ void cmGeneratorTarget::GetFullNameInternal(
// retrieve prefix and suffix
std::string ll = this->GetLinkerLanguage(config);
cmProp targetPrefix = this->GetFilePrefixInternal(config, artifact, ll);
cmProp targetSuffix = this->GetFileSuffixInternal(config, artifact, ll);
cmValue targetPrefix = this->GetFilePrefixInternal(config, artifact, ll);
cmValue targetSuffix = this->GetFileSuffixInternal(config, artifact, ll);
// The implib option is only allowed for shared libraries, module
// libraries, and executables.
@@ -5123,13 +5125,13 @@ void cmGeneratorTarget::GetFullNameInternal(
if (this->IsFrameworkOnApple()) {
fw_prefix =
cmStrCat(this->GetFrameworkDirectory(config, ContentLevel), '/');
targetPrefix = cmProp(fw_prefix);
targetPrefix = cmValue(fw_prefix);
targetSuffix = nullptr;
}
if (this->IsCFBundleOnApple()) {
fw_prefix = cmStrCat(this->GetCFBundleDirectory(config, FullLevel), '/');
targetPrefix = cmProp(fw_prefix);
targetPrefix = cmValue(fw_prefix);
targetSuffix = nullptr;
}
@@ -5145,13 +5147,13 @@ void cmGeneratorTarget::GetFullNameInternal(
// EXECUTABLE_SUFFIX attribute.
if (this->IsFrameworkOnApple() &&
this->GetGlobalGenerator()->GetName() == "Xcode") {
targetSuffix = cmProp(configPostfix);
targetSuffix = cmValue(configPostfix);
} else {
outBase += configPostfix;
}
// Name shared libraries with their version number on some platforms.
if (cmProp soversion = this->GetProperty("SOVERSION")) {
if (cmValue soversion = this->GetProperty("SOVERSION")) {
if (this->GetType() == cmStateEnums::SHARED_LIBRARY &&
!isImportedLibraryArtifact &&
this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION")) {
@@ -5187,7 +5189,7 @@ std::string cmGeneratorTarget::GetPDBOutputName(
props.emplace_back("PDB_NAME");
for (std::string const& p : props) {
if (cmProp outName = this->GetProperty(p)) {
if (cmValue outName = this->GetProperty(p)) {
base = *outName;
break;
}
@@ -5214,7 +5216,7 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
props.emplace_back("PDB_NAME");
for (std::string const& p : props) {
if (cmProp outName = this->GetProperty(p)) {
if (cmValue outName = this->GetProperty(p)) {
base = *outName;
break;
}
@@ -5297,7 +5299,7 @@ cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const
} else {
// Handle the MACOSX_PACKAGE_LOCATION property on source files that
// were not listed in one of the other lists.
if (cmProp location = sf->GetProperty("MACOSX_PACKAGE_LOCATION")) {
if (cmValue location = sf->GetProperty("MACOSX_PACKAGE_LOCATION")) {
flags.MacFolder = location->c_str();
const bool stripResources =
this->GlobalGenerator->ShouldStripResourcePath(this->Makefile);
@@ -5327,7 +5329,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
this->SourceFileFlagsConstructed = true;
// Process public headers to mark the source files.
if (cmProp files = this->GetProperty("PUBLIC_HEADER")) {
if (cmValue files = this->GetProperty("PUBLIC_HEADER")) {
std::vector<std::string> relFiles = cmExpandedList(*files);
for (std::string const& relFile : relFiles) {
if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) {
@@ -5340,7 +5342,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
// Process private headers after public headers so that they take
// precedence if a file is listed in both.
if (cmProp files = this->GetProperty("PRIVATE_HEADER")) {
if (cmValue files = this->GetProperty("PRIVATE_HEADER")) {
std::vector<std::string> relFiles = cmExpandedList(*files);
for (std::string const& relFile : relFiles) {
if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) {
@@ -5352,7 +5354,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
}
// Mark sources listed as resources.
if (cmProp files = this->GetProperty("RESOURCE")) {
if (cmValue files = this->GetProperty("RESOURCE")) {
std::vector<std::string> relFiles = cmExpandedList(*files);
for (std::string const& relFile : relFiles) {
if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) {
@@ -5380,7 +5382,7 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const
this->GetLinkImplementationClosure(config);
for (cmGeneratorTarget const* li : deps) {
#define CM_READ_COMPATIBLE_INTERFACE(X, x) \
if (cmProp prop = li->GetProperty("COMPATIBLE_INTERFACE_" #X)) { \
if (cmValue prop = li->GetProperty("COMPATIBLE_INTERFACE_" #X)) { \
std::vector<std::string> props; \
cmExpandList(*prop, props); \
compat.Props##x.insert(props.begin(), props.end()); \
@@ -5490,7 +5492,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
const std::string& config, CompatibleType t,
PropertyType* /*unused*/)
{
cmProp prop = dependee->GetProperty(propName);
cmValue prop = dependee->GetProperty(propName);
if (!prop) {
return;
}
@@ -5676,7 +5678,7 @@ std::string valueAsString<std::string>(std::string value)
return value;
}
template <>
std::string valueAsString<cmProp>(cmProp value)
std::string valueAsString<cmValue>(cmValue value)
{
return value ? value : std::string("(unset)");
}
@@ -5730,7 +5732,7 @@ bool getTypedProperty<bool>(cmGeneratorTarget const* tgt,
return tgt->GetPropertyAsBool(prop);
}
cmProp value = tgt->GetProperty(prop);
cmValue value = tgt->GetProperty(prop);
return cmIsOn(genexInterpreter->Evaluate(value ? *value : "", prop));
}
@@ -5739,7 +5741,7 @@ const char* getTypedProperty<const char*>(
cmGeneratorTarget const* tgt, const std::string& prop,
cmGeneratorExpressionInterpreter* genexInterpreter)
{
cmProp value = tgt->GetProperty(prop);
cmValue value = tgt->GetProperty(prop);
if (genexInterpreter == nullptr) {
return value.GetCStr();
@@ -5753,7 +5755,7 @@ std::string getTypedProperty<std::string>(
cmGeneratorTarget const* tgt, const std::string& prop,
cmGeneratorExpressionInterpreter* genexInterpreter)
{
cmProp value = tgt->GetProperty(prop);
cmValue value = tgt->GetProperty(prop);
if (genexInterpreter == nullptr) {
return valueAsString(value);
@@ -6130,7 +6132,7 @@ void cmGeneratorTarget::GetTargetVersion(const std::string& property,
assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY);
if (cmProp version = this->GetProperty(property)) {
if (cmValue version = this->GetProperty(property)) {
// Try to parse the version number and store the results that were
// successfully parsed.
int parsed_major;
@@ -6158,12 +6160,12 @@ std::string cmGeneratorTarget::GetRuntimeLinkLibrary(
{
// This is activated by the presence of a default selection whether or
// not it is overridden by a property.
cmProp runtimeLibraryDefault = this->Makefile->GetDefinition(
cmValue runtimeLibraryDefault = this->Makefile->GetDefinition(
cmStrCat("CMAKE_", lang, "_RUNTIME_LIBRARY_DEFAULT"));
if (!cmNonempty(runtimeLibraryDefault)) {
return std::string();
}
cmProp runtimeLibraryValue =
cmValue runtimeLibraryValue =
this->Target->GetProperty(cmStrCat(lang, "_RUNTIME_LIBRARY"));
if (!runtimeLibraryValue) {
runtimeLibraryValue = runtimeLibraryDefault;
@@ -6186,7 +6188,8 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory(
bool cmGeneratorTarget::IsFortranBuildingInstrinsicModules() const
{
if (cmProp prop = this->GetProperty("Fortran_BUILDING_INSTRINSIC_MODULES")) {
if (cmValue prop =
this->GetProperty("Fortran_BUILDING_INSTRINSIC_MODULES")) {
return cmIsOn(*prop);
}
return false;
@@ -6197,7 +6200,7 @@ std::string cmGeneratorTarget::CreateFortranModuleDirectory(
{
std::string mod_dir;
std::string target_mod_dir;
if (cmProp prop = this->GetProperty("Fortran_MODULE_DIRECTORY")) {
if (cmValue prop = this->GetProperty("Fortran_MODULE_DIRECTORY")) {
target_mod_dir = *prop;
} else {
std::string const& default_mod_dir =
@@ -6206,7 +6209,7 @@ std::string cmGeneratorTarget::CreateFortranModuleDirectory(
target_mod_dir = default_mod_dir;
}
}
cmProp moddir_flag =
cmValue moddir_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
if (!target_mod_dir.empty() && moddir_flag) {
// Compute the full path to the module directory.
@@ -6289,10 +6292,10 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const
{
assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY);
if (cmProp fversion = this->GetProperty("FRAMEWORK_VERSION")) {
if (cmValue fversion = this->GetProperty("FRAMEWORK_VERSION")) {
return *fversion;
}
if (cmProp tversion = this->GetProperty("VERSION")) {
if (cmValue tversion = this->GetProperty("VERSION")) {
return *tversion;
}
return "A";
@@ -6300,7 +6303,7 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const
void cmGeneratorTarget::ComputeVersionedName(
std::string& vName, std::string const& prefix, std::string const& base,
std::string const& suffix, std::string const& name, cmProp version) const
std::string const& suffix, std::string const& name, cmValue version) const
{
vName = this->Makefile->IsOn("APPLE") ? (prefix + base) : name;
if (version) {
@@ -6548,9 +6551,9 @@ void cmGeneratorTarget::ComputeLinkInterface(
// How many repetitions are needed if this library has cyclic
// dependencies?
std::string propName = cmStrCat("LINK_INTERFACE_MULTIPLICITY", suffix);
if (cmProp config_reps = this->GetProperty(propName)) {
if (cmValue config_reps = this->GetProperty(propName)) {
sscanf(config_reps->c_str(), "%u", &iface.Multiplicity);
} else if (cmProp reps =
} else if (cmValue reps =
this->GetProperty("LINK_INTERFACE_MULTIPLICITY")) {
sscanf(reps->c_str(), "%u", &iface.Multiplicity);
}
@@ -6707,14 +6710,14 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
}
// Select an output directory.
if (cmProp config_outdir = this->GetProperty(configProp)) {
if (cmValue config_outdir = this->GetProperty(configProp)) {
// Use the user-specified per-configuration output directory.
out = cmGeneratorExpression::Evaluate(*config_outdir, this->LocalGenerator,
config, this);
// Skip per-configuration subdirectory.
conf.clear();
} else if (cmProp outdir = this->GetProperty(propertyName)) {
} else if (cmValue outdir = this->GetProperty(propertyName)) {
// Use the user-specified output directory.
out = cmGeneratorExpression::Evaluate(*outdir, this->LocalGenerator,
config, this);
@@ -6777,14 +6780,14 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
}
// Select an output directory.
if (cmProp config_outdir = this->GetProperty(configProp)) {
if (cmValue config_outdir = this->GetProperty(configProp)) {
// Use the user-specified per-configuration output directory.
out = cmGeneratorExpression::Evaluate(*config_outdir, this->LocalGenerator,
config);
// Skip per-configuration subdirectory.
conf.clear();
} else if (cmProp outdir = this->GetProperty(propertyName)) {
} else if (cmValue outdir = this->GetProperty(propertyName)) {
// Use the user-specified output directory.
out =
cmGeneratorExpression::Evaluate(*outdir, this->LocalGenerator, config);
@@ -6837,7 +6840,7 @@ bool cmGeneratorTarget::GetRPATH(const std::string& config,
const std::string& prop,
std::string& rpath) const
{
cmProp value = this->GetProperty(prop);
cmValue value = this->GetProperty(prop);
if (!value) {
return false;
}
@@ -6862,7 +6865,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
cmProp explicitLibraries = nullptr;
cmValue explicitLibraries = nullptr;
std::string linkIfaceProp;
bool const cmp0022NEW = (this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
this->GetPolicyStatusCMP0022() != cmPolicies::WARN);
@@ -6891,7 +6894,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
!this->PolicyWarnedCMP0022) {
// Compare the explicitly set old link interface properties to the
// preferred new link interface property one and warn if different.
cmProp newExplicitLibraries =
cmValue newExplicitLibraries =
this->GetProperty("INTERFACE_LINK_LIBRARIES");
if (newExplicitLibraries &&
(*newExplicitLibraries != *explicitLibraries)) {
@@ -6948,7 +6951,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
// preferred new link interface property and warn if different.
cmLinkInterface ifaceNew;
static const std::string newProp = "INTERFACE_LINK_LIBRARIES";
if (cmProp newExplicitLibraries = this->GetProperty(newProp)) {
if (cmValue newExplicitLibraries = this->GetProperty(newProp)) {
this->ExpandLinkItems(newProp, *newExplicitLibraries, config,
headTarget, usage_requirements_only, ifaceNew);
}
@@ -7016,7 +7019,7 @@ std::vector<ValueType> computeImplicitLanguageTargets(
std::string const& runtimeLibrary =
currentTarget->GetRuntimeLinkLibrary(lang, config);
if (cmProp runtimeLinkOptions = currentTarget->Makefile->GetDefinition(
if (cmValue runtimeLinkOptions = currentTarget->Makefile->GetDefinition(
"CMAKE_" + lang + "_RUNTIME_LIBRARIES_" + runtimeLibrary)) {
std::vector<std::string> libsVec = cmExpandedList(*runtimeLinkOptions);
result.reserve(libsVec.size());
@@ -7154,8 +7157,8 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Initialize members.
info.NoSOName = false;
cmProp loc = nullptr;
cmProp imp = nullptr;
cmValue loc = nullptr;
cmValue imp = nullptr;
std::string suffix;
if (!this->Target->GetMappedConfig(desired_config, loc, imp, suffix)) {
return;
@@ -7164,7 +7167,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Get the link interface.
{
std::string linkProp = "INTERFACE_LINK_LIBRARIES";
cmProp propertyLibs = this->GetProperty(linkProp);
cmValue propertyLibs = this->GetProperty(linkProp);
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
if (!propertyLibs) {
@@ -7197,9 +7200,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
info.Location = *loc;
} else {
std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix);
if (cmProp config_location = this->GetProperty(impProp)) {
if (cmValue config_location = this->GetProperty(impProp)) {
info.Location = *config_location;
} else if (cmProp location = this->GetProperty("IMPORTED_LOCATION")) {
} else if (cmValue location = this->GetProperty("IMPORTED_LOCATION")) {
info.Location = *location;
}
}
@@ -7207,9 +7210,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Get the soname.
if (this->GetType() == cmStateEnums::SHARED_LIBRARY) {
std::string soProp = cmStrCat("IMPORTED_SONAME", suffix);
if (cmProp config_soname = this->GetProperty(soProp)) {
if (cmValue config_soname = this->GetProperty(soProp)) {
info.SOName = *config_soname;
} else if (cmProp soname = this->GetProperty("IMPORTED_SONAME")) {
} else if (cmValue soname = this->GetProperty("IMPORTED_SONAME")) {
info.SOName = *soname;
}
}
@@ -7217,9 +7220,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Get the "no-soname" mark.
if (this->GetType() == cmStateEnums::SHARED_LIBRARY) {
std::string soProp = cmStrCat("IMPORTED_NO_SONAME", suffix);
if (cmProp config_no_soname = this->GetProperty(soProp)) {
if (cmValue config_no_soname = this->GetProperty(soProp)) {
info.NoSOName = cmIsOn(*config_no_soname);
} else if (cmProp no_soname = this->GetProperty("IMPORTED_NO_SONAME")) {
} else if (cmValue no_soname = this->GetProperty("IMPORTED_NO_SONAME")) {
info.NoSOName = cmIsOn(*no_soname);
}
}
@@ -7230,9 +7233,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
} else if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->IsExecutableWithExports()) {
std::string impProp = cmStrCat("IMPORTED_IMPLIB", suffix);
if (cmProp config_implib = this->GetProperty(impProp)) {
if (cmValue config_implib = this->GetProperty(impProp)) {
info.ImportLibrary = *config_implib;
} else if (cmProp implib = this->GetProperty("IMPORTED_IMPLIB")) {
} else if (cmValue implib = this->GetProperty("IMPORTED_IMPLIB")) {
info.ImportLibrary = *implib;
}
}
@@ -7241,9 +7244,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
{
std::string linkProp =
cmStrCat("IMPORTED_LINK_DEPENDENT_LIBRARIES", suffix);
if (cmProp config_libs = this->GetProperty(linkProp)) {
if (cmValue config_libs = this->GetProperty(linkProp)) {
info.SharedDeps = *config_libs;
} else if (cmProp libs =
} else if (cmValue libs =
this->GetProperty("IMPORTED_LINK_DEPENDENT_LIBRARIES")) {
info.SharedDeps = *libs;
}
@@ -7253,9 +7256,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
if (this->LinkLanguagePropagatesToDependents()) {
std::string linkProp =
cmStrCat("IMPORTED_LINK_INTERFACE_LANGUAGES", suffix);
if (cmProp config_libs = this->GetProperty(linkProp)) {
if (cmValue config_libs = this->GetProperty(linkProp)) {
info.Languages = *config_libs;
} else if (cmProp libs =
} else if (cmValue libs =
this->GetProperty("IMPORTED_LINK_INTERFACE_LANGUAGES")) {
info.Languages = *libs;
}
@@ -7264,9 +7267,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Get information if target is managed assembly.
{
std::string linkProp = "IMPORTED_COMMON_LANGUAGE_RUNTIME";
if (cmProp pc = this->GetProperty(linkProp + suffix)) {
if (cmValue pc = this->GetProperty(linkProp + suffix)) {
info.Managed = this->CheckManagedType(*pc);
} else if (cmProp p = this->GetProperty(linkProp)) {
} else if (cmValue p = this->GetProperty(linkProp)) {
info.Managed = this->CheckManagedType(*p);
}
}
@@ -7275,9 +7278,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
if (this->GetType() == cmStateEnums::STATIC_LIBRARY) {
std::string linkProp =
cmStrCat("IMPORTED_LINK_INTERFACE_MULTIPLICITY", suffix);
if (cmProp config_reps = this->GetProperty(linkProp)) {
if (cmValue config_reps = this->GetProperty(linkProp)) {
sscanf(config_reps->c_str(), "%u", &info.Multiplicity);
} else if (cmProp reps =
} else if (cmValue reps =
this->GetProperty("IMPORTED_LINK_INTERFACE_MULTIPLICITY")) {
sscanf(reps->c_str(), "%u", &info.Multiplicity);
}
@@ -7456,14 +7459,14 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
bool cmGeneratorTarget::IsDeprecated() const
{
cmProp deprecation = this->GetProperty("DEPRECATION");
cmValue deprecation = this->GetProperty("DEPRECATION");
return cmNonempty(deprecation);
}
std::string cmGeneratorTarget::GetDeprecation() const
{
// find DEPRECATION property
if (cmProp deprecation = this->GetProperty("DEPRECATION")) {
if (cmValue deprecation = this->GetProperty("DEPRECATION")) {
return *deprecation;
}
return std::string();
@@ -7534,7 +7537,7 @@ bool cmGeneratorTarget::IsCSharpOnly() const
std::set<std::string> languages = this->GetAllConfigCompileLanguages();
// Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets.
cmProp linkLang = this->GetProperty("LINKER_LANGUAGE");
cmValue linkLang = this->GetProperty("LINKER_LANGUAGE");
if (cmNonempty(linkLang)) {
languages.insert(*linkLang);
}
@@ -7943,7 +7946,7 @@ cmGeneratorTarget::ManagedType cmGeneratorTarget::GetManagedType(
}
// Check for explicitly set clr target property.
if (cmProp clr = this->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
if (cmValue clr = this->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
return this->CheckManagedType(*clr);
}
+17 -17
View File
@@ -19,8 +19,8 @@
#include "cmLinkItem.h"
#include "cmListFileCache.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmValue.h"
class cmComputeLinkInformation;
class cmCustomCommand;
@@ -89,7 +89,7 @@ public:
std::vector<std::string> GetPropertyKeys() const;
//! Might return a nullptr if the property is not set or invalid
cmProp GetProperty(const std::string& prop) const;
cmValue GetProperty(const std::string& prop) const;
//! Always returns a valid pointer
std::string const& GetSafeProperty(std::string const& prop) const;
bool GetPropertyAsBool(const std::string& prop) const;
@@ -163,10 +163,10 @@ public:
BTs<std::string> const* GetLanguageStandardProperty(
std::string const& lang, std::string const& config) const;
cmProp GetLanguageStandard(std::string const& lang,
std::string const& config) const;
cmValue GetLanguageStandard(std::string const& lang,
std::string const& config) const;
cmProp GetLanguageExtensions(std::string const& lang) const;
cmValue GetLanguageExtensions(std::string const& lang) const;
bool GetLanguageStandardRequired(std::string const& lang) const;
@@ -187,8 +187,8 @@ public:
void ComputeObjectMapping();
cmProp GetFeature(const std::string& feature,
const std::string& config) const;
cmValue GetFeature(const std::string& feature,
const std::string& config) const;
const char* GetLinkPIEProperty(const std::string& config) const;
@@ -835,7 +835,7 @@ public:
std::string GetFortranModuleDirectory(std::string const& working_dir) const;
bool IsFortranBuildingInstrinsicModules() const;
cmProp GetSourcesProperty() const;
cmValue GetSourcesProperty() const;
void AddISPCGeneratedHeader(std::string const& header,
std::string const& config);
@@ -884,12 +884,12 @@ private:
bool NeedImportLibraryName(std::string const& config) const;
cmProp GetFilePrefixInternal(std::string const& config,
cmStateEnums::ArtifactType artifact,
const std::string& language = "") const;
cmProp GetFileSuffixInternal(std::string const& config,
cmStateEnums::ArtifactType artifact,
const std::string& language = "") const;
cmValue GetFilePrefixInternal(std::string const& config,
cmStateEnums::ArtifactType artifact,
const std::string& language = "") const;
cmValue GetFileSuffixInternal(std::string const& config,
cmStateEnums::ArtifactType artifact,
const std::string& language = "") const;
std::string GetFullNameInternal(const std::string& config,
cmStateEnums::ArtifactType artifact) const;
@@ -908,7 +908,7 @@ private:
void ComputeVersionedName(std::string& vName, std::string const& prefix,
std::string const& base, std::string const& suffix,
std::string const& name, cmProp version) const;
std::string const& name, cmValue version) const;
struct CompatibleInterfacesBase
{
@@ -1116,8 +1116,8 @@ private:
mutable std::map<std::string, BTs<std::string>> LanguageStandardMap;
cmProp GetPropertyWithPairedLanguageSupport(std::string const& lang,
const char* suffix) const;
cmValue GetPropertyWithPairedLanguageSupport(std::string const& lang,
const char* suffix) const;
void ComputeLinkImplementationRuntimeLibraries(
const std::string& config, cmOptionalLinkImplementation& impl) const;
+4 -4
View File
@@ -7,9 +7,9 @@
#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmValue.h"
// cmGetCMakePropertyCommand
bool cmGetCMakePropertyCommand(std::vector<std::string> const& args,
@@ -24,12 +24,12 @@ bool cmGetCMakePropertyCommand(std::vector<std::string> const& args,
std::string output = "NOTFOUND";
if (args[1] == "VARIABLES") {
if (cmProp varsProp = status.GetMakefile().GetProperty("VARIABLES")) {
if (cmValue varsProp = status.GetMakefile().GetProperty("VARIABLES")) {
output = *varsProp;
}
} else if (args[1] == "MACROS") {
output.clear();
if (cmProp macrosProp = status.GetMakefile().GetProperty("MACROS")) {
if (cmValue macrosProp = status.GetMakefile().GetProperty("MACROS")) {
output = *macrosProp;
}
} else if (args[1] == "COMPONENTS") {
@@ -37,7 +37,7 @@ bool cmGetCMakePropertyCommand(std::vector<std::string> const& args,
status.GetMakefile().GetGlobalGenerator()->GetInstallComponents();
output = cmJoin(*components, ";");
} else {
cmProp prop = nullptr;
cmValue prop = nullptr;
if (!args[1].empty()) {
prop = status.GetMakefile().GetState()->GetGlobalProperty(args[1]);
}
+3 -3
View File
@@ -7,14 +7,14 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmValue.h"
namespace {
void StoreResult(cmMakefile& makefile, std::string const& variable,
const char* prop);
void StoreResult(cmMakefile& makefile, std::string const& variable,
cmProp prop);
cmValue prop);
}
// cmGetDirectoryPropertyCommand
@@ -106,7 +106,7 @@ void StoreResult(cmMakefile& makefile, std::string const& variable,
makefile.AddDefinition(variable, prop ? prop : "");
}
void StoreResult(cmMakefile& makefile, std::string const& variable,
cmProp prop)
cmValue prop)
{
makefile.AddDefinition(variable, prop);
}
+2 -2
View File
@@ -4,10 +4,10 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
// cmGetFilenameComponentCommand
bool cmGetFilenameComponentCommand(std::vector<std::string> const& args,
@@ -22,7 +22,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args,
// Check and see if the value has been stored in the cache
// already, if so use that value
if (args.size() >= 4 && args.back() == "CACHE") {
cmProp cacheValue = status.GetMakefile().GetDefinition(args.front());
cmValue cacheValue = status.GetMakefile().GetDefinition(args.front());
if (cacheValue && !cmIsNOTFOUND(*cacheValue)) {
return true;
}
+4 -3
View File
@@ -20,6 +20,7 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTest.h"
#include "cmValue.h"
#include "cmake.h"
class cmMessenger;
@@ -272,7 +273,7 @@ template <>
bool StoreResult(OutType infoType, cmMakefile& makefile,
const std::string& variable, std::nullptr_t value)
{
return StoreResult(infoType, makefile, variable, cmProp(value));
return StoreResult(infoType, makefile, variable, cmValue(value));
}
bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name,
@@ -366,7 +367,7 @@ bool HandleTargetMode(cmExecutionStatus& status, const std::string& name,
}
cmListFileBacktrace bt = status.GetMakefile().GetBacktrace();
cmMessenger* messenger = status.GetMakefile().GetMessenger();
cmProp prop = target->GetComputedProperty(propertyName, messenger, bt);
cmValue prop = target->GetComputedProperty(propertyName, messenger, bt);
if (!prop) {
prop = target->GetProperty(propertyName);
}
@@ -445,7 +446,7 @@ bool HandleCacheMode(cmExecutionStatus& status, const std::string& name,
return false;
}
cmProp value = nullptr;
cmValue value = nullptr;
if (status.GetMakefile().GetState()->GetCacheEntryValue(name)) {
value = status.GetMakefile().GetState()->GetCacheEntryProperty(
name, propertyName);
+2 -2
View File
@@ -4,9 +4,9 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSetPropertyCommand.h"
#include "cmSourceFile.h"
#include "cmValue.h"
bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
@@ -58,7 +58,7 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
}
if (sf) {
cmProp prop = nullptr;
cmValue prop = nullptr;
if (!args[property_arg_index].empty()) {
prop = sf->GetPropertyForUser(args[property_arg_index]);
}
+2 -2
View File
@@ -10,8 +10,8 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmTarget.h"
#include "cmValue.h"
class cmMessenger;
@@ -42,7 +42,7 @@ bool cmGetTargetPropertyCommand(std::vector<std::string> const& args,
}
}
} else if (!args[2].empty()) {
cmProp prop_cstr = nullptr;
cmValue prop_cstr = nullptr;
cmListFileBacktrace bt = mf.GetBacktrace();
cmMessenger* messenger = mf.GetMessenger();
prop_cstr = tgt->GetComputedProperty(args[2], messenger, bt);

Some files were not shown because too many files have changed in this diff Show More