From cc56dc7468bfee49dedbf395d6fca5c372d200fe Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Tue, 21 Sep 2021 17:12:35 +0200 Subject: Rename cmProp in cmValue --- Source/CMakeLists.txt | 3 +- Source/CPack/IFW/cmCPackIFWCommon.cxx | 2 +- Source/CPack/IFW/cmCPackIFWCommon.h | 4 +- Source/CPack/IFW/cmCPackIFWGenerator.cxx | 34 +-- Source/CPack/IFW/cmCPackIFWInstaller.cxx | 61 ++--- Source/CPack/IFW/cmCPackIFWPackage.cxx | 60 ++--- Source/CPack/IFW/cmCPackIFWRepository.cxx | 14 +- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 42 ++-- Source/CPack/cmCPackArchiveGenerator.cxx | 4 +- Source/CPack/cmCPackBundleGenerator.cxx | 17 +- Source/CPack/cmCPackCygwinBinaryGenerator.cxx | 4 +- Source/CPack/cmCPackCygwinSourceGenerator.cxx | 6 +- Source/CPack/cmCPackDebGenerator.cxx | 62 ++--- Source/CPack/cmCPackDragNDropGenerator.cxx | 14 +- Source/CPack/cmCPackExternalGenerator.cxx | 18 +- Source/CPack/cmCPackFreeBSDGenerator.cxx | 2 +- Source/CPack/cmCPackGenerator.cxx | 96 ++++---- Source/CPack/cmCPackGenerator.h | 12 +- Source/CPack/cmCPackNSISGenerator.cxx | 16 +- Source/CPack/cmCPackNuGetGenerator.cxx | 4 +- Source/CPack/cmCPackOSXX11Generator.cxx | 6 +- Source/CPack/cmCPackPKGGenerator.cxx | 8 +- Source/CPack/cmCPackPackageMakerGenerator.cxx | 14 +- Source/CPack/cmCPackProductBuildGenerator.cxx | 16 +- Source/CPack/cmCPackProductBuildGenerator.h | 4 +- Source/CPack/cmCPackRPMGenerator.cxx | 4 +- Source/CPack/cmCPackSTGZGenerator.cxx | 2 +- Source/CPack/cpack.cxx | 16 +- Source/CTest/cmCTestBuildCommand.cxx | 12 +- Source/CTest/cmCTestBuildHandler.cxx | 6 +- Source/CTest/cmCTestConfigureCommand.cxx | 12 +- Source/CTest/cmCTestGenericHandler.cxx | 10 +- Source/CTest/cmCTestGenericHandler.h | 12 +- Source/CTest/cmCTestHandlerCommand.cxx | 6 +- Source/CTest/cmCTestScriptHandler.cxx | 10 +- Source/CTest/cmCTestStartCommand.cxx | 12 +- Source/CTest/cmCTestSubmitCommand.cxx | 10 +- Source/CTest/cmCTestSubmitHandler.cxx | 10 +- Source/CTest/cmCTestTestCommand.cxx | 10 +- Source/CTest/cmCTestTestHandler.cxx | 10 +- Source/CTest/cmCTestTestHandler.h | 4 +- Source/CTest/cmCTestUpdateHandler.cxx | 4 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 6 +- Source/CursesDialog/cmCursesMainForm.cxx | 20 +- Source/QtDialog/QCMake.cxx | 16 +- Source/cmBuildCommand.cxx | 4 +- Source/cmBuildNameCommand.cxx | 4 +- Source/cmCMakePathCommand.cxx | 4 +- Source/cmCMakePolicyCommand.cxx | 2 +- Source/cmCTest.cxx | 14 +- Source/cmCacheManager.cxx | 28 +-- Source/cmCacheManager.h | 24 +- Source/cmCommandArgumentParserHelper.cxx | 7 +- Source/cmCommonTargetGenerator.cxx | 14 +- Source/cmCommonTargetGenerator.h | 4 +- Source/cmComputeLinkDepends.cxx | 6 +- Source/cmComputeLinkInformation.cxx | 37 +-- Source/cmComputeLinkInformation.h | 4 +- Source/cmComputeTargetDepends.cxx | 4 +- Source/cmConditionEvaluator.cxx | 38 ++-- Source/cmConditionEvaluator.h | 6 +- Source/cmCoreTryCompile.cxx | 30 +-- Source/cmCustomCommandGenerator.cxx | 4 +- Source/cmDefinitions.cxx | 6 +- Source/cmDefinitions.h | 4 +- Source/cmDepends.cxx | 4 +- Source/cmDependsC.cxx | 6 +- Source/cmDependsFortran.cxx | 4 +- Source/cmExportBuildFileGenerator.cxx | 2 +- Source/cmExportFileGenerator.cxx | 30 +-- Source/cmExportInstallFileGenerator.cxx | 2 +- Source/cmExportLibraryDependenciesCommand.cxx | 4 +- Source/cmExportTryCompileFileGenerator.cxx | 4 +- Source/cmExtraCodeBlocksGenerator.cxx | 6 +- Source/cmExtraEclipseCDT4Generator.cxx | 16 +- Source/cmExtraKateGenerator.cxx | 4 +- Source/cmExtraSublimeTextGenerator.cxx | 14 +- Source/cmFileAPICache.cxx | 4 +- Source/cmFileAPICodemodel.cxx | 18 +- Source/cmFileAPIToolchains.cxx | 4 +- Source/cmFileCommand.cxx | 10 +- Source/cmFileCopier.cxx | 4 +- Source/cmFindBase.cxx | 6 +- Source/cmFindCommon.cxx | 14 +- Source/cmFindLibraryCommand.cxx | 8 +- Source/cmFindPackageCommand.cxx | 22 +- Source/cmForEachCommand.cxx | 2 +- Source/cmGeneratorExpressionNode.cxx | 21 +- Source/cmGeneratorTarget.cxx | 251 +++++++++++---------- Source/cmGeneratorTarget.h | 34 +-- Source/cmGetCMakePropertyCommand.cxx | 8 +- Source/cmGetDirectoryPropertyCommand.cxx | 6 +- Source/cmGetFilenameComponentCommand.cxx | 4 +- Source/cmGetPropertyCommand.cxx | 7 +- Source/cmGetSourceFilePropertyCommand.cxx | 4 +- Source/cmGetTargetPropertyCommand.cxx | 4 +- Source/cmGetTestPropertyCommand.cxx | 4 +- Source/cmGhsMultiTargetGenerator.cxx | 10 +- Source/cmGlobalCommonGenerator.cxx | 6 +- Source/cmGlobalGenerator.cxx | 46 ++-- Source/cmGlobalGenerator.h | 6 +- Source/cmGlobalGhsMultiGenerator.cxx | 26 +-- Source/cmGlobalJOMMakefileGenerator.cxx | 2 +- Source/cmGlobalJOMMakefileGenerator.h | 2 +- Source/cmGlobalNMakeMakefileGenerator.cxx | 4 +- Source/cmGlobalNMakeMakefileGenerator.h | 2 +- Source/cmGlobalNinjaGenerator.cxx | 4 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 +- Source/cmGlobalVisualStudio14Generator.cxx | 2 +- Source/cmGlobalVisualStudio71Generator.cxx | 8 +- Source/cmGlobalVisualStudio71Generator.h | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 20 +- Source/cmGlobalVisualStudio7Generator.h | 4 +- Source/cmGlobalVisualStudio8Generator.cxx | 8 +- Source/cmGlobalVisualStudioGenerator.cxx | 4 +- Source/cmGlobalVisualStudioGenerator.h | 2 +- Source/cmGlobalXCodeGenerator.cxx | 58 ++--- Source/cmGlobalXCodeGenerator.h | 2 +- Source/cmGraphVizWriter.cxx | 6 +- Source/cmIncludeGuardCommand.cxx | 2 +- Source/cmInstallCommand.cxx | 4 +- Source/cmInstallTargetGenerator.cxx | 6 +- Source/cmLinkLineDeviceComputer.cxx | 4 +- Source/cmListCommand.cxx | 4 +- Source/cmLocalCommonGenerator.cxx | 4 +- Source/cmLocalGenerator.cxx | 163 ++++++------- Source/cmLocalGenerator.h | 20 +- Source/cmLocalNinjaGenerator.cxx | 8 +- Source/cmLocalUnixMakefileGenerator3.cxx | 30 +-- Source/cmLocalVisualStudio7Generator.cxx | 42 ++-- Source/cmLocalVisualStudioGenerator.cxx | 3 +- Source/cmMakefile.cxx | 81 +++---- Source/cmMakefile.h | 14 +- Source/cmMakefileExecutableTargetGenerator.cxx | 12 +- Source/cmMakefileLibraryTargetGenerator.cxx | 12 +- Source/cmMakefileTargetGenerator.cxx | 71 +++--- Source/cmMarkAsAdvancedCommand.cxx | 2 +- Source/cmNinjaNormalTargetGenerator.cxx | 26 +-- Source/cmNinjaTargetGenerator.cxx | 54 ++--- Source/cmNinjaUtilityTargetGenerator.cxx | 4 +- Source/cmOptionCommand.cxx | 4 +- Source/cmOutputRequiredFilesCommand.cxx | 4 +- Source/cmParseArgumentsCommand.cxx | 4 +- Source/cmPolicies.cxx | 2 +- Source/cmProjectCommand.cxx | 6 +- Source/cmProperty.cxx | 113 ---------- Source/cmProperty.h | 209 ----------------- Source/cmPropertyMap.cxx | 6 +- Source/cmPropertyMap.h | 8 +- Source/cmQtAutoGenGlobalInitializer.cxx | 4 +- Source/cmQtAutoGenInitializer.cxx | 12 +- Source/cmRemoveCommand.cxx | 4 +- Source/cmSearchPath.cxx | 8 +- Source/cmSeparateArgumentsCommand.cxx | 4 +- Source/cmSetCommand.cxx | 4 +- Source/cmSetPropertyCommand.cxx | 5 +- Source/cmSiteNameCommand.cxx | 6 +- Source/cmSourceFile.cxx | 29 +-- Source/cmSourceFile.h | 10 +- Source/cmStandardLevelResolver.cxx | 30 +-- Source/cmStandardLevelResolver.h | 8 +- Source/cmState.cxx | 36 +-- Source/cmState.h | 19 +- Source/cmStateDirectory.cxx | 40 ++-- Source/cmStateDirectory.h | 8 +- Source/cmStateSnapshot.cxx | 6 +- Source/cmStateSnapshot.h | 4 +- Source/cmStringAlgorithms.h | 36 +-- Source/cmStringCommand.cxx | 4 +- Source/cmTarget.cxx | 99 ++++---- Source/cmTarget.h | 16 +- Source/cmTargetLinkLibrariesCommand.cxx | 4 +- Source/cmTargetPropCommandBase.cxx | 4 +- Source/cmTargetPropertyComputer.h | 26 +-- Source/cmTest.cxx | 9 +- Source/cmTest.h | 8 +- Source/cmTestGenerator.cxx | 4 +- Source/cmTryRunCommand.cxx | 8 +- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmValue.cxx | 113 ++++++++++ Source/cmValue.h | 214 ++++++++++++++++++ Source/cmVariableRequiresCommand.cxx | 4 +- Source/cmVariableWatchCommand.cxx | 4 +- Source/cmVisualStudio10TargetGenerator.cxx | 182 +++++++-------- Source/cmXCodeScheme.cxx | 8 +- Source/cmake.cxx | 56 ++--- Source/cmake.h | 16 +- Source/cmakemain.cxx | 6 +- bootstrap | 2 +- 189 files changed, 1867 insertions(+), 1839 deletions(-) delete mode 100644 Source/cmProperty.cxx create mode 100644 Source/cmValue.cxx create mode 100644 Source/cmValue.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 8dc44a0..c8498a9 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -381,7 +381,8 @@ set(SRCS cmProcessOutput.h cmProcessTools.cxx cmProcessTools.h - cmProperty.cxx + cmValue.cxx + cmValue.h cmProperty.h cmPropertyDefinition.cxx cmPropertyDefinition.h diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx index c7ab994..f6b8a8a 100644 --- a/Source/CPack/IFW/cmCPackIFWCommon.cxx +++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx @@ -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; diff --git a/Source/CPack/IFW/cmCPackIFWCommon.h b/Source/CPack/IFW/cmCPackIFWCommon.h index cf243dc..f2e6b88 100644 --- a/Source/CPack/IFW/cmCPackIFWCommon.h +++ b/Source/CPack/IFW/cmCPackIFWCommon.h @@ -7,7 +7,7 @@ #include #include -#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; diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 0e2aec0..b375ba6 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -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 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); diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 23b73ff..7ee6300 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -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"; diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index c1e11d2..c2109c9 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -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 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 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); } diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index cc64e93..f25d2d2 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -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(); diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index e127c44..d03239b 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -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 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 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 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; diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 4f90ba2..56e8463 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -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 '/' diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index d93ddb8..b3d425a 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -6,9 +6,9 @@ #include #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 relFiles = cmExpandedList(sign_files); diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx index 1de5e1c..484db00 100644 --- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx +++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx @@ -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, diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index 684a988..59df380 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -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" diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 91b6c12..0686957 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -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 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 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 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 controlValues, - bool genShLibs, std::string shLibsFilename, - bool genPostInst, std::string postInst, - bool genPostRm, std::string postRm, - cmProp controlExtra, bool permissionStrictPolicy, - std::vector 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 controlValues, bool genShLibs, + std::string shLibsFilename, bool genPostInst, std::string postInst, + bool genPostRm, std::string postRm, cmValue controlExtra, + bool permissionStrictPolicy, std::vector 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; } diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 36ab414..9385a5a 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -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; diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index 9cdaafe..157ee1d 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -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; diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx index 39ec3c8..30b6b0d 100644 --- a/Source/CPack/cmCPackFreeBSDGenerator.cxx +++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx @@ -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(); } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 43efcf4..2f700b4 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -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 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 ignoreFilesRegex; - cmProp cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES"); + cmValue cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES"); if (cpackIgnoreFiles) { std::vector 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 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 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 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 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 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 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); diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index e63a830..65156ab 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -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 GetOptions() const; bool IsSet(const std::string& name) const; bool IsOn(const std::string& name) const; diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index f151ff1..ecc5e08 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -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 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"; } diff --git a/Source/CPack/cmCPackNuGetGenerator.cxx b/Source/CPack/cmCPackNuGetGenerator.cxx index c268f27..5de8179 100644 --- a/Source/CPack/cmCPackNuGetGenerator.cxx +++ b/Source/CPack/cmCPackNuGetGenerator.cxx @@ -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, diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 8291752..7bf1dc7 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -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)) { diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 171fbb2..91adf32 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -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() diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 2915616..a8cf1fa 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -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; diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 614b538..f55b8de 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -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 + "_"; diff --git a/Source/CPack/cmCPackProductBuildGenerator.h b/Source/CPack/cmCPackProductBuildGenerator.h index 8f169b0..31cfafa 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.h +++ b/Source/CPack/cmCPackProductBuildGenerator.h @@ -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); }; diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 47db5bb..9e50700 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -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")) { diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 4b34c08..1340fb5 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -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") diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index a778939..54fd358 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -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 << "." diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index 483c316..6e7c9e1 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -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); diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 03caa63..f9c4a8e 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -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); diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index db9923e..fd20398 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -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); diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index dc7103a..9800192 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -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 cmCTestGenericHandler::GetMultiOption( diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 852d4ea..b4b0ad8 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -11,8 +11,8 @@ #include #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 diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 731932e..ea8feaa 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -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 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 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); } diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index d2cad39..f685f66 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -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(); diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index a8c2403..84d12d7 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -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 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 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 = diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 6824752..c4f87e9 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -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 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 notesFiles = cmExpandedList(*notesFilesVariable); this->CTest->GenerateNotesFile(notesFiles); } - cmProp extraFilesVariable = + cmValue extraFilesVariable = this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES"); if (extraFilesVariable) { std::vector extraFiles = cmExpandedList(*extraFilesVariable); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 9322bd5..b99bb79 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -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); } diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 80b8d4f..5488388 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -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); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index c41b661..6e97a83 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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; diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 585a336..3ac05e7 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -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(); diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 7c7c380..d448c76 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -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(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" diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 35f09fd..e9ec09e 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -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(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(this->EntryWidth, 1, 1, 1); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 069c02e..b28c5b7 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -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 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( 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( diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 41e8a55..8ab8656 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -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(";"); diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 56b080a..415a124 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -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 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) || diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index f9b8f8f..20d6089 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -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 const& args, cmExecutionStatus& status) @@ -20,7 +20,7 @@ bool cmBuildNameCommand(std::vector 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("[()/]"); diff --git a/Source/cmCMakePathCommand.cxx b/Source/cmCMakePathCommand.cxx index 9a5fa7b..bf94c2d 100644 --- a/Source/cmCMakePathCommand.cxx +++ b/Source/cmCMakePathCommand.cxx @@ -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; diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index b2830e2..ebf639b 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -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 const& args, diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 7c469c8..bc6abb5 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -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& 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; } diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 17369c8..b9d1f66 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -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 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); } diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index eca7150..bc3fb51 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -11,9 +11,9 @@ #include #include -#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 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); diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 415f0c0..2ed04e5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -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) { diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 4e7f50d..8d5ce7e 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -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 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 diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index 463a445..baa36c9 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -8,7 +8,7 @@ #include #include -#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, diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 15a12ba..370ddff 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -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 _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") { diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index eda0722..a3e346c 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -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 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 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 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 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 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& 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& 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); } } diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index c3ae345..90a699e 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -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; diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 5d3e04f..d85dea3 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -17,7 +17,6 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmSourceFile.h" #include "cmSourceFileLocationKind.h" @@ -27,6 +26,7 @@ #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" +#include "cmValue.h" #include "cmake.h" /* @@ -469,7 +469,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); diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 1d7696d..913b532 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -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); diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 00d896b..37b7825 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -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; diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0c85d28..02d559b 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -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 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 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 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 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 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 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 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 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 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 varList = cmExpandedList(*varListStr); vars.insert(varList.begin(), varList.end()); @@ -799,7 +799,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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 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 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 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)) { diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 5a2683b..04d09d4 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -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; diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 9e2d7b9..a5f8aab 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -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, diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index ee1db7a..22fef80 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -12,8 +12,8 @@ #include #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); diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 46c7e3e..eca1abd 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -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 { diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index da37d45..2527809 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -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; } } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 6024cf6..8456776 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -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; } diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 6e3f918..aa968dc 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -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; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 8b06a15..8ca9a66 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -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& 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& 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. diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 46d2d31..e9ac875 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -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) diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 7f31dd2..8aec12b 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -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; } } diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index f89d0ad..cbe3c4d 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -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& targets, @@ -60,7 +60,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets( const std::string& propName, cmGeneratorTarget const* tgt, std::string const& language, std::set& emitted) { - cmProp prop = tgt->GetProperty(propName); + cmValue prop = tgt->GetProperty(propName); if (!prop) { return std::string(); } diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index df14261..9ad8876 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -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; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 672089c..d9d5a4b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -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/=" << *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 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 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; } diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 9153119..eec43c4 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -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) { diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 52965bb..fa93b04 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -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) { diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx index ddae527..ba38ef7 100644 --- a/Source/cmFileAPICache.cxx +++ b/Source/cmFileAPICache.cxx @@ -10,8 +10,8 @@ #include #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; } diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index adeba74..147181e 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -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 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; } diff --git a/Source/cmFileAPIToolchains.cxx b/Source/cmFileAPIToolchains.cxx index 722c114..b3540c9 100644 --- a/Source/cmFileAPIToolchains.cxx +++ b/Source/cmFileAPIToolchains.cxx @@ -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; } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index bdfec02..4eb632d 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -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 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 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 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 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; diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx index 48fc286..00254a0 100644 --- a/Source/cmFileCopier.cxx +++ b/Source/cmFileCopier.cxx @@ -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 items = diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 37f9572..a123e44 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -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) diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index d2f9619..bdc9207 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -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& 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& 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 unrootedPaths = paths; diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index ef960d1..bfa007c 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -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 const& argsIn) // add custom lib 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; } } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index a0de74c..335ebbe 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -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 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 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 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 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 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 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 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 notFoundContents; - cmProp notFoundProp = + cmValue notFoundProp = this->Makefile->GetState()->GetGlobalProperty("PACKAGES_NOT_FOUND"); if (cmNonempty(notFoundProp)) { cmExpandList(*notFoundProp, notFoundContents, false); diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index b44f797..dcb3626 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -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 diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 4e06a07..c357ee1 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -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 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 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 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; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f80b4d9..ef1f871 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -58,7 +58,7 @@ const cmsys::RegularExpression FrameworkRegularExpression( } template <> -cmProp cmTargetPropertyComputer::GetSources( +cmValue cmTargetPropertyComputer::GetSources( 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 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& 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 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 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 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> 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> 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> cmGeneratorTarget::GetStaticLibraryLinkOptions( nullptr, nullptr); EvaluatedTargetPropertyEntries entries; - if (cmProp linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { + if (cmValue linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { std::vector options = cmExpandedList(*linkOptions); for (const auto& option : options) { std::unique_ptr entry = @@ -4704,7 +4706,7 @@ std::vector> cmGeneratorTarget::GetLinkDepends( nullptr); EvaluatedTargetPropertyEntries entries; - if (cmProp linkDepends = this->GetProperty("LINK_DEPENDS")) { + if (cmValue linkDepends = this->GetProperty("LINK_DEPENDS")) { std::vector depends = cmExpandedList(*linkDepends); for (const auto& depend : depends) { std::unique_ptr 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(*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 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 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 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 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 value) return value; } template <> -std::string valueAsString(cmProp value) +std::string valueAsString(cmValue value) { return value ? value : std::string("(unset)"); } @@ -5730,7 +5732,7 @@ bool getTypedProperty(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( 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( 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 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 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 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); } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 85b4ea0..e9ce962 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -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 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 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> 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; diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 79cbe44..42bd206 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -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 const& args, @@ -24,12 +24,12 @@ bool cmGetCMakePropertyCommand(std::vector 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 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]); } diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index d98f95c..d892cfa 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -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); } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 40e8a05..abe7d32 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -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 const& args, @@ -22,7 +22,7 @@ bool cmGetFilenameComponentCommand(std::vector 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; } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 5f20075..162860a 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -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); diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx index 5301b66..40ae112 100644 --- a/Source/cmGetSourceFilePropertyCommand.cxx +++ b/Source/cmGetSourceFilePropertyCommand.cxx @@ -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 const& args, cmExecutionStatus& status) @@ -58,7 +58,7 @@ bool cmGetSourceFilePropertyCommand(std::vector const& args, } if (sf) { - cmProp prop = nullptr; + cmValue prop = nullptr; if (!args[property_arg_index].empty()) { prop = sf->GetPropertyForUser(args[property_arg_index]); } diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index 78a17d2..9c5a2fc 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -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 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); diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx index 077353e..a4ac9f6 100644 --- a/Source/cmGetTestPropertyCommand.cxx +++ b/Source/cmGetTestPropertyCommand.cxx @@ -4,8 +4,8 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmTest.h" +#include "cmValue.h" bool cmGetTestPropertyCommand(std::vector const& args, cmExecutionStatus& status) @@ -20,7 +20,7 @@ bool cmGetTestPropertyCommand(std::vector const& args, cmMakefile& mf = status.GetMakefile(); cmTest* test = mf.GetTest(testName); if (test) { - cmProp prop; + cmValue prop; if (!args[1].empty()) { prop = test->GetProperty(args[1]); } diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 12fd9c4..47cefae 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -19,7 +19,6 @@ #include "cmLocalGhsMultiGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmSourceGroup.h" @@ -29,6 +28,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target) : GeneratorTarget(target) @@ -43,7 +43,7 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target) #endif { // Store the configuration name that is being used - if (cmProp config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) { + if (cmValue config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) { // Use the build type given by the user. this->ConfigName = *config; } else { @@ -453,7 +453,7 @@ void cmGhsMultiTargetGenerator::WriteSourceProperty( std::ostream& fout, const cmSourceFile* sf, std::string const& propName, std::string const& propFlag) { - cmProp prop = sf->GetProperty(propName); + cmValue prop = sf->GetProperty(propName); if (prop) { std::vector list = cmExpandedList(*prop); for (const std::string& p : list) { @@ -705,7 +705,7 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandLine( void cmGhsMultiTargetGenerator::WriteObjectLangOverride( std::ostream& fout, const cmSourceFile* sourceFile) { - cmProp rawLangProp = sourceFile->GetProperty("LANGUAGE"); + cmValue rawLangProp = sourceFile->GetProperty("LANGUAGE"); if (rawLangProp) { std::string sourceLangProp(*rawLangProp); std::string const& extension = sourceFile->GetExtension(); @@ -717,7 +717,7 @@ void cmGhsMultiTargetGenerator::WriteObjectLangOverride( bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp() { - if (cmProp p = this->GeneratorTarget->GetProperty("ghs_integrity_app")) { + if (cmValue p = this->GeneratorTarget->GetProperty("ghs_integrity_app")) { return cmIsOn(*p); } std::vector sources; diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx index 24c8944..31ff52f 100644 --- a/Source/cmGlobalCommonGenerator.cxx +++ b/Source/cmGlobalCommonGenerator.cxx @@ -11,12 +11,12 @@ #include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" cmGlobalCommonGenerator::cmGlobalCommonGenerator(cmake* cm) @@ -48,7 +48,7 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const DirectoryTarget::Target t; t.GT = gt.get(); const std::string EXCLUDE_FROM_ALL("EXCLUDE_FROM_ALL"); - if (cmProp exclude = gt->GetProperty(EXCLUDE_FROM_ALL)) { + if (cmValue exclude = gt->GetProperty(EXCLUDE_FROM_ALL)) { for (const std::string& config : configs) { cmGeneratorExpressionInterpreter genexInterpreter(lg.get(), config, gt.get()); @@ -122,6 +122,6 @@ std::string cmGlobalCommonGenerator::GetEditCacheCommand() const cmStateEnums::INTERNAL); } } - cmProp edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); + cmValue edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); return edit_cmd ? *edit_cmd : std::string(); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1c3d2c2..981308e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -44,12 +44,12 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStateTypes.h" +#include "cmValue.h" #include "cmVersion.h" #include "cmWorkingDirectory.h" #include "cmake.h" @@ -199,7 +199,7 @@ std::string cmGlobalGenerator::SelectMakeProgram( { std::string makeProgram = inMakeProgram; if (cmIsOff(makeProgram)) { - cmProp makeProgramCSTR = + cmValue makeProgramCSTR = this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); if (cmIsOff(makeProgramCSTR)) { makeProgram = makeDefault; @@ -235,14 +235,14 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang, if (!optional && (path.empty() || !cmSystemTools::FileExists(path))) { return; } - cmProp cname = + cmValue cname = this->GetCMakeInstance()->GetState()->GetInitializedCacheValue(langComp); // Split compiler from arguments std::vector cnameArgVec; if (cname && !cname->empty()) { cmExpandList(*cname, cnameArgVec); - cname = cmProp(cnameArgVec.front()); + cname = cmValue(cnameArgVec.front()); } std::string changeVars; @@ -258,7 +258,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang, cmSystemTools::ConvertToUnixSlashes(cnameString); cmSystemTools::ConvertToUnixSlashes(pathString); if (cnameString != pathString) { - cmProp cvars = this->GetCMakeInstance()->GetState()->GetGlobalProperty( + cmValue cvars = this->GetCMakeInstance()->GetState()->GetGlobalProperty( "__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if (cvars) { changeVars += *cvars; @@ -801,7 +801,7 @@ void cmGlobalGenerator::EnableLanguage( std::string compilerName = cmStrCat("CMAKE_", lang, "_COMPILER"); std::string compilerEnv = cmStrCat("CMAKE_", lang, "_COMPILER_ENV_VAR"); std::ostringstream noCompiler; - cmProp compilerFile = mf->GetDefinition(compilerName); + cmValue compilerFile = mf->GetDefinition(compilerName); if (!cmNonempty(compilerFile) || cmIsNOTFOUND(*compilerFile)) { /* clang-format off */ noCompiler << @@ -922,7 +922,7 @@ void cmGlobalGenerator::EnableLanguage( void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os, std::string const& lang, - cmProp envVar) const + cmValue envVar) const { // Subclasses override this method if they do not support this advice. os << "Tell CMake where to find the compiler by setting "; @@ -1117,7 +1117,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, } std::string linkerPrefVar = "CMAKE_" + l + "_LINKER_PREFERENCE"; - cmProp linkerPref = mf->GetDefinition(linkerPrefVar); + cmValue linkerPref = mf->GetDefinition(linkerPrefVar); int preference = 0; if (cmNonempty(linkerPref)) { if (sscanf(linkerPref->c_str(), "%d", &preference) != 1) { @@ -1143,7 +1143,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, this->LanguageToLinkerPreference[l] = preference; std::string outputExtensionVar = "CMAKE_" + l + "_OUTPUT_EXTENSION"; - if (cmProp p = mf->GetDefinition(outputExtensionVar)) { + if (cmValue p = mf->GetDefinition(outputExtensionVar)) { std::string outputExtension = *p; this->LanguageToOutputExtension[l] = outputExtension; this->OutputExtensions[outputExtension] = outputExtension; @@ -1179,7 +1179,7 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l, } } -cmProp cmGlobalGenerator::GetGlobalSetting(std::string const& name) const +cmValue cmGlobalGenerator::GetGlobalSetting(std::string const& name) const { assert(!this->Makefiles.empty()); return this->Makefiles[0]->GetDefinition(name); @@ -1746,7 +1746,7 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() for (std::string const& c : configs) { std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(c)); - if (cmProp val = mf->GetProperty(defPropName)) { + if (cmValue val = mf->GetProperty(defPropName)) { t->AppendProperty(defPropName, *val); } } @@ -1860,7 +1860,7 @@ void cmGlobalGenerator::CheckTargetProperties() } } std::vector incs; - cmProp incDirProp = target.second.GetProperty("INCLUDE_DIRECTORIES"); + cmValue incDirProp = target.second.GetProperty("INCLUDE_DIRECTORIES"); if (!incDirProp) { continue; } @@ -2124,7 +2124,7 @@ void cmGlobalGenerator::AddMakefile(std::unique_ptr mf) // update progress // estimate how many lg there will be - cmProp numGenC = this->CMakeInstance->GetState()->GetInitializedCacheValue( + cmValue numGenC = this->CMakeInstance->GetState()->GetInitializedCacheValue( "CMAKE_NUMBER_OF_MAKEFILES"); if (!numGenC) { @@ -2183,7 +2183,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator* gen, { this->SetConfiguredFilesPath(gen); this->TryCompileOuterMakefile = mf; - cmProp make = + cmValue make = gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry( "CMAKE_MAKE_PROGRAM", make, "make program", cmStateEnums::FILEPATH); @@ -2246,7 +2246,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, } cmMakefile* mf = root->GetMakefile(); const std::string EXCLUDE_FROM_ALL = "EXCLUDE_FROM_ALL"; - if (cmProp exclude = target->GetProperty(EXCLUDE_FROM_ALL)) { + if (cmValue exclude = target->GetProperty(EXCLUDE_FROM_ALL)) { // Expand the property value per configuration. unsigned int trueCount = 0; unsigned int falseCount = 0; @@ -2540,7 +2540,7 @@ void cmGlobalGenerator::AddGlobalTarget_Package( if (this->GetPreinstallTargetName()) { gti.Depends.emplace_back(this->GetPreinstallTargetName()); } else { - cmProp noPackageAll = + cmValue noPackageAll = mf->GetDefinition("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY"); if (cmIsOff(noPackageAll)) { gti.Depends.emplace_back(this->GetAllTargetName()); @@ -2721,7 +2721,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install( if (this->GetPreinstallTargetName()) { gti.Depends.emplace_back(this->GetPreinstallTargetName()); } else { - cmProp noall = mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"); + cmValue noall = mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"); if (cmIsOff(noall)) { gti.Depends.emplace_back(this->GetAllTargetName()); } @@ -2787,7 +2787,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install( std::string cmGlobalGenerator::GetPredefinedTargetsFolder() const { - cmProp prop = this->GetCMakeInstance()->GetState()->GetGlobalProperty( + cmValue prop = this->GetCMakeInstance()->GetState()->GetGlobalProperty( "PREDEFINED_TARGETS_FOLDER"); if (prop) { @@ -2799,7 +2799,7 @@ std::string cmGlobalGenerator::GetPredefinedTargetsFolder() const bool cmGlobalGenerator::UseFolderProperty() const { - cmProp prop = + cmValue prop = this->GetCMakeInstance()->GetState()->GetGlobalProperty("USE_FOLDERS"); // If this property is defined, let the setter turn this on or off... @@ -3150,10 +3150,10 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) #ifndef CMAKE_BOOTSTRAP // Check whether labels are enabled for this target. - cmProp targetLabels = target->GetProperty("LABELS"); - cmProp directoryLabels = + cmValue targetLabels = target->GetProperty("LABELS"); + cmValue directoryLabels = target->Target->GetMakefile()->GetProperty("LABELS"); - cmProp cmakeDirectoryLabels = + cmValue cmakeDirectoryLabels = target->Target->GetMakefile()->GetDefinition("CMAKE_DIRECTORY_LABELS"); if (targetLabels || directoryLabels || cmakeDirectoryLabels) { Json::Value lj_root(Json::objectValue); @@ -3221,7 +3221,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) std::string const& sfp = sf->ResolveFullPath(); fout << sfp << "\n"; lj_source["file"] = sfp; - if (cmProp svalue = sf->GetProperty("LABELS")) { + if (cmValue svalue = sf->GetProperty("LABELS")) { labels.clear(); Json::Value& lj_source_labels = lj_source["labels"] = Json::arrayValue; cmExpandList(*svalue, labels); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 49a1a26..23c5700 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -23,13 +23,13 @@ #include "cmCustomCommandLines.h" #include "cmDuration.h" #include "cmExportSet.h" -#include "cmProperty.h" #include "cmStateSnapshot.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" #include "cmTransformDepfile.h" +#include "cmValue.h" #if !defined(CMAKE_BOOTSTRAP) # include @@ -309,7 +309,7 @@ public: cmExportSetMap& GetExportSets() { return this->ExportSets; } - cmProp GetGlobalSetting(std::string const& name) const; + cmValue GetGlobalSetting(std::string const& name) const; bool GlobalSettingIsOn(std::string const& name) const; std::string GetSafeGlobalSetting(std::string const& name) const; @@ -550,7 +550,7 @@ protected: virtual bool CheckLanguages(std::vector const& languages, cmMakefile* mf) const; virtual void PrintCompilerAdvice(std::ostream& os, std::string const& lang, - cmProp envVar) const; + cmValue envVar) const; virtual bool ComputeTargetDepends(); diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index b81f82e..b1c0488 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -18,11 +18,11 @@ #include "cmLocalGenerator.h" #include "cmLocalGhsMultiGenerator.h" #include "cmMakefile.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" @@ -99,7 +99,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts, /* set the build tool to use */ std::string gbuild(tsp + ((tsp.back() == '/') ? "" : "/") + DEFAULT_BUILD_PROGRAM); - cmProp prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM"); + cmValue prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM"); /* check if the toolset changed from last generate */ if (prevTool && (gbuild != *prevTool)) { @@ -215,7 +215,7 @@ bool cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile* /*mf*/) void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd, const std::string& ts) { - cmProp ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT"); + cmValue ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT"); if (cmNonempty(ghsRoot)) { tsd = *ghsRoot; @@ -333,7 +333,7 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout, fout << "# Top Level Project File\n"; // Specify BSP option if supplied by user - cmProp bspName = + cmValue bspName = this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME"); if (!cmIsOff(bspName)) { fout << " -bsp " << *bspName << '\n'; @@ -342,7 +342,7 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout, // Specify OS DIR if supplied by user // -- not all platforms require this entry in the project file if (!cmIsOff(this->OsDir)) { - cmProp osDirOption = + cmValue osDirOption = this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION"); std::replace(this->OsDir.begin(), this->OsDir.end(), '\\', '/'); fout << " "; @@ -377,8 +377,8 @@ void cmGlobalGhsMultiGenerator::WriteProjectLine( std::ostream& fout, cmGeneratorTarget const* target, std::string& rootBinaryDir) { - cmProp projName = target->GetProperty("GENERATOR_FILE_NAME"); - cmProp projType = target->GetProperty("GENERATOR_FILE_NAME_EXT"); + cmValue projName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue projType = target->GetProperty("GENERATOR_FILE_NAME_EXT"); if (projName && projType) { cmLocalGenerator* lg = target->GetLocalGenerator(); std::string dir = lg->GetCurrentBinaryDirectory(); @@ -563,7 +563,7 @@ cmGlobalGhsMultiGenerator::GenerateBuildCommand( { GeneratedMakeCommand makeCommand = {}; std::string gbuild; - if (cmProp gbuildCached = + if (cmValue gbuildCached = this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM")) { gbuild = *gbuildCached; } @@ -616,7 +616,7 @@ void cmGlobalGhsMultiGenerator::WriteMacros(std::ostream& fout, cmLocalGenerator* root) { fout << "macro PROJ_NAME=" << root->GetProjectName() << '\n'; - cmProp ghsGpjMacros = + cmValue ghsGpjMacros = this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS"); if (ghsGpjMacros) { std::vector expandedList = cmExpandedList(*ghsGpjMacros); @@ -631,15 +631,15 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives( { /* set primary target */ std::string tgt; - cmProp t = + cmValue t = this->GetCMakeInstance()->GetCacheDefinition("GHS_PRIMARY_TARGET"); if (cmNonempty(t)) { tgt = *t; this->GetCMakeInstance()->MarkCliAsUsed("GHS_PRIMARY_TARGET"); } else { - cmProp a = + cmValue a = this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM"); - cmProp p = + cmValue p = this->GetCMakeInstance()->GetCacheDefinition("GHS_TARGET_PLATFORM"); tgt = cmStrCat((a ? *a : ""), '_', (p ? *p : ""), ".tgt"); } @@ -652,7 +652,7 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives( << "/CMakeFiles/custom_target.bod" << '\n'; /* clang-format on */ - cmProp const customization = + cmValue const customization = this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION"); if (cmNonempty(customization)) { fout << "customization=" diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index 0d474e5..40deebb 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -41,7 +41,7 @@ void cmGlobalJOMMakefileGenerator::GetDocumentation( void cmGlobalJOMMakefileGenerator::PrintCompilerAdvice(std::ostream& os, std::string const& lang, - cmProp envVar) const + cmValue envVar) const { if (lang == "CXX" || lang == "C") { /* clang-format off */ diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index cc581df..58860dd 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -50,5 +50,5 @@ protected: private: void PrintCompilerAdvice(std::ostream& os, std::string const& lang, - cmProp envVar) const override; + cmValue envVar) const override; }; diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 2bc668c..a038f87 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -42,7 +42,7 @@ bool cmGlobalNMakeMakefileGenerator::FindMakeProgram(cmMakefile* mf) if (!this->cmGlobalGenerator::FindMakeProgram(mf)) { return false; } - if (cmProp nmakeCommand = mf->GetDefinition("CMAKE_MAKE_PROGRAM")) { + if (cmValue nmakeCommand = mf->GetDefinition("CMAKE_MAKE_PROGRAM")) { std::vector command{ *nmakeCommand, "-?" }; std::string out; std::string err; @@ -81,7 +81,7 @@ void cmGlobalNMakeMakefileGenerator::GetDocumentation( } void cmGlobalNMakeMakefileGenerator::PrintCompilerAdvice( - std::ostream& os, std::string const& lang, cmProp envVar) const + std::ostream& os, std::string const& lang, cmValue envVar) const { if (lang == "CXX" || lang == "C") { /* clang-format off */ diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index a48a55e..4f202b5 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -61,5 +61,5 @@ private: void CheckNMakeFeatures(); void PrintCompilerAdvice(std::ostream& os, std::string const& lang, - cmProp envVar) const override; + cmValue envVar) const override; }; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 768c045..5c3198e 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -35,7 +35,6 @@ #include "cmMessageType.h" #include "cmNinjaLinkLineComputer.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmScanDepFormat.h" #include "cmState.h" @@ -46,6 +45,7 @@ #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" +#include "cmValue.h" #include "cmVersion.h" #include "cmake.h" @@ -694,7 +694,7 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf) if (!this->cmGlobalGenerator::FindMakeProgram(mf)) { return false; } - if (cmProp ninjaCommand = mf->GetDefinition("CMAKE_MAKE_PROGRAM")) { + if (cmValue ninjaCommand = mf->GetDefinition("CMAKE_MAKE_PROGRAM")) { this->NinjaCommand = *ninjaCommand; std::vector command; command.push_back(this->NinjaCommand); diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index d9f94a1..0556540 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -20,12 +20,12 @@ #include "cmMakefile.h" #include "cmMakefileTargetGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTargetDepend.h" +#include "cmValue.h" #include "cmake.h" cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) @@ -684,7 +684,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( } bool targetMessages = true; - if (cmProp tgtMsg = + if (cmValue tgtMsg = this->GetCMakeInstance()->GetState()->GetGlobalProperty( "TARGET_MESSAGES")) { targetMessages = cmIsOn(*tgtMsg); diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index b46f1b9..ff1642f 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -239,7 +239,7 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion( { // if the given value is set, it can either be OFF/FALSE or a valid SDK // string - if (cmProp value = mf->GetDefinition( + if (cmValue value = mf->GetDefinition( "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM")) { // If the value is some off/false value, then there is NO maximum set. diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 21ea7e6..50975ff 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -102,7 +102,7 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, ext = ".csproj"; project = "Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \""; } - cmProp targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT"); + cmValue targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT"); if (targetExt) { ext = *targetExt; } @@ -157,7 +157,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends( // executables to the libraries it uses are also done here void cmGlobalVisualStudio71Generator::WriteExternalProject( std::ostream& fout, const std::string& name, const std::string& location, - cmProp typeGuid, const std::set>>& depends) + cmValue typeGuid, const std::set>>& depends) { fout << "Project(\"{" << (typeGuid ? typeGuid @@ -198,8 +198,8 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations( std::vector mapConfig; const char* dstConfig = i.c_str(); if (target.GetProperty("EXTERNAL_MSPROJECT")) { - if (cmProp m = target.GetProperty("MAP_IMPORTED_CONFIG_" + - cmSystemTools::UpperCase(i))) { + if (cmValue m = target.GetProperty("MAP_IMPORTED_CONFIG_" + + cmSystemTools::UpperCase(i))) { cmExpandList(*m, mapConfig); if (!mapConfig.empty()) { dstConfig = mapConfig[0].c_str(); diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 30ebf08..cb3b8c1 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -33,7 +33,7 @@ protected: const std::string& platformMapping = "") override; void WriteExternalProject( std::ostream& fout, const std::string& name, const std::string& path, - cmProp typeGuid, + cmValue typeGuid, const std::set>>& depends) override; // Folders are not supported by VS 7.1. diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 2a142ae..9db654f 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -299,7 +299,7 @@ void cmGlobalVisualStudio7Generator::Generate() if (this->Version == VS10 && !this->CMakeInstance->GetIsInTryCompile()) { std::string cmakeWarnVS10; - if (cmProp cached = this->CMakeInstance->GetState()->GetCacheEntryValue( + if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue( "CMAKE_WARN_VS10")) { this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS10"); cmakeWarnVS10 = *cached; @@ -354,17 +354,17 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( if (!target->IsInBuildSystem()) { continue; } - cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT"); + cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT"); if (expath) { std::set allConfigurations(configs.begin(), configs.end()); - cmProp mapping = target->GetProperty("VS_PLATFORM_MAPPING"); + cmValue mapping = target->GetProperty("VS_PLATFORM_MAPPING"); this->WriteProjectConfigurations(fout, target->GetName(), *target, configs, allConfigurations, mapping ? *mapping : ""); } else { const std::set& configsPartOfDefaultBuild = this->IsPartOfDefaultBuild(configs, projectTargets, target); - cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { this->WriteProjectConfigurations(fout, *vcprojName, *target, configs, configsPartOfDefaultBuild); @@ -386,7 +386,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( bool written = false; // handle external vc project files - cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT"); + cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT"); if (expath) { std::string project = target->GetName(); std::string location = *expath; @@ -396,7 +396,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( target->GetUtilities()); written = true; } else { - cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { cmLocalGenerator* lg = target->GetLocalGenerator(); std::string dir = lg->GetCurrentBinaryDirectory(); @@ -449,7 +449,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends( if (!target->IsInBuildSystem()) { continue; } - cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { std::string dir = target->GetLocalGenerator()->GetCurrentSourceDirectory(); @@ -537,7 +537,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections( extensibilityAddInsOverridden = true; } fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n"; - cmProp p = root->GetMakefile()->GetProperty(it); + cmValue p = root->GetMakefile()->GetProperty(it); std::vector keyValuePairs = cmExpandedList(p ? *p : ""); for (std::string const& itPair : keyValuePairs) { const std::string::size_type posEqual = itPair.find('='); @@ -636,7 +636,7 @@ std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend( std::string cmGlobalVisualStudio7Generator::GetGUID(std::string const& name) { std::string const& guidStoreName = name + "_GUID_CMAKE"; - if (cmProp storedGUID = + if (cmValue storedGUID = this->CMakeInstance->GetCacheDefinition(guidStoreName)) { return *storedGUID; } @@ -686,7 +686,7 @@ std::set cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( "CMAKE_VS_INCLUDE_" + t + "_TO_DEFAULT_BUILD"; // inspect CMAKE_VS_INCLUDE__TO_DEFAULT_BUILD properties for (std::string const& i : configs) { - cmProp propertyValue = + cmValue propertyValue = target->Target->GetMakefile()->GetDefinition(propertyName); if (propertyValue && cmIsOn(cmGeneratorExpression::Evaluate( diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 1e34792..8e762cf 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -6,7 +6,7 @@ #include "cmGlobalGeneratorFactory.h" #include "cmGlobalVisualStudioGenerator.h" -#include "cmProperty.h" +#include "cmValue.h" class cmTarget; struct cmIDEFlagTable; @@ -143,7 +143,7 @@ protected: virtual void WriteExternalProject( std::ostream& fout, const std::string& name, const std::string& path, - cmProp typeGuid, + cmValue typeGuid, const std::set>>& dependencies) = 0; std::string ConvertToSolutionPath(const std::string& path); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index b19212e..34bdc1c 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -245,8 +245,8 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations( std::vector mapConfig; const char* dstConfig = i.c_str(); if (target.GetProperty("EXTERNAL_MSPROJECT")) { - if (cmProp m = target.GetProperty("MAP_IMPORTED_CONFIG_" + - cmSystemTools::UpperCase(i))) { + if (cmValue m = target.GetProperty("MAP_IMPORTED_CONFIG_" + + cmSystemTools::UpperCase(i))) { cmExpandList(*m, mapConfig); if (!mapConfig.empty()) { dstConfig = mapConfig[0].c_str(); @@ -287,14 +287,14 @@ bool cmGlobalVisualStudio8Generator::NeedsDeploy( return false; } - if (cmProp prop = target.GetProperty("VS_SOLUTION_DEPLOY")) { + if (cmValue prop = target.GetProperty("VS_SOLUTION_DEPLOY")) { // If set, it dictates behavior return cmIsOn( cmGeneratorExpression::Evaluate(*prop, target.LocalGenerator, config)); } // To be deprecated, disable deployment even if target supports it. - if (cmProp prop = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) { + if (cmValue prop = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) { if (cmIsOn(cmGeneratorExpression::Evaluate(*prop, target.LocalGenerator, config))) { // If true, always disable deployment diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index cdecea0..f9bd67e 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -519,7 +519,7 @@ std::string cmGlobalVisualStudioGenerator::GetUtilityDepend( std::string cmGlobalVisualStudioGenerator::GetStartupProjectName( cmLocalGenerator const* root) const { - cmProp n = root->GetMakefile()->GetProperty("VS_STARTUP_PROJECT"); + cmValue n = root->GetMakefile()->GetProperty("VS_STARTUP_PROJECT"); if (cmNonempty(n)) { std::string startup = *n; if (this->FindTarget(startup)) { @@ -820,7 +820,7 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly( // This allows the project to control the language choice in // a target with none of its own sources, e.g. when also using // object libraries. - cmProp linkLang = gt->GetProperty("LINKER_LANGUAGE"); + cmValue linkLang = gt->GetProperty("LINKER_LANGUAGE"); if (cmNonempty(linkLang)) { languages.insert(*linkLang); } diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 57ada62..d1bd6b1 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -201,7 +201,7 @@ protected: private: virtual std::string GetVSMakeProgram() = 0; void PrintCompilerAdvice(std::ostream&, std::string const&, - cmProp) const override + cmValue) const override { } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 4ccc955..c3d60b0 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -941,11 +941,11 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( gtgt->AddExplicitLanguageFlags(flags, *sf); const std::string COMPILE_FLAGS("COMPILE_FLAGS"); - if (cmProp cflags = sf->GetProperty(COMPILE_FLAGS)) { + if (cmValue cflags = sf->GetProperty(COMPILE_FLAGS)) { lg->AppendFlags(flags, genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS)); } const std::string COMPILE_OPTIONS("COMPILE_OPTIONS"); - if (cmProp coptions = sf->GetProperty(COMPILE_OPTIONS)) { + if (cmValue coptions = sf->GetProperty(COMPILE_OPTIONS)) { lg->AppendCompileOptions( flags, genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS)); } @@ -953,7 +953,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( // Add per-source definitions. BuildObjectListOrString flagsBuild(this, false); const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); - if (cmProp compile_defs = sf->GetProperty(COMPILE_DEFINITIONS)) { + if (cmValue compile_defs = sf->GetProperty(COMPILE_DEFINITIONS)) { this->AppendDefines( flagsBuild, genexInterpreter.Evaluate(*compile_defs, COMPILE_DEFINITIONS).c_str(), @@ -974,7 +974,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( // Add per-source include directories. std::vector includes; const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); - if (cmProp cincludes = sf->GetProperty(INCLUDE_DIRECTORIES)) { + if (cmValue cincludes = sf->GetProperty(INCLUDE_DIRECTORIES)) { lg->AppendIncludeDirectories( includes, genexInterpreter.Evaluate(*cincludes, INCLUDE_DIRECTORIES), *sf); @@ -1006,7 +1006,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( } // Add user-specified file attributes. - cmProp extraFileAttributes = sf->GetProperty("XCODE_FILE_ATTRIBUTES"); + cmValue extraFileAttributes = sf->GetProperty("XCODE_FILE_ATTRIBUTES"); if (extraFileAttributes) { // Expand the list of attributes. std::vector attributes = cmExpandedList(*extraFileAttributes); @@ -1194,9 +1194,9 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( bool useLastKnownFileType = false; std::string fileType; if (sf) { - if (cmProp e = sf->GetProperty("XCODE_EXPLICIT_FILE_TYPE")) { + if (cmValue e = sf->GetProperty("XCODE_EXPLICIT_FILE_TYPE")) { fileType = *e; - } else if (cmProp l = sf->GetProperty("XCODE_LAST_KNOWN_FILE_TYPE")) { + } else if (cmValue l = sf->GetProperty("XCODE_LAST_KNOWN_FILE_TYPE")) { useLastKnownFileType = true; fileType = *l; } @@ -2413,7 +2413,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, this->CurrentLocalGenerator->GetStaticLibraryFlags( extraLinkOptions, configName, llang, gtgt); } else { - cmProp targetLinkFlags = gtgt->GetProperty("LINK_FLAGS"); + cmValue targetLinkFlags = gtgt->GetProperty("LINK_FLAGS"); if (targetLinkFlags) { this->CurrentLocalGenerator->AppendFlags(extraLinkOptions, *targetLinkFlags); @@ -2421,7 +2421,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, if (!configName.empty()) { std::string linkFlagsVar = cmStrCat("LINK_FLAGS_", cmSystemTools::UpperCase(configName)); - if (cmProp linkFlags = gtgt->GetProperty(linkFlagsVar)) { + if (cmValue linkFlags = gtgt->GetProperty(linkFlagsVar)) { this->CurrentLocalGenerator->AppendFlags(extraLinkOptions, *linkFlags); } } @@ -2458,8 +2458,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, std::string pnsuffix; gtgt->GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName); - cmProp version = gtgt->GetProperty("VERSION"); - cmProp soversion = gtgt->GetProperty("SOVERSION"); + cmValue version = gtgt->GetProperty("VERSION"); + cmValue soversion = gtgt->GetProperty("SOVERSION"); if (!gtgt->HasSOName(configName) || gtgt->IsFrameworkOnApple()) { version = nullptr; soversion = nullptr; @@ -2523,7 +2523,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, std::string fw_version = gtgt->GetFrameworkVersion(); buildSettings->AddAttribute("FRAMEWORK_VERSION", this->CreateString(fw_version)); - cmProp ext = gtgt->GetProperty("BUNDLE_EXTENSION"); + cmValue ext = gtgt->GetProperty("BUNDLE_EXTENSION"); if (ext) { buildSettings->AddAttribute("WRAPPER_EXTENSION", this->CreateString(*ext)); @@ -2564,7 +2564,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, extraLinkOptions += " "; extraLinkOptions += createFlags; } - cmProp ext = gtgt->GetProperty("BUNDLE_EXTENSION"); + cmValue ext = gtgt->GetProperty("BUNDLE_EXTENSION"); if (ext) { buildSettings->AddAttribute("WRAPPER_EXTENSION", this->CreateString(*ext)); @@ -2598,7 +2598,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, std::string fw_version = gtgt->GetFrameworkVersion(); buildSettings->AddAttribute("FRAMEWORK_VERSION", this->CreateString(fw_version)); - cmProp ext = gtgt->GetProperty("BUNDLE_EXTENSION"); + cmValue ext = gtgt->GetProperty("BUNDLE_EXTENSION"); if (ext) { buildSettings->AddAttribute("WRAPPER_EXTENSION", this->CreateString(*ext)); @@ -2637,7 +2637,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, // Handle bundles and normal executables separately. if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) { - cmProp ext = gtgt->GetProperty("BUNDLE_EXTENSION"); + cmValue ext = gtgt->GetProperty("BUNDLE_EXTENSION"); if (ext) { buildSettings->AddAttribute("WRAPPER_EXTENSION", this->CreateString(*ext)); @@ -3083,7 +3083,7 @@ const char* cmGlobalXCodeGenerator::GetTargetLinkFlagsVar( const char* cmGlobalXCodeGenerator::GetTargetFileType( cmGeneratorTarget* target) { - if (cmProp e = target->GetProperty("XCODE_EXPLICIT_FILE_TYPE")) { + if (cmValue e = target->GetProperty("XCODE_EXPLICIT_FILE_TYPE")) { return e->c_str(); } @@ -3116,7 +3116,7 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType( const char* cmGlobalXCodeGenerator::GetTargetProductType( cmGeneratorTarget* target) { - if (cmProp e = target->GetProperty("XCODE_PRODUCT_TYPE")) { + if (cmValue e = target->GetProperty("XCODE_PRODUCT_TYPE")) { return e->c_str(); } @@ -3235,7 +3235,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, const std::string& id) { std::string guidStoreName = cmStrCat(name, "_GUID_CMAKE"); - cmProp storedGUID = this->CMakeInstance->GetCacheDefinition(guidStoreName); + cmValue storedGUID = this->CMakeInstance->GetCacheDefinition(guidStoreName); if (storedGUID) { return *storedGUID; @@ -3411,7 +3411,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) std::map> targetProductNameMap; bool useLinkPhase = false; bool forceLinkPhase = false; - cmProp prop = + cmValue prop = target->GetTarget()->GetProperty("XCODE_LINK_BUILD_PHASE_MODE"); if (prop) { if (*prop == "BUILT_ONLY") { @@ -3784,7 +3784,7 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects( if (!(isFrameworkTarget || isBundleTarget || isCFBundleTarget)) { return; } - cmProp files = gt->GetProperty(embedPropertyName); + cmValue files = gt->GetProperty(embedPropertyName); if (!files) { return; } @@ -3799,7 +3799,7 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects( this->CreateString(dstSubfolderSpec)); copyFilesBuildPhase->AddAttribute( "name", this->CreateString(copyFilesBuildPhaseName)); - if (cmProp fwEmbedPath = + if (cmValue fwEmbedPath = gt->GetProperty(cmStrCat(embedPropertyName, "_PATH"))) { copyFilesBuildPhase->AddAttribute("dstPath", this->CreateString(*fwEmbedPath)); @@ -4186,8 +4186,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( this->CreateString(defaultConfigName)); cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); - cmProp sysroot = this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); - cmProp deploymentTarget = + cmValue sysroot = this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); + cmValue deploymentTarget = this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); if (sysroot) { buildSettings->AddAttribute("SDKROOT", this->CreateString(*sysroot)); @@ -4220,7 +4220,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( } if (this->GetLanguageEnabled("Swift")) { std::string swiftVersion; - if (cmProp vers = this->CurrentMakefile->GetDefinition( + if (cmValue vers = this->CurrentMakefile->GetDefinition( "CMAKE_Swift_LANGUAGE_VERSION")) { swiftVersion = *vers; } else if (this->XcodeVersion >= 102) { @@ -4343,7 +4343,7 @@ std::string cmGlobalXCodeGenerator::GetObjectsDirectory( void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf) { this->Architectures.clear(); - cmProp sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT"); + cmValue sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT"); if (sysroot) { mf->GetDefExpandList("CMAKE_OSX_ARCHITECTURES", this->Architectures); } @@ -4356,7 +4356,7 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf) // With no ARCHS we use ONLY_ACTIVE_ARCH and possibly a // platform-specific default ARCHS placeholder value. // Look up the arch that Xcode chooses in this case. - if (cmProp arch = mf->GetDefinition("CMAKE_XCODE_ARCHS")) { + if (cmValue arch = mf->GetDefinition("CMAKE_XCODE_ARCHS")) { this->ObjectDirArchDefault = *arch; // We expect only one arch but choose the first just in case. std::string::size_type pos = this->ObjectDirArchDefault.find(';'); @@ -4550,7 +4550,7 @@ bool cmGlobalXCodeGenerator::OutputXCodeSharedSchemes( continue; } - cmProp testee = obj->GetTarget()->GetProperty("XCTEST_TESTEE"); + cmValue testee = obj->GetTarget()->GetProperty("XCTEST_TESTEE"); if (!testee) { continue; } @@ -4733,7 +4733,7 @@ std::string cmGlobalXCodeGenerator::LookupFlags( { if (!varNameLang.empty()) { std::string varName = cmStrCat(varNamePrefix, varNameLang, varNameSuffix); - if (cmProp varValue = this->CurrentMakefile->GetDefinition(varName)) { + if (cmValue varValue = this->CurrentMakefile->GetDefinition(varName)) { if (!varValue->empty()) { return *varValue; } @@ -4855,7 +4855,7 @@ bool cmGlobalXCodeGenerator::HasKnownObjectFileLocation( bool cmGlobalXCodeGenerator::UseEffectivePlatformName(cmMakefile* mf) const { - cmProp epnValue = this->GetCMakeInstance()->GetState()->GetGlobalProperty( + cmValue epnValue = this->GetCMakeInstance()->GetState()->GetGlobalProperty( "XCODE_EMIT_EFFECTIVE_PLATFORM_NAME"); if (!epnValue) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index e54818e..72af4a4 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -327,7 +327,7 @@ private: bool XcodeBuildCommandInitialized; void PrintCompilerAdvice(std::ostream&, std::string const&, - cmProp) const override + cmValue) const override { } diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 122bda5..ab18e2a 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -17,11 +17,11 @@ #include "cmLinkItem.h" #include "cmLocalGenerator.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 { @@ -232,7 +232,7 @@ void cmGraphVizWriter::ReadSettings( #define set_if_set(var, cmakeDefinition) \ do { \ - cmProp value = mf.GetDefinition(cmakeDefinition); \ + cmValue value = mf.GetDefinition(cmakeDefinition); \ if (value) { \ (var) = *value; \ } \ @@ -244,7 +244,7 @@ void cmGraphVizWriter::ReadSettings( #define set_bool_if_set(var, cmakeDefinition) \ do { \ - cmProp value = mf.GetDefinition(cmakeDefinition); \ + cmValue value = mf.GetDefinition(cmakeDefinition); \ if (value) { \ (var) = cmIsOn(*value); \ } \ diff --git a/Source/cmIncludeGuardCommand.cxx b/Source/cmIncludeGuardCommand.cxx index d48c823..e0a6958 100644 --- a/Source/cmIncludeGuardCommand.cxx +++ b/Source/cmIncludeGuardCommand.cxx @@ -4,10 +4,10 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" namespace { diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 687741b..ee77b2c 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -35,7 +35,6 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmRuntimeDependencyArchive.h" #include "cmStateTypes.h" @@ -44,6 +43,7 @@ #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetExport.h" +#include "cmValue.h" namespace { @@ -926,7 +926,7 @@ bool HandleTargetsMode(std::vector const& args, } if (createInstallGeneratorsForTargetFileSets && !namelinkOnly) { - cmProp files = target.GetProperty("PRIVATE_HEADER"); + cmValue files = target.GetProperty("PRIVATE_HEADER"); if (cmNonempty(files)) { std::vector relFiles = cmExpandedList(*files); std::vector absFiles; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 35165cf..2f974c4 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -18,11 +18,11 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" #include "cmake.h" namespace { @@ -208,7 +208,7 @@ cmInstallTargetGenerator::Files cmInstallTargetGenerator::GetFiles( // Get App Bundle Extension std::string ext; - if (cmProp p = this->Target->GetProperty("BUNDLE_EXTENSION")) { + if (cmValue p = this->Target->GetProperty("BUNDLE_EXTENSION")) { ext = *p; } else { ext = "app"; @@ -825,7 +825,7 @@ void cmInstallTargetGenerator::AddUniversalInstallRule( return; } - cmProp xcodeVersion = mf->GetDefinition("XCODE_VERSION"); + cmValue xcodeVersion = mf->GetDefinition("XCODE_VERSION"); if (!xcodeVersion || cmSystemTools::VersionCompareGreater("6", *xcodeVersion)) { return; diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index 2ffff96..43f161b 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -16,11 +16,11 @@ #include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" +#include "cmValue.h" class cmOutputConverter; @@ -177,7 +177,7 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg, return false; } - if (cmProp resolveDeviceSymbols = + if (cmValue resolveDeviceSymbols = target.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) { // If CUDA_RESOLVE_DEVICE_SYMBOLS has been explicitly set we need // to honor the value no matter what it is. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 09cd88e..a1aaee3 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -25,12 +25,12 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmStringAlgorithms.h" #include "cmStringReplaceHelper.h" #include "cmSubcommandTable.h" #include "cmSystemTools.h" +#include "cmValue.h" namespace { @@ -79,7 +79,7 @@ bool GetListString(std::string& listString, const std::string& var, const cmMakefile& makefile) { // get the old value - cmProp cacheValue = makefile.GetDefinition(var); + cmValue cacheValue = makefile.GetDefinition(var); if (!cacheValue) { return false; } diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 211525a..eca7a9e 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -8,11 +8,11 @@ #include "cmGeneratorTarget.h" #include "cmMakefile.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmStringAlgorithms.h" +#include "cmValue.h" class cmGlobalGenerator; @@ -82,7 +82,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags( // If there is a separate module path flag then duplicate the // include path with it. This compiler does not search the include // path for modules. - if (cmProp modpath_flag = + if (cmValue modpath_flag = this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG")) { std::vector includes; this->GetIncludeDirectories(includes, target, "C", config); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e2e0d8e..966cf28 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -37,7 +37,6 @@ #include "cmInstallTargetGenerator.h" #include "cmLinkLineComputer.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" @@ -50,6 +49,7 @@ #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTestGenerator.h" +#include "cmValue.h" #include "cmVersion.h" #include "cmake.h" @@ -117,21 +117,21 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile) std::vector enabledLanguages = this->GetState()->GetEnabledLanguages(); - if (cmProp sysrootCompile = + if (cmValue sysrootCompile = this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) { this->CompilerSysroot = *sysrootCompile; } else { this->CompilerSysroot = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"); } - if (cmProp sysrootLink = + if (cmValue sysrootLink = this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK")) { this->LinkerSysroot = *sysrootLink; } else { this->LinkerSysroot = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"); } - if (cmProp appleArchSysroots = + if (cmValue appleArchSysroots = this->Makefile->GetDefinition("CMAKE_APPLE_ARCH_SYSROOTS")) { std::string const& appleArchs = this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES"); @@ -221,7 +221,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() #else this->ObjectPathMax = 1000; #endif - cmProp plen = this->Makefile->GetDefinition("CMAKE_OBJECT_PATH_MAX"); + cmValue plen = this->Makefile->GetDefinition("CMAKE_OBJECT_PATH_MAX"); if (cmNonempty(plen)) { unsigned int pmax; if (sscanf(plen->c_str(), "%u", &pmax) == 1) { @@ -329,12 +329,12 @@ void cmLocalGenerator::GenerateTestFiles() fout << "set(CTEST_RESOURCE_SPEC_FILE \"" << resourceSpecFile << "\")\n"; } - cmProp testIncludeFile = this->Makefile->GetProperty("TEST_INCLUDE_FILE"); + cmValue testIncludeFile = this->Makefile->GetProperty("TEST_INCLUDE_FILE"); if (testIncludeFile) { fout << "include(\"" << *testIncludeFile << "\")\n"; } - cmProp testIncludeFiles = this->Makefile->GetProperty("TEST_INCLUDE_FILES"); + cmValue testIncludeFiles = this->Makefile->GetProperty("TEST_INCLUDE_FILES"); if (testIncludeFiles) { std::vector includesList = cmExpandedList(*testIncludeFiles); for (std::string const& i : includesList) { @@ -358,9 +358,9 @@ void cmLocalGenerator::GenerateTestFiles() } // Add directory labels property - cmProp directoryLabels = + cmValue directoryLabels = this->Makefile->GetDefinition("CMAKE_DIRECTORY_LABELS"); - cmProp labels = this->Makefile->GetProperty("LABELS"); + cmValue labels = this->Makefile->GetProperty("LABELS"); if (labels || directoryLabels) { fout << "set_directory_properties(PROPERTIES LABELS "; @@ -425,7 +425,8 @@ void cmLocalGenerator::ProcessEvaluationFiles( void cmLocalGenerator::GenerateInstallRules() { // Compute the install prefix. - cmProp installPrefix = this->Makefile->GetDefinition("CMAKE_INSTALL_PREFIX"); + cmValue installPrefix = + this->Makefile->GetDefinition("CMAKE_INSTALL_PREFIX"); std::string prefix = installPrefix; #if defined(_WIN32) && !defined(__CYGWIN__) @@ -433,7 +434,7 @@ void cmLocalGenerator::GenerateInstallRules() if (!cmSystemTools::GetEnv("SystemDrive", prefix)) { prefix = "C:"; } - cmProp project_name = this->Makefile->GetDefinition("PROJECT_NAME"); + cmValue project_name = this->Makefile->GetDefinition("PROJECT_NAME"); if (cmNonempty(project_name)) { prefix += "/Program Files/"; prefix += *project_name; @@ -456,7 +457,7 @@ void cmLocalGenerator::GenerateInstallRules() prefix = "/usr/local"; } #endif - if (cmProp stagingPrefix = + if (cmValue stagingPrefix = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX")) { prefix = *stagingPrefix; } @@ -538,7 +539,7 @@ void cmLocalGenerator::GenerateInstallRules() /* clang-format on */ // Copy user-specified install options to the install code. - if (cmProp so_no_exe = + if (cmValue so_no_exe = this->Makefile->GetDefinition("CMAKE_INSTALL_SO_NO_EXE")) { /* clang-format off */ fout << @@ -551,7 +552,7 @@ void cmLocalGenerator::GenerateInstallRules() } // Copy cmake cross compile state to install code. - if (cmProp crosscompiling = + if (cmValue crosscompiling = this->Makefile->GetDefinition("CMAKE_CROSSCOMPILING")) { /* clang-format off */ fout << @@ -564,7 +565,7 @@ void cmLocalGenerator::GenerateInstallRules() } // Write default directory permissions. - if (cmProp defaultDirPermissions = this->Makefile->GetDefinition( + if (cmValue defaultDirPermissions = this->Makefile->GetDefinition( "CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS")) { /* clang-format off */ fout << @@ -580,7 +581,7 @@ void cmLocalGenerator::GenerateInstallRules() // Write out CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM so that // installed code that uses `file(GET_RUNTIME_DEPENDENCIES)` // has same platform variable as when running cmake - if (cmProp platform = this->Makefile->GetDefinition( + if (cmValue platform = this->Makefile->GetDefinition( "CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM")) { /* clang-format off */ fout << @@ -596,7 +597,7 @@ void cmLocalGenerator::GenerateInstallRules() // Write out CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL so that // installed code that uses `file(GET_RUNTIME_DEPENDENCIES)` // has same tool selected as when running cmake - if (cmProp command = + if (cmValue command = this->Makefile->GetDefinition("CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL")) { /* clang-format off */ fout << @@ -612,7 +613,7 @@ void cmLocalGenerator::GenerateInstallRules() // Write out CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND so that // installed code that uses `file(GET_RUNTIME_DEPENDENCIES)` // has same path to the tool as when running cmake - if (cmProp command = this->Makefile->GetDefinition( + if (cmValue command = this->Makefile->GetDefinition( "CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND")) { /* clang-format off */ fout << @@ -630,7 +631,7 @@ void cmLocalGenerator::GenerateInstallRules() // CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND has consistent // logic to fallback to CMAKE_OBJDUMP when `objdump` is // not on the path - if (cmProp command = this->Makefile->GetDefinition("CMAKE_OBJDUMP")) { + if (cmValue command = this->Makefile->GetDefinition("CMAKE_OBJDUMP")) { /* clang-format off */ fout << "# Set default install directory permissions.\n" @@ -823,8 +824,8 @@ cmStateSnapshot cmLocalGenerator::GetStateSnapshot() const return this->Makefile->GetStateSnapshot(); } -cmProp cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target, - const std::string& prop) +cmValue cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target, + const std::string& prop) { if (target) { return target->GetProperty(prop); @@ -863,7 +864,7 @@ std::string cmLocalGenerator::GetIncludeFlags( std::string sep = " "; bool repeatFlag = true; // should the include flag be repeated like ie. -IA -IB - if (cmProp incSep = this->Makefile->GetDefinition( + if (cmValue incSep = this->Makefile->GetDefinition( cmStrCat("CMAKE_INCLUDE_FLAG_SEP_", lang))) { // if there is a separator then the flag is not repeated but is only // given once i.e. -classpath a:b:c @@ -873,8 +874,8 @@ std::string cmLocalGenerator::GetIncludeFlags( // Support special system include flag if it is available and the // normal flag is repeated for each directory. - cmProp sysIncludeFlag = nullptr; - cmProp sysIncludeFlagWarning = nullptr; + cmValue sysIncludeFlag = nullptr; + cmValue sysIncludeFlagWarning = nullptr; if (repeatFlag) { sysIncludeFlag = this->Makefile->GetDefinition( cmStrCat("CMAKE_INCLUDE_SYSTEM_FLAG_", lang)); @@ -882,9 +883,9 @@ std::string cmLocalGenerator::GetIncludeFlags( cmStrCat("_CMAKE_INCLUDE_SYSTEM_FLAG_", lang, "_WARNING")); } - cmProp fwSearchFlag = this->Makefile->GetDefinition( + cmValue fwSearchFlag = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_FRAMEWORK_SEARCH_FLAG")); - cmProp sysFwSearchFlag = this->Makefile->GetDefinition( + cmValue sysFwSearchFlag = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_SYSTEM_FRAMEWORK_SEARCH_FLAG")); bool flagUsed = false; @@ -960,10 +961,10 @@ void cmLocalGenerator::AddCompileOptions(std::vector>& flags, { std::string langFlagRegexVar = cmStrCat("CMAKE_", lang, "_FLAG_REGEX"); - if (cmProp langFlagRegexStr = + if (cmValue langFlagRegexStr = this->Makefile->GetDefinition(langFlagRegexVar)) { // Filter flags acceptable to this language. - if (cmProp targetFlags = target->GetProperty("COMPILE_FLAGS")) { + if (cmValue targetFlags = target->GetProperty("COMPILE_FLAGS")) { std::vector opts; cmSystemTools::ParseWindowsCommandLine(targetFlags->c_str(), opts); // Re-escape these flags since COMPILE_FLAGS were already parsed @@ -981,7 +982,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector>& flags, langFlagRegexStr->c_str()); } else { // Use all flags. - if (cmProp targetFlags = target->GetProperty("COMPILE_FLAGS")) { + if (cmValue targetFlags = target->GetProperty("COMPILE_FLAGS")) { // COMPILE_FLAGS are not escaped for historical reasons. std::string compileFlags; this->AppendFlags(compileFlags, *targetFlags); @@ -997,7 +998,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector>& flags, cmStandardLevelResolver standardResolver(this->Makefile); for (auto const& it : target->GetMaxLanguageStandards()) { - cmProp standard = target->GetLanguageStandard(it.first, config); + cmValue standard = target->GetLanguageStandard(it.first, config); if (!standard) { continue; } @@ -1028,7 +1029,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector>& flags, // Add compile flag for the MSVC compiler only. cmMakefile* mf = this->GetMakefile(); - if (cmProp jmc = + if (cmValue jmc = mf->GetDefinition("CMAKE_" + lang + "_COMPILE_OPTIONS_JMC")) { // Handle Just My Code debugging flags, /JMC. @@ -1037,7 +1038,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector>& flags, cmGeneratorTarget::ManagedType::Managed) { // add /JMC flags if target property VS_JUST_MY_CODE_DEBUGGING is set // to ON - if (cmProp jmcExprGen = + if (cmValue jmcExprGen = target->GetProperty("VS_JUST_MY_CODE_DEBUGGING")) { std::string isJMCEnabled = cmGeneratorExpression::Evaluate(*jmcExprGen, this, config); @@ -1496,7 +1497,7 @@ void cmLocalGenerator::GetTargetFlags( } } - cmProp targetLinkFlags = target->GetProperty("LINK_FLAGS"); + cmValue targetLinkFlags = target->GetProperty("LINK_FLAGS"); if (targetLinkFlags) { sharedLibFlags += *targetLinkFlags; sharedLibFlags += " "; @@ -1576,7 +1577,7 @@ void cmLocalGenerator::GetTargetFlags( exeFlags += " "; } - cmProp targetLinkFlags = target->GetProperty("LINK_FLAGS"); + cmValue targetLinkFlags = target->GetProperty("LINK_FLAGS"); if (targetLinkFlags) { exeFlags += *targetLinkFlags; exeFlags += " "; @@ -1672,7 +1673,7 @@ static std::string GetFrameworkFlags(const std::string& lang, } std::string fwSearchFlagVar = "CMAKE_" + lang + "_FRAMEWORK_SEARCH_FLAG"; - cmProp fwSearchFlag = mf->GetDefinition(fwSearchFlagVar); + cmValue fwSearchFlag = mf->GetDefinition(fwSearchFlagVar); if (!cmNonempty(fwSearchFlag)) { return std::string(); } @@ -1781,7 +1782,7 @@ void cmLocalGenerator::OutputLinkLibraries( std::string linkLanguage = cli.GetLinkLanguage(); std::string libPathFlag; - if (cmProp value = this->Makefile->GetDefinition( + if (cmValue value = this->Makefile->GetDefinition( "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_FLAG")) { libPathFlag = *value; } else { @@ -1790,7 +1791,7 @@ void cmLocalGenerator::OutputLinkLibraries( } std::string libPathTerminator; - if (cmProp value = this->Makefile->GetDefinition( + if (cmValue value = this->Makefile->GetDefinition( "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_TERMINATOR")) { libPathTerminator = *value; } else { @@ -1866,7 +1867,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065( } bool cmLocalGenerator::AllAppleArchSysrootsAreTheSame( - const std::vector& archs, cmProp sysroot) + const std::vector& archs, cmValue sysroot) { if (!sysroot) { return false; @@ -1901,12 +1902,12 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, } } - cmProp sysroot = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT"); + cmValue sysroot = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT"); if (sysroot && *sysroot == "/") { sysroot = nullptr; } std::string sysrootFlagVar = "CMAKE_" + lang + "_SYSROOT_FLAG"; - cmProp sysrootFlag = this->Makefile->GetDefinition(sysrootFlagVar); + cmValue sysrootFlag = this->Makefile->GetDefinition(sysrootFlagVar); if (cmNonempty(sysrootFlag)) { if (!this->AppleArchSysroots.empty() && !this->AllAppleArchSysrootsAreTheSame(archs, sysroot)) { @@ -1930,11 +1931,11 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, } } - cmProp deploymentTarget = + cmValue deploymentTarget = this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); std::string deploymentTargetFlagVar = "CMAKE_" + lang + "_OSX_DEPLOYMENT_TARGET_FLAG"; - cmProp deploymentTargetFlag = + cmValue deploymentTargetFlag = this->Makefile->GetDefinition(deploymentTargetFlagVar); if (cmNonempty(deploymentTargetFlag) && cmNonempty(deploymentTarget)) { flags += " "; @@ -1959,7 +1960,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, std::string compilerSimulateId = this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_", lang, "_SIMULATE_ID")); if (lang == "Swift") { - if (cmProp v = target->GetProperty("Swift_LANGUAGE_VERSION")) { + if (cmValue v = target->GetProperty("Swift_LANGUAGE_VERSION")) { if (cmSystemTools::VersionCompare( cmSystemTools::OP_GREATER_EQUAL, this->Makefile->GetDefinition("CMAKE_Swift_COMPILER_VERSION"), @@ -1990,7 +1991,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, // Add VFS Overlay for Clang compilers if (compiler == "Clang") { - if (cmProp vfsOverlay = + if (cmValue vfsOverlay = this->Makefile->GetDefinition("CMAKE_CLANG_VFS_OVERLAY")) { if (compilerSimulateId == "MSVC") { this->AppendCompileOptions( @@ -2005,10 +2006,10 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, } // Add MSVC runtime library flags. This is activated by the presence // of a default selection whether or not it is overridden by a property. - cmProp msvcRuntimeLibraryDefault = + cmValue msvcRuntimeLibraryDefault = this->Makefile->GetDefinition("CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT"); if (cmNonempty(msvcRuntimeLibraryDefault)) { - cmProp msvcRuntimeLibraryValue = + cmValue msvcRuntimeLibraryValue = target->GetProperty("MSVC_RUNTIME_LIBRARY"); if (!msvcRuntimeLibraryValue) { msvcRuntimeLibraryValue = msvcRuntimeLibraryDefault; @@ -2016,7 +2017,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, std::string const msvcRuntimeLibrary = cmGeneratorExpression::Evaluate( *msvcRuntimeLibraryValue, this, config, target); if (!msvcRuntimeLibrary.empty()) { - if (cmProp msvcRuntimeLibraryOptions = this->Makefile->GetDefinition( + if (cmValue msvcRuntimeLibraryOptions = this->Makefile->GetDefinition( "CMAKE_" + lang + "_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_" + msvcRuntimeLibrary)) { this->AppendCompileOptions(flags, *msvcRuntimeLibraryOptions); @@ -2196,7 +2197,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( std::string const& optionFlagDef = standardResolver.GetCompileOptionDef(target, lang, config); if (!optionFlagDef.empty()) { - cmProp opt = target->Target->GetMakefile()->GetDefinition(optionFlagDef); + cmValue opt = target->Target->GetMakefile()->GetDefinition(optionFlagDef); if (opt) { std::vector optVec = cmExpandedList(*opt); for (std::string const& i : optVec) { @@ -2213,13 +2214,13 @@ static void AddVisibilityCompileOption(std::string& flags, std::string* warnCMP0063) { std::string compileOption = "CMAKE_" + lang + "_COMPILE_OPTIONS_VISIBILITY"; - cmProp opt = lg->GetMakefile()->GetDefinition(compileOption); + cmValue opt = lg->GetMakefile()->GetDefinition(compileOption); if (!opt) { return; } std::string flagDefine = lang + "_VISIBILITY_PRESET"; - cmProp prop = target->GetProperty(flagDefine); + cmValue prop = target->GetProperty(flagDefine); if (!prop) { return; } @@ -2249,7 +2250,7 @@ static void AddInlineVisibilityCompileOption(std::string& flags, { std::string compileOption = cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN"); - cmProp opt = lg->GetMakefile()->GetDefinition(compileOption); + cmValue opt = lg->GetMakefile()->GetDefinition(compileOption); if (!opt) { return; } @@ -2446,7 +2447,7 @@ void cmLocalGenerator::AddISPCDependencies(cmGeneratorTarget* target) return; } - cmProp ispcHeaderSuffixProp = target->GetProperty("ISPC_HEADER_SUFFIX"); + cmValue ispcHeaderSuffixProp = target->GetProperty("ISPC_HEADER_SUFFIX"); assert(ispcHeaderSuffixProp); std::vector ispcArchSuffixes = @@ -2459,7 +2460,7 @@ void cmLocalGenerator::AddISPCDependencies(cmGeneratorTarget* target) std::string rootObjectDir = target->GetObjectDirectory(config); std::string headerDir = rootObjectDir; - if (cmProp prop = target->GetProperty("ISPC_HEADER_DIRECTORY")) { + if (cmValue prop = target->GetProperty("ISPC_HEADER_DIRECTORY")) { headerDir = cmSystemTools::CollapseFullPath( cmStrCat(this->GetBinaryDirectory(), '/', *prop)); } @@ -2567,14 +2568,14 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) continue; } - cmProp pchExtension = + cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); if (pchExtension.IsEmpty()) { continue; } - cmProp ReuseFrom = + cmValue ReuseFrom = target->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM"); auto* pch_sf = this->Makefile->GetOrCreateSource( @@ -2809,7 +2810,7 @@ inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf, void cmLocalGenerator::IncludeFileInUnitySources( cmGeneratedFileStream& unity_file, std::string const& sf_full_path, - cmProp beforeInclude, cmProp afterInclude, cmProp uniqueIdName) const + cmValue beforeInclude, cmValue afterInclude, cmValue uniqueIdName) const { if (cmNonempty(uniqueIdName)) { std::string pathToHash; @@ -2847,14 +2848,14 @@ void cmLocalGenerator::IncludeFileInUnitySources( std::vector cmLocalGenerator::AddUnityFilesModeAuto( cmGeneratorTarget* target, std::string const& lang, - std::vector const& filtered_sources, cmProp beforeInclude, - cmProp afterInclude, std::string const& filename_base, size_t batchSize) + std::vector const& filtered_sources, cmValue beforeInclude, + cmValue afterInclude, std::string const& filename_base, size_t batchSize) { if (batchSize == 0) { batchSize = filtered_sources.size(); } - cmProp uniqueIdName = target->GetProperty("UNITY_BUILD_UNIQUE_ID"); + cmValue uniqueIdName = target->GetProperty("UNITY_BUILD_UNIQUE_ID"); std::vector unity_files; for (size_t itemsLeft = filtered_sources.size(), chunk, batch = 0; @@ -2890,8 +2891,8 @@ std::vector cmLocalGenerator::AddUnityFilesModeAuto( std::vector cmLocalGenerator::AddUnityFilesModeGroup( cmGeneratorTarget* target, std::string const& lang, - std::vector const& filtered_sources, cmProp beforeInclude, - cmProp afterInclude, std::string const& filename_base) + std::vector const& filtered_sources, cmValue beforeInclude, + cmValue afterInclude, std::string const& filename_base) { std::vector unity_files; @@ -2899,7 +2900,7 @@ std::vector cmLocalGenerator::AddUnityFilesModeGroup( // without a group std::unordered_map> explicit_mapping; for (cmSourceFile* sf : filtered_sources) { - if (cmProp value = sf->GetProperty("UNITY_GROUP")) { + if (cmValue value = sf->GetProperty("UNITY_GROUP")) { auto i = explicit_mapping.find(*value); if (i == explicit_mapping.end()) { std::vector sources{ sf }; @@ -2910,7 +2911,7 @@ std::vector cmLocalGenerator::AddUnityFilesModeGroup( } } - cmProp uniqueIdName = target->GetProperty("UNITY_BUILD_UNIQUE_ID"); + cmValue uniqueIdName = target->GetProperty("UNITY_BUILD_UNIQUE_ID"); for (auto const& item : explicit_mapping) { auto const& name = item.first; @@ -2957,15 +2958,15 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target) std::vector sources; target->GetSourceFiles(sources, config); - cmProp batchSizeString = target->GetProperty("UNITY_BUILD_BATCH_SIZE"); + cmValue batchSizeString = target->GetProperty("UNITY_BUILD_BATCH_SIZE"); const size_t unityBatchSize = batchSizeString ? static_cast(std::atoi(batchSizeString->c_str())) : 0; - cmProp beforeInclude = + cmValue beforeInclude = target->GetProperty("UNITY_BUILD_CODE_BEFORE_INCLUDE"); - cmProp afterInclude = target->GetProperty("UNITY_BUILD_CODE_AFTER_INCLUDE"); - cmProp unityMode = target->GetProperty("UNITY_BUILD_MODE"); + cmValue afterInclude = target->GetProperty("UNITY_BUILD_CODE_AFTER_INCLUDE"); + cmValue unityMode = target->GetProperty("UNITY_BUILD_MODE"); for (std::string lang : { "C", "CXX" }) { std::vector filtered_sources; @@ -3025,7 +3026,7 @@ void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags, } const std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_IPO"; - cmProp rawFlagsList = this->Makefile->GetDefinition(name); + cmValue rawFlagsList = this->Makefile->GetDefinition(name); if (!rawFlagsList) { return; } @@ -3240,7 +3241,7 @@ void cmLocalGenerator::JoinDefines(const std::set& defines, // Lookup the define flag for the current language. std::string dflag = "-D"; if (!lang.empty()) { - cmProp df = + cmValue df = this->Makefile->GetDefinition(cmStrCat("CMAKE_", lang, "_DEFINE_FLAG")); if (cmNonempty(df)) { dflag = *df; @@ -3287,7 +3288,7 @@ void cmLocalGenerator::AppendFeatureOptions(std::string& flags, const std::string& lang, const char* feature) { - cmProp optionList = this->Makefile->GetDefinition( + cmValue optionList = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_", feature)); if (optionList) { std::vector options = cmExpandedList(*optionList); @@ -3297,8 +3298,8 @@ void cmLocalGenerator::AppendFeatureOptions(std::string& flags, } } -cmProp cmLocalGenerator::GetFeature(const std::string& feature, - const std::string& config) +cmValue cmLocalGenerator::GetFeature(const std::string& feature, + const std::string& config) { std::string featureName = feature; // TODO: Define accumulation policy for features (prepend, append, @@ -3309,7 +3310,7 @@ cmProp cmLocalGenerator::GetFeature(const std::string& feature, } cmStateSnapshot snp = this->StateSnapshot; while (snp.IsValid()) { - if (cmProp value = snp.GetDirectory().GetProperty(featureName)) { + if (cmValue value = snp.GetDirectory().GetProperty(featureName)) { return value; } snp = snp.GetBuildsystemDirectoryParent(); @@ -3374,7 +3375,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( } // Include the user-specified pre-install script for this target. - if (cmProp preinstall = l->GetProperty("PRE_INSTALL_SCRIPT")) { + if (cmValue preinstall = l->GetProperty("PRE_INSTALL_SCRIPT")) { cmInstallScriptGenerator g(*preinstall, false, "", false, false); g.Generate(os, config, configurationTypes); } @@ -3427,7 +3428,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( } // Include the user-specified post-install script for this target. - if (cmProp postinstall = l->GetProperty("POST_INSTALL_SCRIPT")) { + if (cmValue postinstall = l->GetProperty("POST_INSTALL_SCRIPT")) { cmInstallScriptGenerator g(*postinstall, false, "", false, false); g.Generate(os, config, configurationTypes); } @@ -3652,8 +3653,8 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget( // Ensure that for the CMakeFiles/.dir/generated_source_file // we don't end up having: // CMakeFiles/.dir/CMakeFiles/.dir/generated_source_file.obj - cmProp unitySourceFile = source.GetProperty("UNITY_SOURCE_FILE"); - cmProp pchExtension = source.GetProperty("PCH_EXTENSION"); + cmValue unitySourceFile = source.GetProperty("UNITY_SOURCE_FILE"); + cmValue pchExtension = source.GetProperty("PCH_EXTENSION"); const bool isPchObject = objectName.find("cmake_pch") != std::string::npos; if (unitySourceFile || pchExtension || isPchObject) { if (pchExtension) { @@ -3752,7 +3753,7 @@ KWIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility() unsigned int major = 0; unsigned int minor = 0; unsigned int patch = 0; - if (cmProp value = + if (cmValue value = this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY")) { switch (sscanf(value->c_str(), "%u.%u.%u", &major, &minor, &patch)) { case 2: @@ -3847,7 +3848,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const static void cmLGInfoProp(cmMakefile* mf, cmGeneratorTarget* target, const std::string& prop) { - if (cmProp val = target->GetProperty(prop)) { + if (cmValue val = target->GetProperty(prop)) { mf->AddDefinition(prop, *val); } } @@ -3857,7 +3858,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target, const std::string& fname) { // Find the Info.plist template. - cmProp in = target->GetProperty("MACOSX_BUNDLE_INFO_PLIST"); + cmValue in = target->GetProperty("MACOSX_BUNDLE_INFO_PLIST"); std::string inFile = cmNonempty(in) ? *in : "MacOSXBundleInfo.plist.in"; if (!cmSystemTools::FileIsFullPath(inFile)) { std::string inMod = this->Makefile->GetModulesFile(inFile); @@ -3896,7 +3897,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList( const std::string& fname) { // Find the Info.plist template. - cmProp in = target->GetProperty("MACOSX_FRAMEWORK_INFO_PLIST"); + cmValue in = target->GetProperty("MACOSX_FRAMEWORK_INFO_PLIST"); std::string inFile = cmNonempty(in) ? *in : "MacOSXFrameworkInfo.plist.in"; if (!cmSystemTools::FileIsFullPath(inFile)) { std::string inMod = this->Makefile->GetModulesFile(inFile); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 678ef8c..3614c84 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -20,8 +20,8 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmStateSnapshot.h" +#include "cmValue.h" class cmCompiledGeneratorExpression; class cmComputeLinkInformation; @@ -247,7 +247,7 @@ public: void AppendFeatureOptions(std::string& flags, const std::string& lang, const char* feature); - cmProp GetFeature(const std::string& feature, const std::string& config); + cmValue GetFeature(const std::string& feature, const std::string& config); /** \brief Get absolute path to dependency \a name * @@ -547,7 +547,7 @@ public: void CreateEvaluationFileOutputs(const std::string& config); void ProcessEvaluationFiles(std::vector& generatedFiles); - cmProp GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop); + cmValue GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop); protected: // The default implementation ignores the IncludePathStyle and always @@ -651,7 +651,7 @@ private: void ComputeObjectMaxPath(); bool AllAppleArchSysrootsAreTheSame(const std::vector& archs, - cmProp sysroot); + cmValue sysroot); void CopyPchCompilePdb(const std::string& config, cmGeneratorTarget* target, const std::string& ReuseFrom, @@ -659,16 +659,16 @@ private: std::vector const& extensions); void IncludeFileInUnitySources(cmGeneratedFileStream& unity_file, std::string const& sf_full_path, - cmProp beforeInclude, cmProp afterInclude, - cmProp uniqueIdName) const; + cmValue beforeInclude, cmValue afterInclude, + cmValue uniqueIdName) const; std::vector AddUnityFilesModeAuto( cmGeneratorTarget* target, std::string const& lang, - std::vector const& filtered_sources, cmProp beforeInclude, - cmProp afterInclude, std::string const& filename_base, size_t batchSize); + std::vector const& filtered_sources, cmValue beforeInclude, + cmValue afterInclude, std::string const& filename_base, size_t batchSize); std::vector AddUnityFilesModeGroup( cmGeneratorTarget* target, std::string const& lang, - std::vector const& filtered_sources, cmProp beforeInclude, - cmProp afterInclude, std::string const& filename_base); + std::vector const& filtered_sources, cmValue beforeInclude, + cmValue afterInclude, std::string const& filename_base); }; #if !defined(CMAKE_BOOTSTRAP) diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 9f8e7ed..a43faa7 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -27,7 +27,6 @@ #include "cmMessageType.h" #include "cmNinjaTargetGenerator.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" @@ -35,6 +34,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" #include "cmake.h" cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, @@ -311,7 +311,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - cmProp jobpools = + cmValue jobpools = this->GetCMakeInstance()->GetState()->GetGlobalProperty("JOB_POOLS"); if (!jobpools) { jobpools = this->GetMakefile()->GetDefinition("CMAKE_JOB_POOLS"); @@ -869,7 +869,7 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatements( std::string cmLocalNinjaGenerator::MakeCustomLauncher( cmCustomCommandGenerator const& ccg) { - cmProp property_value = this->Makefile->GetProperty("RULE_LAUNCH_CUSTOM"); + cmValue property_value = this->Makefile->GetProperty("RULE_LAUNCH_CUSTOM"); if (!cmNonempty(property_value)) { return std::string(); @@ -903,7 +903,7 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( void cmLocalNinjaGenerator::AdditionalCleanFiles(const std::string& config) { - if (cmProp prop_value = + if (cmValue prop_value = this->Makefile->GetProperty("ADDITIONAL_CLEAN_FILES")) { std::vector cleanFiles; { diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 0667c55..7e39b91 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -33,7 +33,6 @@ #include "cmMakefile.h" #include "cmMakefileTargetGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" @@ -43,6 +42,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTargetDepend.h" +#include "cmValue.h" #include "cmVersion.h" #include "cmake.h" @@ -570,7 +570,7 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule( // Mark the rule as symbolic if requested. if (symbolic) { - if (cmProp sym = + if (cmValue sym = this->Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE")) { os << tgt << space << ": " << *sym << "\n"; } @@ -884,7 +884,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepend( { // Add a dependency on the rule file itself unless an option to skip // it is specifically enabled by the user or project. - cmProp nodep = this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY"); + cmValue nodep = this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY"); if (cmIsOff(nodep)) { depends.emplace_back(ruleFileName); } @@ -999,7 +999,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( std::string launcher; // Short-circuit if there is no launcher. - cmProp val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM"); + cmValue val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM"); if (cmNonempty(val)) { // Expand rule variables referenced in the given launcher command. cmRulePlaceholderExpander::RuleVariables vars; @@ -1125,7 +1125,7 @@ void cmLocalUnixMakefileGenerator3::AppendDirectoryCleanCommand( { std::vector cleanFiles; // Look for additional files registered for cleaning in this directory. - if (cmProp prop_value = + if (cmValue prop_value = this->Makefile->GetProperty("ADDITIONAL_CLEAN_FILES")) { cmExpandList(cmGeneratorExpression::Evaluate( *prop_value, this, @@ -1501,18 +1501,18 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( // Lookup useful directory information. if (haveDirectoryInfo) { // Test whether we need to force Unix paths. - if (cmProp force = mf->GetDefinition("CMAKE_FORCE_UNIX_PATHS")) { + if (cmValue force = mf->GetDefinition("CMAKE_FORCE_UNIX_PATHS")) { if (!cmIsOff(force)) { cmSystemTools::SetForceUnixPaths(true); } } // Setup relative path top directories. - if (cmProp relativePathTopSource = + if (cmValue relativePathTopSource = mf->GetDefinition("CMAKE_RELATIVE_PATH_TOP_SOURCE")) { this->SetRelativePathTopSource(*relativePathTopSource); } - if (cmProp relativePathTopBinary = + if (cmValue relativePathTopBinary = mf->GetDefinition("CMAKE_RELATIVE_PATH_TOP_BINARY")) { this->SetRelativePathTopBinary(*relativePathTopBinary); } @@ -1582,7 +1582,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose) cmMakefile* mf = this->Makefile; // Get the string listing the multiple output pairs. - cmProp pairs_string = mf->GetDefinition("CMAKE_MULTIPLE_OUTPUT_PAIRS"); + cmValue pairs_string = mf->GetDefinition("CMAKE_MULTIPLE_OUTPUT_PAIRS"); if (!pairs_string) { return; } @@ -1654,7 +1654,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( std::vector commands; std::vector depends; - cmProp p = gt->GetProperty("EchoString"); + cmValue p = gt->GetProperty("EchoString"); const char* text = p ? p->c_str() : "Running external command ..."; depends.reserve(gt->GetUtilities().size()); for (BT> const& u : gt->GetUtilities()) { @@ -1754,7 +1754,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( recursiveTarget = cmStrCat(this->GetCurrentBinaryDirectory(), "/preinstall"); commands.clear(); depends.clear(); - cmProp noall = + cmValue noall = this->Makefile->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"); if (cmIsOff(noall)) { // Drive the build before installing. @@ -1804,7 +1804,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf, bool verbose) { // Get the list of target files to check - cmProp infoDef = mf->GetDefinition("CMAKE_DEPEND_INFO_FILES"); + cmValue infoDef = mf->GetDefinition("CMAKE_DEPEND_INFO_FILES"); if (!infoDef) { return; } @@ -1903,7 +1903,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( // Tell the dependency scanner what compiler is used. std::string cidVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID"); - cmProp cid = this->Makefile->GetDefinition(cidVar); + cmValue cid = this->Makefile->GetDefinition(cidVar); if (cmNonempty(cid)) { cmakefileStream << "set(CMAKE_" << lang << "_COMPILER_ID \"" << *cid << "\")\n"; @@ -1960,11 +1960,11 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( // Store include transform rule properties. Write the directory // rules first because they may be overridden by later target rules. std::vector transformRules; - if (cmProp xform = + if (cmValue xform = this->Makefile->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) { cmExpandList(*xform, transformRules); } - if (cmProp xform = + if (cmValue xform = target->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) { cmExpandList(*xform, transformRules); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 7b5fed6..9ad5f56 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -69,7 +69,7 @@ void cmLocalVisualStudio7Generator::AddHelperCommands() if (!l->IsInBuildSystem()) { continue; } - cmProp path = l->GetProperty("EXTERNAL_MSPROJECT"); + cmValue path = l->GetProperty("EXTERNAL_MSPROJECT"); if (path) { this->ReadAndStoreExternalGUID(l->GetName(), path->c_str()); } @@ -582,7 +582,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( const std::string& libName, cmGeneratorTarget* target) { std::string mfcFlag; - if (cmProp p = this->Makefile->GetDefinition("CMAKE_MFC_FLAG")) { + if (cmValue p = this->Makefile->GetDefinition("CMAKE_MFC_FLAG")) { mfcFlag = cmGeneratorExpression::Evaluate(*p, this, configName); } else { mfcFlag = "0"; @@ -781,7 +781,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( fout << "\t\t\tFortranProject) { - cmProp target_mod_dir = target->GetProperty("Fortran_MODULE_DIRECTORY"); + cmValue target_mod_dir = target->GetProperty("Fortran_MODULE_DIRECTORY"); std::string modDir; if (target_mod_dir) { modDir = this->MaybeRelativeToCurBinDir(*target_mod_dir); @@ -938,7 +938,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( " " + GetBuildTypeLinkerFlags("CMAKE_MODULE_LINKER_FLAGS", configName); } - cmProp targetLinkFlags = target->GetProperty("LINK_FLAGS"); + cmValue targetLinkFlags = target->GetProperty("LINK_FLAGS"); if (targetLinkFlags) { extraLinkOptions += " "; extraLinkOptions += *targetLinkFlags; @@ -1077,7 +1077,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( } } std::string stackVar = cmStrCat("CMAKE_", linkLanguage, "_STACK_SIZE"); - cmProp stackVal = this->Makefile->GetDefinition(stackVar); + cmValue stackVal = this->Makefile->GetDefinition(stackVar); if (stackVal) { fout << "\t\t\t\tStackReserveSize=\"" << *stackVal << "\"\n"; } @@ -1168,7 +1168,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( << "\"\n"; } std::string stackVar = cmStrCat("CMAKE_", linkLanguage, "_STACK_SIZE"); - cmProp stackVal = this->Makefile->GetDefinition(stackVar); + cmValue stackVal = this->Makefile->GetDefinition(stackVar); if (stackVal) { fout << "\t\t\t\tStackReserveSize=\"" << *stackVal << "\""; } @@ -1209,8 +1209,8 @@ void cmLocalVisualStudio7Generator::OutputDeploymentDebuggerTool( std::ostream& fout, std::string const& config, cmGeneratorTarget* target) { if (this->WindowsCEProject) { - cmProp dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY"); - cmProp additionalFiles = + cmValue dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY"); + cmValue additionalFiles = target->GetProperty("DEPLOYMENT_ADDITIONAL_FILES"); if (!dir && !additionalFiles) { @@ -1447,12 +1447,12 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( needfc = true; } const std::string COMPILE_FLAGS("COMPILE_FLAGS"); - if (cmProp cflags = sf.GetProperty(COMPILE_FLAGS)) { + if (cmValue cflags = sf.GetProperty(COMPILE_FLAGS)) { fc.CompileFlags = genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS); needfc = true; } const std::string COMPILE_OPTIONS("COMPILE_OPTIONS"); - if (cmProp coptions = sf.GetProperty(COMPILE_OPTIONS)) { + if (cmValue coptions = sf.GetProperty(COMPILE_OPTIONS)) { lg->AppendCompileOptions( fc.CompileFlags, genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS)); @@ -1504,25 +1504,25 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( } } const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); - if (cmProp cdefs = sf.GetProperty(COMPILE_DEFINITIONS)) { + if (cmValue cdefs = sf.GetProperty(COMPILE_DEFINITIONS)) { fc.CompileDefs = genexInterpreter.Evaluate(*cdefs, COMPILE_DEFINITIONS); needfc = true; } std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", configUpper); - if (cmProp ccdefs = sf.GetProperty(defPropName)) { + if (cmValue ccdefs = sf.GetProperty(defPropName)) { fc.CompileDefsConfig = genexInterpreter.Evaluate(*ccdefs, COMPILE_DEFINITIONS); needfc = true; } const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); - if (cmProp cincs = sf.GetProperty(INCLUDE_DIRECTORIES)) { + if (cmValue cincs = sf.GetProperty(INCLUDE_DIRECTORIES)) { fc.IncludeDirs = genexInterpreter.Evaluate(*cincs, INCLUDE_DIRECTORIES); needfc = true; } // Check for extra object-file dependencies. - if (cmProp deps = sf.GetProperty("OBJECT_DEPENDS")) { + if (cmValue deps = sf.GetProperty("OBJECT_DEPENDS")) { std::vector depends = cmExpandedList(*deps); const char* sep = ""; for (const std::string& d : depends) { @@ -1897,9 +1897,9 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout, { // if we have all the required Source code control tags // then add that to the project - cmProp vsProjectname = target->GetProperty("VS_SCC_PROJECTNAME"); - cmProp vsLocalpath = target->GetProperty("VS_SCC_LOCALPATH"); - cmProp vsProvider = target->GetProperty("VS_SCC_PROVIDER"); + cmValue vsProjectname = target->GetProperty("VS_SCC_PROJECTNAME"); + cmValue vsLocalpath = target->GetProperty("VS_SCC_LOCALPATH"); + cmValue vsProvider = target->GetProperty("VS_SCC_PROVIDER"); if (vsProvider && vsLocalpath && vsProjectname) { /* clang-format off */ @@ -1908,7 +1908,7 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout, << "\tSccProvider=\"" << *vsProvider << "\"\n"; /* clang-format on */ - cmProp vsAuxPath = target->GetProperty("VS_SCC_AUXPATH"); + cmValue vsAuxPath = target->GetProperty("VS_SCC_AUXPATH"); if (vsAuxPath) { fout << "\tSccAuxPath=\"" << *vsAuxPath << "\"\n"; } @@ -1928,7 +1928,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStartFortran( << "\tProjectCreator=\"Intel Fortran\"\n" << "\tVersion=\"" << gg->GetIntelProjectVersion() << "\"\n"; /* clang-format on */ - cmProp p = target->GetProperty("VS_KEYWORD"); + cmValue p = target->GetProperty("VS_KEYWORD"); const char* keyword = p ? p->c_str() : "Console Application"; const char* projectType = 0; switch (target->GetType()) { @@ -1990,14 +1990,14 @@ void cmLocalVisualStudio7Generator::WriteProjectStart( << "\tProjectType=\"Visual C++\"\n"; /* clang-format on */ fout << "\tVersion=\"" << (gg->GetVersion() / 10) << ".00\"\n"; - cmProp p = target->GetProperty("PROJECT_LABEL"); + cmValue p = target->GetProperty("PROJECT_LABEL"); const std::string projLabel = p ? *p : libName; p = target->GetProperty("VS_KEYWORD"); const std::string keyword = p ? *p : "Win32Proj"; fout << "\tName=\"" << projLabel << "\"\n"; fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n"; this->WriteProjectSCC(fout, target); - if (cmProp targetFrameworkVersion = + if (cmValue targetFrameworkVersion = target->GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) { fout << "\tTargetFrameworkVersion=\"" << *targetFrameworkVersion << "\"\n"; } diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index acddfe1..4ed1dd9 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -173,7 +173,8 @@ std::string cmLocalVisualStudioGenerator::ConstructScript( // for visual studio IDE add extra stuff to the PATH // if CMAKE_MSVCIDE_RUN_PATH is set. if (this->GetGlobalGenerator()->IsVisualStudio()) { - cmProp extraPath = this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH"); + cmValue extraPath = + this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH"); if (extraPath) { script += newline; newline = newline_text; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 78c7246..1744534 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -190,7 +190,7 @@ void cmMakefile::MaybeWarnCMP0074(std::string const& pkg) { // Warn if a _ROOT variable we may use is set. std::string const varName = pkg + "_ROOT"; - cmProp var = this->GetDefinition(varName); + cmValue var = this->GetDefinition(varName); std::string env; cmSystemTools::GetEnv(varName, env); @@ -400,7 +400,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, // Check for maximum recursion depth. int depth = CMake_DEFAULT_RECURSION_LIMIT; - cmProp depthStr = this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH"); + cmValue depthStr = this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH"); if (depthStr) { std::istringstream s(*depthStr); int d; @@ -586,7 +586,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() bool cmMakefile::ReadDependentFile(const std::string& filename, bool noPolicyScope) { - if (cmProp def = this->GetDefinition("CMAKE_CURRENT_LIST_FILE")) { + if (cmValue def = this->GetDefinition("CMAKE_CURRENT_LIST_FILE")) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", *def); } std::string filenametoread = cmSystemTools::CollapseFullPath( @@ -924,7 +924,7 @@ void cmMakefile::DoGenerate(cmLocalGenerator& lg) void cmMakefile::Generate(cmLocalGenerator& lg) { this->DoGenerate(lg); - cmProp oldValue = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); + cmValue oldValue = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); if (oldValue && cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, oldValue, "2.4")) { this->GetCMakeInstance()->IssueMessage( @@ -1405,7 +1405,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove) const char* define = def.c_str() + 2; if (remove) { - if (cmProp cdefs = this->GetProperty("COMPILE_DEFINITIONS")) { + if (cmValue cdefs = this->GetProperty("COMPILE_DEFINITIONS")) { // Expand the list. std::vector defs = cmExpandedList(*cdefs); @@ -1449,7 +1449,7 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) for (std::string const& config : configs) { std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(config)); - cmProp prop = parent->GetProperty(defPropName); + cmValue prop = parent->GetProperty(defPropName); this->SetProperty(defPropName, prop); } } @@ -1897,7 +1897,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, cmStateEnums::CacheEntryType type, bool force) { - cmProp existingValue = this->GetState()->GetInitializedCacheValue(name); + cmValue existingValue = this->GetState()->GetInitializedCacheValue(name); // must be outside the following if() to keep it alive long enough std::string nvalue; @@ -2015,7 +2015,7 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target) default:; } - if (cmProp linkLibsProp = this->GetProperty("LINK_LIBRARIES")) { + if (cmValue linkLibsProp = this->GetProperty("LINK_LIBRARIES")) { std::vector linkLibs = cmExpandedList(*linkLibsProp); for (auto j = linkLibs.begin(); j != linkLibs.end(); ++j) { @@ -2213,7 +2213,7 @@ cmSourceGroup* cmMakefile::GetOrCreateSourceGroup( cmSourceGroup* cmMakefile::GetOrCreateSourceGroup(const std::string& name) { std::string delimiters; - if (cmProp p = this->GetDefinition("SOURCE_GROUP_DELIMITER")) { + if (cmValue p = this->GetDefinition("SOURCE_GROUP_DELIMITER")) { delimiters = *p; } else { delimiters = "/\\"; @@ -2266,7 +2266,7 @@ void cmMakefile::ExpandVariablesCMP0019() } std::ostringstream w; - cmProp includeDirs = this->GetProperty("INCLUDE_DIRECTORIES"); + cmValue includeDirs = this->GetProperty("INCLUDE_DIRECTORIES"); if (includeDirs && mightExpandVariablesCMP0019(includeDirs->c_str())) { std::string dirs = *includeDirs; this->ExpandVariablesInString(dirs, true, true); @@ -2304,7 +2304,7 @@ void cmMakefile::ExpandVariablesCMP0019() } } - if (cmProp linkDirsProp = this->GetProperty("LINK_DIRECTORIES")) { + if (cmValue linkDirsProp = this->GetProperty("LINK_DIRECTORIES")) { if (mightExpandVariablesCMP0019(linkDirsProp->c_str())) { std::string d = *linkDirsProp; const std::string orig = d; @@ -2320,7 +2320,7 @@ void cmMakefile::ExpandVariablesCMP0019() } } - if (cmProp linkLibsProp = this->GetProperty("LINK_LIBRARIES")) { + if (cmValue linkLibsProp = this->GetProperty("LINK_LIBRARIES")) { std::vector linkLibs = cmExpandedList(*linkLibsProp); for (auto l = linkLibs.begin(); l != linkLibs.end(); ++l) { @@ -2364,7 +2364,7 @@ bool cmMakefile::IsOn(const std::string& name) const bool cmMakefile::IsSet(const std::string& name) const { - cmProp value = this->GetDefinition(name); + cmValue value = this->GetDefinition(name); if (!value) { return false; } @@ -2382,12 +2382,12 @@ bool cmMakefile::IsSet(const std::string& name) const bool cmMakefile::PlatformIs32Bit() const { - if (cmProp plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { + if (cmValue plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { if (*plat_abi == "ELF X32") { return false; } } - if (cmProp sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P")) { + if (cmValue sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P")) { return atoi(sizeof_dptr->c_str()) == 4; } return false; @@ -2395,7 +2395,7 @@ bool cmMakefile::PlatformIs32Bit() const bool cmMakefile::PlatformIs64Bit() const { - if (cmProp sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P")) { + if (cmValue sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P")) { return atoi(sizeof_dptr->c_str()) == 8; } return false; @@ -2403,7 +2403,7 @@ bool cmMakefile::PlatformIs64Bit() const bool cmMakefile::PlatformIsx32() const { - if (cmProp plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { + if (cmValue plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { if (*plat_abi == "ELF X32") { return true; } @@ -2476,7 +2476,7 @@ const std::string& cmMakefile::GetRequiredDefinition( const std::string& name) const { static std::string const empty; - cmProp def = this->GetDefinition(name); + cmValue def = this->GetDefinition(name); if (!def) { cmSystemTools::Error("Error required internal CMake variable not " "set, cmake may not be built correctly.\n" @@ -2489,7 +2489,7 @@ const std::string& cmMakefile::GetRequiredDefinition( bool cmMakefile::IsDefinitionSet(const std::string& name) const { - cmProp def = this->StateSnapshot.GetDefinition(name); + cmValue def = this->StateSnapshot.GetDefinition(name); if (!def) { def = this->GetState()->GetInitializedCacheValue(name); } @@ -2506,7 +2506,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const bool cmMakefile::IsNormalDefinitionSet(const std::string& name) const { - cmProp def = this->StateSnapshot.GetDefinition(name); + cmValue def = this->StateSnapshot.GetDefinition(name); #ifndef CMAKE_BOOTSTRAP if (cmVariableWatch* vv = this->GetVariableWatch()) { if (!def) { @@ -2518,9 +2518,9 @@ bool cmMakefile::IsNormalDefinitionSet(const std::string& name) const return def != nullptr; } -cmProp cmMakefile::GetDefinition(const std::string& name) const +cmValue cmMakefile::GetDefinition(const std::string& name) const { - cmProp def = this->StateSnapshot.GetDefinition(name); + cmValue def = this->StateSnapshot.GetDefinition(name); if (!def) { def = this->GetState()->GetInitializedCacheValue(name); } @@ -2556,7 +2556,7 @@ bool cmMakefile::GetDefExpandList(const std::string& name, std::vector& out, bool emptyArgs) const { - cmProp def = this->GetDefinition(name); + cmValue def = this->GetDefinition(name); if (!def) { return false; } @@ -2709,7 +2709,7 @@ MessageType cmMakefile::ExpandVariablesInStringOld( // Lookup the definition of VAR. std::string var(first + 1, last - first - 2); - if (cmProp val = this->GetDefinition(var)) { + if (cmValue val = this->GetDefinition(var)) { // Store the value in the output escaping as requested. if (escapeQuotes) { source.append(cmEscapeQuotes(*val)); @@ -2914,7 +2914,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew( openstack.pop_back(); result.append(last, in - last); std::string const& lookup = result.substr(var.loc); - cmProp value = nullptr; + cmValue value = nullptr; std::string varresult; std::string svalue; switch (var.domain) { @@ -2932,7 +2932,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew( break; case ENVIRONMENT: if (cmSystemTools::GetEnv(lookup, svalue)) { - value = cmProp(svalue); + value = cmValue(svalue); } break; case CACHE: @@ -3059,7 +3059,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew( if (filename && variable == lineVar) { varresult = std::to_string(line); } else { - cmProp def = this->GetDefinition(variable); + cmValue def = this->GetDefinition(variable); if (def) { varresult = *def; } else if (!this->SuppressSideEffects) { @@ -3555,7 +3555,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, cm.SetGeneratorToolset(this->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET")); cm.LoadCache(); if (!cm.GetGlobalGenerator()->IsMultiConfig()) { - if (cmProp config = + if (cmValue config = this->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION")) { // Tell the single-configuration generator which one to use. // Add this before the user-provided CMake arguments in case @@ -3564,7 +3564,8 @@ int cmMakefile::TryCompile(const std::string& srcdir, cmStateEnums::STRING); } } - cmProp recursionDepth = this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH"); + cmValue recursionDepth = + this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH"); if (recursionDepth) { cm.AddCacheEntry("CMAKE_MAXIMUM_RECURSION_DEPTH", recursionDepth, "Maximum recursion depth", cmStateEnums::STRING); @@ -3699,7 +3700,7 @@ std::string cmMakefile::GetModulesFile(const std::string& filename, std::string moduleInCMakeModulePath; // Always search in CMAKE_MODULE_PATH: - cmProp cmakeModulePath = this->GetDefinition("CMAKE_MODULE_PATH"); + cmValue cmakeModulePath = this->GetDefinition("CMAKE_MODULE_PATH"); if (cmakeModulePath) { std::vector modulePath = cmExpandedList(*cmakeModulePath); @@ -3740,7 +3741,7 @@ std::string cmMakefile::GetModulesFile(const std::string& filename, } if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) { - cmProp currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE"); + cmValue currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE"); std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/"; if (currentFile && cmSystemTools::IsSubDirectory(*currentFile, mods)) { switch (this->GetPolicyStatus(cmPolicies::CMP0017)) { @@ -3797,7 +3798,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, // Replace #cmakedefine instances. if (this->cmDefineRegex.find(line)) { - cmProp def = this->GetDefinition(this->cmDefineRegex.match(2)); + cmValue def = this->GetDefinition(this->cmDefineRegex.match(2)); if (!cmIsOff(def)) { const std::string indentation = this->cmDefineRegex.match(1); cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine", @@ -3810,7 +3811,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, } } else if (this->cmDefine01Regex.find(line)) { const std::string indentation = this->cmDefine01Regex.match(1); - cmProp def = this->GetDefinition(this->cmDefine01Regex.match(2)); + cmValue def = this->GetDefinition(this->cmDefine01Regex.match(2)); cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01", "#" + indentation + "define"); output += line; @@ -3956,7 +3957,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value) { this->StateSnapshot.GetDirectory().SetProperty(prop, value, this->Backtrace); } -void cmMakefile::SetProperty(const std::string& prop, cmProp value) +void cmMakefile::SetProperty(const std::string& prop, cmValue value) { this->StateSnapshot.GetDirectory().SetProperty(prop, value, this->Backtrace); } @@ -3968,7 +3969,7 @@ void cmMakefile::AppendProperty(const std::string& prop, this->Backtrace); } -cmProp cmMakefile::GetProperty(const std::string& prop) const +cmValue cmMakefile::GetProperty(const std::string& prop) const { // Check for computed properties. static std::string output; @@ -3981,13 +3982,13 @@ cmProp cmMakefile::GetProperty(const std::string& prop) const return pair.first; }); output = cmJoin(keys, ";"); - return cmProp(output); + return cmValue(output); } return this->StateSnapshot.GetDirectory().GetProperty(prop); } -cmProp cmMakefile::GetProperty(const std::string& prop, bool chain) const +cmValue cmMakefile::GetProperty(const std::string& prop, bool chain) const { return this->StateSnapshot.GetDirectory().GetProperty(prop, chain); } @@ -4046,7 +4047,7 @@ void cmMakefile::GetTests(const std::string& config, void cmMakefile::AddCMakeDependFilesFromUser() { std::vector deps; - if (cmProp deps_str = this->GetProperty("CMAKE_CONFIGURE_DEPENDS")) { + if (cmValue deps_str = this->GetProperty("CMAKE_CONFIGURE_DEPENDS")) { cmExpandList(*deps_str, deps); } for (std::string const& dep : deps) { @@ -4335,7 +4336,7 @@ static std::string const nMatchesVariable = "CMAKE_MATCH_COUNT"; void cmMakefile::ClearMatches() { - cmProp nMatchesStr = this->GetDefinition(nMatchesVariable); + cmValue nMatchesStr = this->GetDefinition(nMatchesVariable); if (!nMatchesStr) { return; } @@ -4388,7 +4389,7 @@ cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id, bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) const { // Check for an explicit CMAKE_POLICY_WARNING_CMP setting. - if (cmProp val = this->GetDefinition(var)) { + if (cmValue val = this->GetDefinition(var)) { return cmIsOn(val); } // Enable optional policy warnings with --debug-output, --trace, diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index bad9d91..671cdab 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -29,10 +29,10 @@ #include "cmMessageType.h" #include "cmNewLineStyle.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmSourceFileLocationKind.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" +#include "cmValue.h" // IWYU does not see that 'std::unordered_map' // will not compile without the complete type. @@ -286,7 +286,7 @@ public: * can be used in CMake to refer to lists, directories, etc. */ void AddDefinition(const std::string& name, cm::string_view value); - void AddDefinition(const std::string& name, cmProp value) + void AddDefinition(const std::string& name, cmValue value) { this->AddDefinition(name, *value); } @@ -492,7 +492,7 @@ public: * If the variable is not found in this makefile instance, the * cache is then queried. */ - cmProp GetDefinition(const std::string&) const; + cmValue GetDefinition(const std::string&) const; const std::string& GetSafeDefinition(const std::string&) const; const std::string& GetRequiredDefinition(const std::string& name) const; bool IsDefinitionSet(const std::string&) const; @@ -772,15 +772,15 @@ public: //! Set/Get a property of this directory void SetProperty(const std::string& prop, const char* value); - void SetProperty(const std::string& prop, cmProp value); + void SetProperty(const std::string& prop, cmValue value); void SetProperty(const std::string& prop, const std::string& value) { - this->SetProperty(prop, cmProp(value)); + this->SetProperty(prop, cmValue(value)); } void AppendProperty(const std::string& prop, const std::string& value, bool asString = false); - cmProp GetProperty(const std::string& prop) const; - cmProp GetProperty(const std::string& prop, bool chain) const; + cmValue GetProperty(const std::string& prop) const; + cmValue GetProperty(const std::string& prop, bool chain) const; bool GetPropertyAsBool(const std::string& prop) const; std::vector GetPropertyKeys() const; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 306b38f..575fb05 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -21,7 +21,6 @@ #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" #include "cmStateDirectory.h" @@ -29,6 +28,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator( cmGeneratorTarget* target) @@ -228,8 +228,8 @@ void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule( std::string launcher; - cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, - "RULE_LAUNCH_LINK"); + cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); } @@ -577,7 +577,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } if (this->UseLWYU) { - cmProp lwyuCheck = + cmValue lwyuCheck = this->Makefile->GetDefinition("CMAKE_LINK_WHAT_YOU_USE_CHECK"); if (lwyuCheck) { std::string cmakeCommand = cmStrCat( @@ -592,8 +592,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string launcher; - cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, - "RULE_LAUNCH_LINK"); + cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 64992f2..ace73a7 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -21,7 +21,6 @@ #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" #include "cmStateDirectory.h" @@ -29,6 +28,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator( cmGeneratorTarget* target) @@ -362,8 +362,8 @@ void cmMakefileLibraryTargetGenerator::WriteNvidiaDeviceLibraryRules( vars.TargetCompilePDB = targetOutPathCompilePDB.c_str(); std::string launcher; - cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, - "RULE_LAUNCH_LINK"); + cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); } @@ -811,8 +811,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } std::string launcher; - cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, - "RULE_LAUNCH_LINK"); + cmValue val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); } @@ -872,7 +872,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::string linkRule = this->GetLinkRule(linkRuleVar); cmExpandList(linkRule, real_link_commands); if (this->UseLWYU) { - cmProp lwyuCheck = + cmValue lwyuCheck = this->Makefile->GetDefinition("CMAKE_LINK_WHAT_YOU_USE_CHECK"); if (lwyuCheck) { std::string cmakeCommand = cmStrCat( diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 70b6d27..0cbc741 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -34,7 +34,6 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" @@ -45,6 +44,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target) @@ -57,7 +57,8 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target) this->LocalGenerator->GetGlobalGenerator()); cmake* cm = this->GlobalGenerator->GetCMakeInstance(); this->NoRuleMessages = false; - if (cmProp ruleStatus = cm->GetState()->GetGlobalProperty("RULE_MESSAGES")) { + if (cmValue ruleStatus = + cm->GetState()->GetGlobalProperty("RULE_MESSAGES")) { this->NoRuleMessages = cmIsOff(*ruleStatus); } switch (this->GeneratorTarget->GetPolicyStatusCMP0113()) { @@ -200,14 +201,14 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() }; // Look for additional files registered for cleaning in this directory. - if (cmProp prop_value = + if (cmValue prop_value = this->Makefile->GetProperty("ADDITIONAL_MAKE_CLEAN_FILES")) { std::vector const files = evaluatedFiles(*prop_value); this->CleanFiles.insert(files.begin(), files.end()); } // Look for additional files registered for cleaning in this target. - if (cmProp prop_value = + if (cmValue prop_value = this->GeneratorTarget->GetProperty("ADDITIONAL_CLEAN_FILES")) { std::vector const files = evaluatedFiles(*prop_value); // For relative path support @@ -287,7 +288,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() this->GeneratorTarget->GetExtraSources(extraSources, this->GetConfigName()); this->OSXBundleGenerator->GenerateMacOSXContentStatements( extraSources, this->MacOSXContentGenerator.get(), this->GetConfigName()); - cmProp pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); + cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); std::vector externalObjects; this->GeneratorTarget->GetExternalObjects(externalObjects, this->GetConfigName()); @@ -668,12 +669,12 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( cmSystemTools::GetFilenameWithoutLastExtension(objectName); ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource); - cmProp ispcSuffixProp = + cmValue ispcSuffixProp = this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX"); assert(ispcSuffixProp); std::string directory = this->GeneratorTarget->GetObjectDirectory(config); - if (cmProp prop = + if (cmValue prop = this->GeneratorTarget->GetProperty("ISPC_HEADER_DIRECTORY")) { directory = cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', *prop); @@ -685,7 +686,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Add flags from source file properties. const std::string COMPILE_FLAGS("COMPILE_FLAGS"); - if (cmProp cflags = source.GetProperty(COMPILE_FLAGS)) { + if (cmValue cflags = source.GetProperty(COMPILE_FLAGS)) { const std::string& evaluatedFlags = genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS); this->LocalGenerator->AppendFlags(flags, evaluatedFlags); @@ -695,7 +696,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( } const std::string COMPILE_OPTIONS("COMPILE_OPTIONS"); - if (cmProp coptions = source.GetProperty(COMPILE_OPTIONS)) { + if (cmValue coptions = source.GetProperty(COMPILE_OPTIONS)) { const std::string& evaluatedOptions = genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS); this->LocalGenerator->AppendCompileOptions(flags, evaluatedOptions); @@ -729,7 +730,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::vector includes; const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); - if (cmProp cincludes = source.GetProperty(INCLUDE_DIRECTORIES)) { + if (cmValue cincludes = source.GetProperty(INCLUDE_DIRECTORIES)) { const std::string& evaluatedIncludes = genexInterpreter.Evaluate(*cincludes, INCLUDE_DIRECTORIES); this->LocalGenerator->AppendIncludeDirectories(includes, evaluatedIncludes, @@ -745,7 +746,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Add source-specific preprocessor definitions. const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); - if (cmProp compile_defs = source.GetProperty(COMPILE_DEFINITIONS)) { + if (cmValue compile_defs = source.GetProperty(COMPILE_DEFINITIONS)) { const std::string& evaluatedDefs = genexInterpreter.Evaluate(*compile_defs, COMPILE_DEFINITIONS); this->LocalGenerator->AppendDefines(defines, evaluatedDefs); @@ -754,7 +755,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( << "\n"; } std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", configUpper); - if (cmProp config_compile_defs = source.GetProperty(defPropName)) { + if (cmValue config_compile_defs = source.GetProperty(defPropName)) { const std::string& evaluatedDefs = genexInterpreter.Evaluate(*config_compile_defs, COMPILE_DEFINITIONS); this->LocalGenerator->AppendDefines(defines, evaluatedDefs); @@ -944,11 +945,11 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( this->GetIncludes(lang, this->GetConfigName())); } - cmProp eliminate[] = { + cmValue eliminate[] = { this->Makefile->GetDefinition("CMAKE_START_TEMP_FILE"), this->Makefile->GetDefinition("CMAKE_END_TEMP_FILE") }; - for (cmProp el : eliminate) { + for (cmValue el : eliminate) { if (el) { cmSystemTools::ReplaceString(compileCommand, *el, ""); } @@ -965,7 +966,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( lang == "HIP" || lang == "ISPC" || lang == "OBJC" || lang == "OBJCXX")) { std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER"; - cmProp clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); + cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); if (cmNonempty(clauncher)) { compilerLauncher = *clauncher; } @@ -975,10 +976,10 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( if (!compileCommands.empty() && (lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX")) { std::string const tidy_prop = lang + "_CLANG_TIDY"; - cmProp tidy = this->GeneratorTarget->GetProperty(tidy_prop); - cmProp iwyu = nullptr; - cmProp cpplint = nullptr; - cmProp cppcheck = nullptr; + cmValue tidy = this->GeneratorTarget->GetProperty(tidy_prop); + cmValue iwyu = nullptr; + cmValue cpplint = nullptr; + cmValue cppcheck = nullptr; if (lang == "C" || lang == "CXX") { std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE"; iwyu = this->GeneratorTarget->GetProperty(iwyu_prop); @@ -1003,7 +1004,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Only add --driver-mode if it is not already specified, as adding // it unconditionally might override a user-specified driver-mode if (iwyu.Get()->find("--driver-mode=") == std::string::npos) { - cmProp p = this->Makefile->GetDefinition( + cmValue p = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_INCLUDE_WHAT_YOU_USE_DRIVER_MODE")); std::string driverMode; @@ -1021,8 +1022,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( } if (cmNonempty(tidy)) { run_iwyu += " --tidy="; - cmProp p = this->Makefile->GetDefinition("CMAKE_" + lang + - "_CLANG_TIDY_DRIVER_MODE"); + cmValue p = this->Makefile->GetDefinition("CMAKE_" + lang + + "_CLANG_TIDY_DRIVER_MODE"); std::string driverMode; if (cmNonempty(p)) { driverMode = *p; @@ -1066,7 +1067,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string launcher; { - cmProp val = this->LocalGenerator->GetRuleLauncher( + cmValue val = this->LocalGenerator->GetRuleLauncher( this->GeneratorTarget, "RULE_LAUNCH_COMPILE"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); @@ -1136,7 +1137,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Check for extra outputs created by the compilation. std::vector outputs(1, relativeObj); - if (cmProp extra_outputs_str = source.GetProperty("OBJECT_OUTPUTS")) { + if (cmValue extra_outputs_str = source.GetProperty("OBJECT_OUTPUTS")) { std::string evaluated_outputs = cmGeneratorExpression::Evaluate( *extra_outputs_str, this->LocalGenerator, config); @@ -1191,7 +1192,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string preprocessRuleVar = cmStrCat("CMAKE_", lang, "_CREATE_PREPROCESSED_SOURCE"); - if (cmProp preprocessRule = + if (cmValue preprocessRule = this->Makefile->GetDefinition(preprocessRuleVar)) { std::vector preprocessCommands = cmExpandedList(*preprocessRule); @@ -1236,7 +1237,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string assemblyRuleVar = cmStrCat("CMAKE_", lang, "_CREATE_ASSEMBLY_SOURCE"); - if (cmProp assemblyRule = + if (cmValue assemblyRule = this->Makefile->GetDefinition(assemblyRuleVar)) { std::vector assemblyCommands = cmExpandedList(*assemblyRule); @@ -1507,7 +1508,7 @@ void cmMakefileTargetGenerator::WriteObjectDependRules( // Create the list of dependencies known at cmake time. These are // shared between the object file and dependency scanning rule. depends.push_back(source.GetFullPath()); - if (cmProp objectDeps = source.GetProperty("OBJECT_DEPENDS")) { + if (cmValue objectDeps = source.GetProperty("OBJECT_DEPENDS")) { cmExpandList(*objectDeps, depends); } } @@ -1746,7 +1747,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable( std::string object; const auto& lineContinue = this->GlobalGenerator->LineContinueDirective; - cmProp pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); + cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); for (std::string const& obj : this->Objects) { if (cmHasSuffix(obj, pchExtension)) { @@ -1833,7 +1834,7 @@ private: void cmMakefileTargetGenerator::WriteObjectsStrings( std::vector& objStrings, std::string::size_type limit) { - cmProp pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); + cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); cmMakefileTargetGeneratorObjectStrings helper( objStrings, this->LocalGenerator, @@ -1968,7 +1969,7 @@ std::string cmMakefileTargetGenerator::GetLinkRule( cmStrCat("CMAKE_", this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName()), "_GNUtoMS_RULE"); - if (cmProp rule = this->Makefile->GetDefinition(ruleVar)) { + if (cmValue rule = this->Makefile->GetDefinition(ruleVar)) { linkRule += *rule; } } @@ -2017,7 +2018,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects( // Check for an explicit setting one way or the other. std::string const responseVar = "CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_OBJECTS"; - if (cmProp val = this->Makefile->GetDefinition(responseVar)) { + if (cmValue val = this->Makefile->GetDefinition(responseVar)) { if (!val->empty()) { return cmIsOn(val); } @@ -2056,7 +2057,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForLibraries( // Check for an explicit setting one way or the other. std::string const responseVar = "CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_LIBRARIES"; - if (cmProp val = this->Makefile->GetDefinition(responseVar)) { + if (cmValue val = this->Makefile->GetDefinition(responseVar)) { if (!val->empty()) { return cmIsOn(val); } @@ -2120,7 +2121,7 @@ void cmMakefileTargetGenerator::CreateLinkLibs( this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName()), "_RESPONSE_FILE_LINK_FLAG"); std::string responseFlag; - if (cmProp p = this->Makefile->GetDefinition(responseFlagVar)) { + if (cmValue p = this->Makefile->GetDefinition(responseFlagVar)) { responseFlag = *p; } else { responseFlag = "@"; @@ -2160,7 +2161,7 @@ void cmMakefileTargetGenerator::CreateObjectLists( this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName()), "_RESPONSE_FILE_LINK_FLAG"); std::string responseFlag; - if (cmProp p = this->Makefile->GetDefinition(responseFlagVar)) { + if (cmValue p = this->Makefile->GetDefinition(responseFlagVar)) { responseFlag = *p; } else { responseFlag = "@"; @@ -2255,7 +2256,7 @@ void cmMakefileTargetGenerator::GenDefFile( cmd += this->LocalGenerator->ConvertToOutputFormat( this->LocalGenerator->MaybeRelativeToCurBinDir(objlist_file), cmOutputConverter::SHELL); - cmProp nm_executable = this->Makefile->GetDefinition("CMAKE_NM"); + cmValue nm_executable = this->Makefile->GetDefinition("CMAKE_NM"); if (cmNonempty(nm_executable)) { cmd += " --nm="; cmd += this->LocalCommonGenerator->ConvertToOutputFormat( diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 5908f74..73e5f33 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -6,11 +6,11 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" // cmMarkAsAdvancedCommand diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 96e9142..596084b 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -32,7 +32,6 @@ #include "cmNinjaTypes.h" #include "cmOSXBundleGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" @@ -41,6 +40,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator( cmGeneratorTarget* target) @@ -267,7 +267,7 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkRule( vars.LanguageCompileFlags = "$LANGUAGE_COMPILE_FLAGS"; std::string launcher; - cmProp val = this->GetLocalGenerator()->GetRuleLauncher( + cmValue val = this->GetLocalGenerator()->GetRuleLauncher( this->GetGeneratorTarget(), "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); @@ -390,7 +390,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile, // build response file name std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + cmValue flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); if (flag) { responseFlag = *flag; @@ -462,7 +462,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile, } std::string launcher; - cmProp val = this->GetLocalGenerator()->GetRuleLauncher( + cmValue val = this->GetLocalGenerator()->GetRuleLauncher( this->GetGeneratorTarget(), "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); @@ -569,20 +569,20 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd( // CMAKE__CREATE_STATIC_LIBRARY_IPO define instead. std::string linkCmdVar = this->GetGeneratorTarget()->GetCreateRuleVariable( this->TargetLinkLanguage(config), config); - cmProp linkCmd = mf->GetDefinition(linkCmdVar); + cmValue linkCmd = mf->GetDefinition(linkCmdVar); if (linkCmd) { std::string linkCmdStr = *linkCmd; if (this->GetGeneratorTarget()->HasImplibGNUtoMS(config)) { std::string ruleVar = cmStrCat("CMAKE_", this->GeneratorTarget->GetLinkerLanguage(config), "_GNUtoMS_RULE"); - if (cmProp rule = this->Makefile->GetDefinition(ruleVar)) { + if (cmValue rule = this->Makefile->GetDefinition(ruleVar)) { linkCmdStr += *rule; } } cmExpandList(linkCmdStr, linkCmds); if (this->UseLWYU) { - cmProp lwyuCheck = mf->GetDefinition("CMAKE_LINK_WHAT_YOU_USE_CHECK"); + cmValue lwyuCheck = mf->GetDefinition("CMAKE_LINK_WHAT_YOU_USE_CHECK"); if (lwyuCheck) { std::string cmakeCommand = cmStrCat( this->GetLocalGenerator()->ConvertToOutputFormat( @@ -1044,7 +1044,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( }(); vars["SWIFT_MODULE_NAME"] = [gt]() -> std::string { - if (cmProp name = gt->GetProperty("Swift_MODULE_NAME")) { + if (cmValue name = gt->GetProperty("Swift_MODULE_NAME")) { return *name; } return gt->GetName(); @@ -1053,13 +1053,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( vars["SWIFT_MODULE"] = [this](const std::string& module) -> std::string { std::string directory = this->GetLocalGenerator()->GetCurrentBinaryDirectory(); - if (cmProp prop = this->GetGeneratorTarget()->GetProperty( + if (cmValue prop = this->GetGeneratorTarget()->GetProperty( "Swift_MODULE_DIRECTORY")) { directory = *prop; } std::string name = module + ".swiftmodule"; - if (cmProp prop = + if (cmValue prop = this->GetGeneratorTarget()->GetProperty("Swift_MODULE")) { name = *prop; } @@ -1231,7 +1231,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( gt->GetFullNameComponents(prefix, base, suffix, config); std::string dbg_suffix = ".dbg"; // TODO: Where to document? - if (cmProp d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) { + if (cmValue d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) { dbg_suffix = *d; } vars["TARGET_PDB"] = base + suffix + dbg_suffix; @@ -1297,7 +1297,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( cmd += this->GetLocalGenerator()->ConvertToOutputFormat( obj_list_file, cmOutputConverter::SHELL); - cmProp nm_executable = this->GetMakefile()->GetDefinition("CMAKE_NM"); + cmValue nm_executable = this->GetMakefile()->GetDefinition("CMAKE_NM"); if (cmNonempty(nm_executable)) { cmd += " --nm="; cmd += this->LocalCommonGenerator->ConvertToOutputFormat( @@ -1351,7 +1351,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( // build response file name std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + cmValue flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); bool const lang_supports_response = !(this->TargetLinkLanguage(config) == "RC" || diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 7cc1581..57fc020 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -31,7 +31,6 @@ #include "cmNinjaNormalTargetGenerator.h" #include "cmNinjaUtilityTargetGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" @@ -40,6 +39,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" std::unique_ptr cmNinjaTargetGenerator::New( @@ -224,13 +224,13 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( this->LocalGenerator, config, this->GeneratorTarget, language); const std::string COMPILE_FLAGS("COMPILE_FLAGS"); - if (cmProp cflags = source->GetProperty(COMPILE_FLAGS)) { + if (cmValue cflags = source->GetProperty(COMPILE_FLAGS)) { this->LocalGenerator->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)) { this->LocalGenerator->AppendCompileOptions( flags, genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS)); } @@ -290,14 +290,14 @@ std::string cmNinjaTargetGenerator::ComputeDefines(cmSourceFile const* source, } const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); - if (cmProp compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) { + if (cmValue compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) { this->LocalGenerator->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)) { this->LocalGenerator->AppendDefines( defines, genexInterpreter.Evaluate(*config_compile_defs, COMPILE_DEFINITIONS)); @@ -318,7 +318,7 @@ std::string cmNinjaTargetGenerator::ComputeIncludes( this->LocalGenerator, config, this->GeneratorTarget, language); const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); - if (cmProp cincludes = source->GetProperty(INCLUDE_DIRECTORIES)) { + if (cmValue cincludes = source->GetProperty(INCLUDE_DIRECTORIES)) { this->LocalGenerator->AppendIncludeDirectories( includes, genexInterpreter.Evaluate(*cincludes, INCLUDE_DIRECTORIES), *source); @@ -638,7 +638,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, cmLocalGenerator::SHELL); std::string launcher; - cmProp val = this->GetLocalGenerator()->GetRuleLauncher( + cmValue val = this->GetLocalGenerator()->GetRuleLauncher( this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE"); if (cmNonempty(val)) { launcher = cmStrCat(*val, ' '); @@ -771,7 +771,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, if (!mf->GetIsSourceFileTryCompile()) { rule.DepType = "gcc"; rule.DepFile = "$DEP_FILE"; - cmProp d = mf->GetDefinition("CMAKE_C_COMPILER"); + cmValue d = mf->GetDefinition("CMAKE_C_COMPILER"); const std::string cl = d ? *d : mf->GetSafeDefinition("CMAKE_CXX_COMPILER"); std::string cmcldepsPath; @@ -843,7 +843,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, lang == "HIP" || lang == "ISPC" || lang == "OBJC" || lang == "OBJCXX")) { std::string const clauncher_prop = cmStrCat(lang, "_COMPILER_LAUNCHER"); - cmProp clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); + cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop); if (cmNonempty(clauncher)) { compilerLauncher = *clauncher; } @@ -853,10 +853,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, if (!compileCmds.empty() && (lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX")) { std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY"); - cmProp tidy = this->GeneratorTarget->GetProperty(tidy_prop); - cmProp iwyu = nullptr; - cmProp cpplint = nullptr; - cmProp cppcheck = nullptr; + cmValue tidy = this->GeneratorTarget->GetProperty(tidy_prop); + cmValue iwyu = nullptr; + cmValue cpplint = nullptr; + cmValue cppcheck = nullptr; if (lang == "C" || lang == "CXX") { std::string const iwyu_prop = cmStrCat(lang, "_INCLUDE_WHAT_YOU_USE"); iwyu = this->GeneratorTarget->GetProperty(iwyu_prop); @@ -882,7 +882,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, // Only add --driver-mode if it is not already specified, as adding // it unconditionally might override a user-specified driver-mode if (iwyu.Get()->find("--driver-mode=") == std::string::npos) { - cmProp p = this->Makefile->GetDefinition( + cmValue p = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_INCLUDE_WHAT_YOU_USE_DRIVER_MODE")); std::string driverMode; @@ -900,7 +900,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, } if (cmNonempty(tidy)) { run_iwyu += " --tidy="; - cmProp p = this->Makefile->GetDefinition( + cmValue p = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_CLANG_TIDY_DRIVER_MODE")); std::string driverMode; if (cmNonempty(p)) { @@ -1007,7 +1007,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( config); } if (firstForConfig) { - cmProp pchExtension = + cmValue pchExtension = this->GetMakefile()->GetDefinition("CMAKE_PCH_EXTENSION"); std::vector externalObjects; @@ -1112,7 +1112,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( "output-file-map.json"); std::string const targetSwiftDepsPath = [this, config]() -> std::string { cmGeneratorTarget const* target = this->GeneratorTarget; - if (cmProp name = target->GetProperty("Swift_DEPENDENCIES_FILE")) { + if (cmValue name = target->GetProperty("Swift_DEPENDENCIES_FILE")) { return *name; } return this->ConvertToNinjaPath( @@ -1236,7 +1236,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( // build response file name std::string cmakeLinkVar = cmStrCat(cmakeVarLang, "_RESPONSE_FILE_FLAG"); - cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + cmValue flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); bool const lang_supports_response = !(language == "RC" || (language == "CUDA" && !flag)); @@ -1278,7 +1278,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( objBuild.Outputs.push_back(objectFileName); if (firstForConfig) { - cmProp pchExtension = + cmValue pchExtension = this->GetMakefile()->GetDefinition("CMAKE_PCH_EXTENSION"); if (!cmHasSuffix(objectFileName, pchExtension)) { // Add this object to the list of object files. @@ -1318,7 +1318,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( } } - if (cmProp objectDeps = source->GetProperty("OBJECT_DEPENDS")) { + if (cmValue objectDeps = source->GetProperty("OBJECT_DEPENDS")) { std::vector objDepList = cmExpandedList(*objectDeps); std::copy(objDepList.begin(), objDepList.end(), std::back_inserter(depList)); @@ -1464,13 +1464,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( cmSystemTools::GetFilenameWithoutLastExtension(objectName); ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource); - cmProp ispcSuffixProp = + cmValue ispcSuffixProp = this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX"); assert(ispcSuffixProp); std::string ispcHeaderDirectory = this->GeneratorTarget->GetObjectDirectory(config); - if (cmProp prop = + if (cmValue prop = this->GeneratorTarget->GetProperty("ISPC_HEADER_DIRECTORY")) { ispcHeaderDirectory = cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', *prop); @@ -1521,7 +1521,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( objBuild, commandLineLengthLimit); } - if (cmProp objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) { + if (cmValue objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) { std::string evaluatedObjectOutputs = cmGeneratorExpression::Evaluate( *objectOutputs, this->LocalGenerator, config); @@ -1601,13 +1601,13 @@ void cmNinjaTargetGenerator::EmitSwiftDependencyInfo( std::string const objectFilePath = this->ConvertToNinjaPath(this->GetObjectFilePath(source, config)); std::string const swiftDepsPath = [source, objectFilePath]() -> std::string { - if (cmProp name = source->GetProperty("Swift_DEPENDENCIES_FILE")) { + if (cmValue name = source->GetProperty("Swift_DEPENDENCIES_FILE")) { return *name; } return cmStrCat(objectFilePath, ".swiftdeps"); }(); std::string const swiftDiaPath = [source, objectFilePath]() -> std::string { - if (cmProp name = source->GetProperty("Swift_DIAGNOSTICS_FILE")) { + if (cmValue name = source->GetProperty("Swift_DIAGNOSTICS_FILE")) { return *name; } return cmStrCat(objectFilePath, ".dia"); @@ -1715,7 +1715,7 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand( void cmNinjaTargetGenerator::AdditionalCleanFiles(const std::string& config) { - if (cmProp prop_value = + if (cmValue prop_value = this->GeneratorTarget->GetProperty("ADDITIONAL_CLEAN_FILES")) { cmLocalNinjaGenerator* lg = this->LocalGenerator; std::vector cleanFiles; @@ -1805,7 +1805,7 @@ void cmNinjaTargetGenerator::addPoolNinjaVariable( const std::string& pool_property, cmGeneratorTarget* target, cmNinjaVars& vars) { - cmProp pool = target->GetProperty(pool_property); + cmValue pool = target->GetProperty(pool_property); if (pool) { vars["pool"] = *pool; } diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 1f5a7ff..15197ba 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -18,12 +18,12 @@ #include "cmLocalNinjaGenerator.h" #include "cmNinjaTypes.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmSourceFile.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator( cmGeneratorTarget* target) @@ -141,7 +141,7 @@ void cmNinjaUtilityTargetGenerator::WriteUtilBuildStatements( std::string command = lg->BuildCommandLine( commands, config, fileConfig, "utility", this->GeneratorTarget); std::string desc; - cmProp echoStr = genTarget->GetProperty("EchoString"); + cmValue echoStr = genTarget->GetProperty("EchoString"); if (echoStr) { desc = *echoStr; } else { diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 014da4d..2c4a774 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -6,11 +6,11 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" +#include "cmValue.h" // cmOptionCommand bool cmOptionCommand(std::vector const& args, @@ -53,7 +53,7 @@ bool cmOptionCommand(std::vector const& args, // See if a cache variable with this name already exists // If so just make sure the doc state is correct cmState* state = status.GetMakefile().GetState(); - cmProp existingValue = state->GetCacheEntryValue(args[0]); + cmValue existingValue = state->GetCacheEntryValue(args[0]); if (existingValue && (state->GetCacheEntryType(args[0]) != cmStateEnums::UNINITIALIZED)) { state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index d589614..ad276d2 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -15,11 +15,11 @@ #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmSourceFile.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" namespace { /** \class cmDependInformation @@ -118,7 +118,7 @@ public: std::set uniqueIncludes; std::vector orderedAndUniqueIncludes; for (auto const& target : this->Makefile->GetTargets()) { - cmProp incDirProp = target.second.GetProperty("INCLUDE_DIRECTORIES"); + cmValue incDirProp = target.second.GetProperty("INCLUDE_DIRECTORIES"); if (!incDirProp) { continue; } diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 2465069..9f3fd00 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -13,10 +13,10 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" static std::string EscapeArg(const std::string& arg) { @@ -196,7 +196,7 @@ bool cmParseArgumentsCommand(std::vector const& args, for (unsigned long i = argvStart; i < count; ++i) { std::ostringstream argName; argName << "ARGV" << i; - cmProp arg = status.GetMakefile().GetDefinition(argName.str()); + cmValue arg = status.GetMakefile().GetDefinition(argName.str()); if (!arg) { status.GetMakefile().IssueMessage(MessageType::FATAL_ERROR, "PARSE_ARGV called with " + diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index fc839c5..23000fa 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -10,12 +10,12 @@ #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.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" static bool stringToId(const char* input, cmPolicies::PolicyID& pid) diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 6950c19..20fcdbe 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -15,10 +15,10 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" static bool IncludeByVariable(cmExecutionStatus& status, const std::string& variable); @@ -308,7 +308,7 @@ bool cmProjectCommand(std::vector const& args, } std::string vw; for (std::string const& i : vv) { - cmProp v = mf.GetDefinition(i); + cmValue v = mf.GetDefinition(i); if (cmNonempty(v)) { if (cmp0048 == cmPolicies::WARN) { if (!injectedProjectCommand) { @@ -358,7 +358,7 @@ static bool IncludeByVariable(cmExecutionStatus& status, const std::string& variable) { cmMakefile& mf = status.GetMakefile(); - cmProp include = mf.GetDefinition(variable); + cmValue include = mf.GetDefinition(variable); if (!include) { return true; } diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx deleted file mode 100644 index d012630..0000000 --- a/Source/cmProperty.cxx +++ /dev/null @@ -1,113 +0,0 @@ - -#include "cmProperty.h" - -#include - -#include - -#include "cmStringAlgorithms.h" - -std::string cmProp::Empty; - -bool cmProp::IsOn(cm::string_view value) noexcept -{ - switch (value.size()) { - case 1: - return value[0] == '1' || value[0] == 'Y' || value[0] == 'y'; - case 2: - return // - (value[0] == 'O' || value[0] == 'o') && // - (value[1] == 'N' || value[1] == 'n'); - case 3: - return // - (value[0] == 'Y' || value[0] == 'y') && // - (value[1] == 'E' || value[1] == 'e') && // - (value[2] == 'S' || value[2] == 's'); - case 4: - return // - (value[0] == 'T' || value[0] == 't') && // - (value[1] == 'R' || value[1] == 'r') && // - (value[2] == 'U' || value[2] == 'u') && // - (value[3] == 'E' || value[3] == 'e'); - default: - break; - } - - return false; -} - -bool cmProp::IsOff(cm::string_view value) noexcept -{ - switch (value.size()) { - case 0: - return true; - case 1: - return value[0] == '0' || value[0] == 'N' || value[0] == 'n'; - case 2: - return // - (value[0] == 'N' || value[0] == 'n') && // - (value[1] == 'O' || value[1] == 'o'); - case 3: - return // - (value[0] == 'O' || value[0] == 'o') && // - (value[1] == 'F' || value[1] == 'f') && // - (value[2] == 'F' || value[2] == 'f'); - case 5: - return // - (value[0] == 'F' || value[0] == 'f') && // - (value[1] == 'A' || value[1] == 'a') && // - (value[2] == 'L' || value[2] == 'l') && // - (value[3] == 'S' || value[3] == 's') && // - (value[4] == 'E' || value[4] == 'e'); - case 6: - return // - (value[0] == 'I' || value[0] == 'i') && // - (value[1] == 'G' || value[1] == 'g') && // - (value[2] == 'N' || value[2] == 'n') && // - (value[3] == 'O' || value[3] == 'o') && // - (value[4] == 'R' || value[4] == 'r') && // - (value[5] == 'E' || value[5] == 'e'); - default: - break; - } - - return IsNOTFOUND(value); -} -bool cmProp::IsNOTFOUND(cm::string_view value) noexcept -{ - return (value == "NOTFOUND"_s) || cmHasSuffix(value, "-NOTFOUND"_s); -} - -int cmProp::Compare(cmProp value) const noexcept -{ - if (this->Value == nullptr && !value) { - return 0; - } - if (this->Value == nullptr) { - return -1; - } - if (!value) { - return 1; - } - return this->Value->compare(*value); -} - -int cmProp::Compare(cm::string_view value) const noexcept -{ - if (this->Value == nullptr && value.data() == nullptr) { - return 0; - } - if (this->Value == nullptr) { - return -1; - } - if (value.data() == nullptr) { - return 1; - } - return cm::string_view(*this->Value).compare(value); -} - -std::ostream& operator<<(std::ostream& o, cmProp v) -{ - o << *v; - return o; -} diff --git a/Source/cmProperty.h b/Source/cmProperty.h index 9d83df4..0781109 100644 --- a/Source/cmProperty.h +++ b/Source/cmProperty.h @@ -4,12 +4,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include -#include -#include - -#include - class cmProperty { public: @@ -26,206 +20,3 @@ public: INSTALL }; }; - -class cmProp -{ -public: - cmProp() noexcept = default; - cmProp(std::nullptr_t) noexcept {} - explicit cmProp(const std::string* value) noexcept - : Value(value) - { - } - explicit cmProp(const std::string& value) noexcept - : Value(&value) - { - } - cmProp(const cmProp& other) noexcept = default; - - cmProp& operator=(const cmProp& other) noexcept = default; - cmProp& operator=(std::nullptr_t) noexcept - { - this->Value = nullptr; - return *this; - } - - const std::string* Get() const noexcept { return this->Value; } - const char* GetCStr() const noexcept - { - return this->Value == nullptr ? nullptr : this->Value->c_str(); - } - - const std::string* operator->() const noexcept - { - return this->Value == nullptr ? &cmProp::Empty : this->Value; - } - const std::string& operator*() const noexcept - { - return this->Value == nullptr ? cmProp::Empty : *this->Value; - } - - explicit operator bool() const noexcept { return this->Value != nullptr; } - operator const std::string&() const noexcept { return this->operator*(); } - explicit operator cm::string_view() const noexcept - { - return this->operator*(); - } - - /** - * Does the value indicate a true or ON value? - */ - bool IsOn() const noexcept - { - return this->Value != nullptr && - cmProp::IsOn(cm::string_view(*this->Value)); - } - /** - * Does the value indicate a false or off value ? Note that this is - * not the same as !IsOn(...) because there are a number of - * ambiguous values such as "/usr/local/bin" a path will result in - * IsOn and IsOff both returning false. Note that the special path - * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. - */ - bool IsOff() const noexcept - { - return this->Value == nullptr || - cmProp::IsOff(cm::string_view(*this->Value)); - } - /** Return true if value is NOTFOUND or ends in -NOTFOUND. */ - bool IsNOTFOUND() const noexcept - { - return this->Value != nullptr && - cmProp::IsNOTFOUND(cm::string_view(*this->Value)); - } - bool IsEmpty() const noexcept - { - return this->Value == nullptr || this->Value->empty(); - } - - bool IsSet() const noexcept - { - return !this->IsEmpty() && !this->IsNOTFOUND(); - } - - /** - * Does a string indicate a true or ON value? - */ - static bool IsOn(const char* value) noexcept - { - return value != nullptr && IsOn(cm::string_view(value)); - } - static bool IsOn(cm::string_view) noexcept; - - /** - * Compare method has same semantic as std::optional::compare - */ - int Compare(cmProp value) const noexcept; - int Compare(cm::string_view value) const noexcept; - - /** - * Does a string indicate a false or off value ? Note that this is - * not the same as !IsOn(...) because there are a number of - * ambiguous values such as "/usr/local/bin" a path will result in - * IsOn and IsOff both returning false. Note that the special path - * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. - */ - static bool IsOff(const char* value) noexcept - { - return value == nullptr || IsOff(cm::string_view(value)); - } - static bool IsOff(cm::string_view) noexcept; - - /** Return true if value is NOTFOUND or ends in -NOTFOUND. */ - static bool IsNOTFOUND(const char* value) noexcept - { - return value == nullptr || IsNOTFOUND(cm::string_view(value)); - } - static bool IsNOTFOUND(cm::string_view) noexcept; - - static bool IsEmpty(const char* value) noexcept - { - return value == nullptr || *value == '\0'; - } - static bool IsEmpty(cm::string_view value) noexcept { return value.empty(); } - -private: - static std::string Empty; - const std::string* Value = nullptr; -}; - -std::ostream& operator<<(std::ostream& o, cmProp v); - -inline bool operator==(cmProp l, cmProp r) noexcept -{ - return l.Compare(r) == 0; -} -inline bool operator!=(cmProp l, cmProp r) noexcept -{ - return l.Compare(r) != 0; -} -inline bool operator<(cmProp l, cmProp r) noexcept -{ - return l.Compare(r) < 0; -} -inline bool operator<=(cmProp l, cmProp r) noexcept -{ - return l.Compare(r) <= 0; -} -inline bool operator>(cmProp l, cmProp r) noexcept -{ - return l.Compare(r) > 0; -} -inline bool operator>=(cmProp l, cmProp r) noexcept -{ - return l.Compare(r) >= 0; -} - -inline bool operator==(cmProp l, cm::string_view r) noexcept -{ - return l.Compare(r) == 0; -} -inline bool operator!=(cmProp l, cm::string_view r) noexcept -{ - return l.Compare(r) != 0; -} -inline bool operator<(cmProp l, cm::string_view r) noexcept -{ - return l.Compare(r) < 0; -} -inline bool operator<=(cmProp l, cm::string_view r) noexcept -{ - return l.Compare(r) <= 0; -} -inline bool operator>(cmProp l, cm::string_view r) noexcept -{ - return l.Compare(r) > 0; -} -inline bool operator>=(cmProp l, cm::string_view r) noexcept -{ - return l.Compare(r) >= 0; -} - -inline bool operator==(cmProp l, std::nullptr_t) noexcept -{ - return l.Compare(cmProp{}) == 0; -} -inline bool operator!=(cmProp l, std::nullptr_t) noexcept -{ - return l.Compare(cmProp{}) != 0; -} -inline bool operator<(cmProp l, std::nullptr_t) noexcept -{ - return l.Compare(cmProp{}) < 0; -} -inline bool operator<=(cmProp l, std::nullptr_t) noexcept -{ - return l.Compare(cmProp{}) <= 0; -} -inline bool operator>(cmProp l, std::nullptr_t) noexcept -{ - return l.Compare(cmProp{}) > 0; -} -inline bool operator>=(cmProp l, std::nullptr_t) noexcept -{ - return l.Compare(cmProp{}) >= 0; -} diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 8ad3c6f..b15000f 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -19,7 +19,7 @@ void cmPropertyMap::SetProperty(const std::string& name, const char* value) this->Map_[name] = value; } -void cmPropertyMap::SetProperty(const std::string& name, cmProp value) +void cmPropertyMap::SetProperty(const std::string& name, cmValue value) { if (!value) { this->Map_.erase(name); @@ -51,11 +51,11 @@ void cmPropertyMap::RemoveProperty(const std::string& name) this->Map_.erase(name); } -cmProp cmPropertyMap::GetPropertyValue(const std::string& name) const +cmValue cmPropertyMap::GetPropertyValue(const std::string& name) const { auto it = this->Map_.find(name); if (it != this->Map_.end()) { - return cmProp(it->second); + return cmValue(it->second); } return nullptr; } diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index b28d3c9..f50b65e 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -9,7 +9,7 @@ #include #include -#include "cmProperty.h" +#include "cmValue.h" /** \class cmPropertyMap * \brief String property map. @@ -26,10 +26,10 @@ public: //! Set the property value void SetProperty(const std::string& name, const char* value); - void SetProperty(const std::string& name, cmProp value); + void SetProperty(const std::string& name, cmValue value); void SetProperty(const std::string& name, const std::string& value) { - this->SetProperty(name, cmProp(value)); + this->SetProperty(name, cmValue(value)); } //! Append to the property value @@ -37,7 +37,7 @@ public: bool asString = false); //! Get the property value - cmProp GetPropertyValue(const std::string& name) const; + cmValue GetPropertyValue(const std::string& name) const; //! Remove the property @a name from the map void RemoveProperty(const std::string& name); diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx index f3ad565..f9e889a 100644 --- a/Source/cmQtAutoGenGlobalInitializer.cxx +++ b/Source/cmQtAutoGenGlobalInitializer.cxx @@ -15,7 +15,6 @@ #include "cmMessageType.h" #include "cmPolicies.h" #include "cmProcessOutput.h" -#include "cmProperty.h" #include "cmQtAutoGen.h" #include "cmQtAutoGenInitializer.h" #include "cmState.h" @@ -23,6 +22,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" cmQtAutoGenGlobalInitializer::Keywords::Keywords() : AUTOMOC("AUTOMOC") @@ -183,7 +183,7 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget( // Set FOLDER property in the target { - cmProp folder = + cmValue folder = makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER"); if (folder) { target->SetProperty("FOLDER", folder); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index fe038c7..33ce314 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -37,7 +37,6 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmQtAutoGen.h" #include "cmQtAutoGenGlobalInitializer.h" #include "cmSourceFile.h" @@ -48,6 +47,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" #include "cmake.h" namespace { @@ -356,7 +356,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets() // Targets FOLDER { - cmProp folder = + cmValue folder = this->Makefile->GetState()->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER"); if (!folder) { folder = this->Makefile->GetState()->GetGlobalProperty( @@ -1790,7 +1790,7 @@ void cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName, cmStrCat(genNameUpper, "_SOURCE_GROUP"), "AUTOGEN_SOURCE_GROUP" }; for (std::string const& prop : props) { - cmProp propName = this->Makefile->GetState()->GetGlobalProperty(prop); + cmValue propName = this->Makefile->GetState()->GetGlobalProperty(prop); if (cmNonempty(propName)) { groupName = *propName; property = prop; @@ -1920,7 +1920,7 @@ cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target, } return 0u; }; - auto toUInt2 = [](cmProp input) -> unsigned int { + auto toUInt2 = [](cmValue input) -> unsigned int { unsigned long tmp = 0; if (input && cmStrToULong(*input, &tmp)) { return static_cast(tmp); @@ -1948,8 +1948,8 @@ cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target, knownQtVersions.reserve(keys.size() * 2); // Adds a version to the result (nullptr safe) - auto addVersion = [&knownQtVersions, &toUInt2](cmProp major, - cmProp minor) { + auto addVersion = [&knownQtVersions, &toUInt2](cmValue major, + cmValue minor) { cmQtAutoGen::IntegerVersion ver(toUInt2(major), toUInt2(minor)); if (ver.Major != 0) { knownQtVersions.emplace_back(ver); diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx index 1345588..8af13ae 100644 --- a/Source/cmRemoveCommand.cxx +++ b/Source/cmRemoveCommand.cxx @@ -4,8 +4,8 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStringAlgorithms.h" +#include "cmValue.h" // cmRemoveCommand bool cmRemoveCommand(std::vector const& args, @@ -17,7 +17,7 @@ bool cmRemoveCommand(std::vector const& args, std::string const& variable = args[0]; // VAR is always first // get the old value - cmProp cacheValue = status.GetMakefile().GetDefinition(variable); + cmValue cacheValue = status.GetMakefile().GetDefinition(variable); // if there is no old value then return if (!cacheValue) { diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index a58be62..1bb459c 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -8,9 +8,9 @@ #include "cmFindCommon.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" cmSearchPath::cmSearchPath(cmFindCommon* findCmd) : FC(findCmd) @@ -78,7 +78,7 @@ void cmSearchPath::AddCMakePath(const std::string& variable) assert(this->FC != nullptr); // Get a path from a CMake variable. - if (cmProp value = this->FC->Makefile->GetDefinition(variable)) { + if (cmValue value = this->FC->Makefile->GetDefinition(variable)) { std::vector expanded = cmExpandedList(*value); for (std::string const& p : expanded) { @@ -102,7 +102,7 @@ void cmSearchPath::AddCMakePrefixPath(const std::string& variable) assert(this->FC != nullptr); // Get a path from a CMake variable. - if (cmProp value = this->FC->Makefile->GetDefinition(variable)) { + if (cmValue value = this->FC->Makefile->GetDefinition(variable)) { std::vector expanded = cmExpandedList(*value); this->AddPrefixPaths( @@ -179,7 +179,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector& paths, dir += "/"; } if (subdir == "include" || subdir == "lib") { - cmProp arch = + cmValue arch = this->FC->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE"); if (cmNonempty(arch)) { if (this->FC->Makefile->IsDefinitionSet("CMAKE_SYSROOT") && diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index c2fc45c..17285e7 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -10,10 +10,10 @@ #include "cmArgumentParser.h" #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" // cmSeparateArgumentsCommand bool cmSeparateArgumentsCommand(std::vector const& args, @@ -28,7 +28,7 @@ bool cmSeparateArgumentsCommand(std::vector const& args, if (args.size() == 1) { // Original space-replacement version of command. - if (cmProp def = status.GetMakefile().GetDefinition(var)) { + if (cmValue def = status.GetMakefile().GetDefinition(var)) { std::string value = *def; std::replace(value.begin(), value.end(), ' ', ';'); status.GetMakefile().AddDefinition(var, value); diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 354b4c3..ce0cb25 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -5,12 +5,12 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" // cmSetCommand bool cmSetCommand(std::vector const& args, @@ -136,7 +136,7 @@ bool cmSetCommand(std::vector const& args, // see if this is already in the cache cmState* state = status.GetMakefile().GetState(); - cmProp existingValue = state->GetCacheEntryValue(variable); + cmValue existingValue = state->GetCacheEntryValue(variable); if (existingValue && (state->GetCacheEntryType(variable) != cmStateEnums::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 59b4402..db10cd4 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -21,6 +21,7 @@ #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTest.h" +#include "cmValue.h" #include "cmake.h" namespace { @@ -116,7 +117,7 @@ bool HandleSourceFileDirectoryScopes( "given non-existent target for TARGET_DIRECTORY ", target_name)); return false; } - cmProp target_source_dir = target->GetProperty("BINARY_DIR"); + cmValue target_source_dir = target->GetProperty("BINARY_DIR"); cmMakefile* target_dir_mf = status.GetMakefile().GetGlobalGenerator()->FindMakefile( *target_source_dir); @@ -719,7 +720,7 @@ bool HandleCacheMode(cmExecutionStatus& status, for (std::string const& name : names) { // Get the source file. cmake* cm = status.GetMakefile().GetCMakeInstance(); - cmProp existingValue = cm->GetState()->GetCacheEntryValue(name); + cmValue existingValue = cm->GetState()->GetCacheEntryValue(name); if (existingValue) { if (!HandleCacheEntry(name, status.GetMakefile(), propertyName, propertyValue, appendAsString, appendMode, diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 58af8f0..34fdefe 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -6,10 +6,10 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" // cmSiteNameCommand bool cmSiteNameCommand(std::vector const& args, @@ -27,12 +27,12 @@ bool cmSiteNameCommand(std::vector const& args, paths.emplace_back("/sbin"); paths.emplace_back("/usr/local/bin"); - cmProp cacheValue = status.GetMakefile().GetDefinition(args[0]); + cmValue cacheValue = status.GetMakefile().GetDefinition(args[0]); if (cacheValue) { return true; } - cmProp temp = status.GetMakefile().GetDefinition("HOSTNAME"); + cmValue temp = status.GetMakefile().GetDefinition("HOSTNAME"); std::string hostname_cmd; if (temp) { hostname_cmd = *temp; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6caae3a..3fa0051 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -13,6 +13,7 @@ #include "cmState.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name, @@ -53,7 +54,7 @@ std::string cmSourceFile::GetObjectLibrary() const std::string const& cmSourceFile::GetOrDetermineLanguage() { // If the language was set explicitly by the user then use it. - if (cmProp lang = this->GetProperty(propLANGUAGE)) { + if (cmValue lang = this->GetProperty(propLANGUAGE)) { // Assign to member in order to return a reference. this->Language = *lang; return this->Language; @@ -84,7 +85,7 @@ std::string const& cmSourceFile::GetOrDetermineLanguage() std::string cmSourceFile::GetLanguage() const { // If the language was set explicitly by the user then use it. - if (cmProp lang = this->GetProperty(propLANGUAGE)) { + if (cmValue lang = this->GetProperty(propLANGUAGE)) { return *lang; } @@ -299,7 +300,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value) { this->StoreProperty(prop, value); } -void cmSourceFile::SetProperty(const std::string& prop, cmProp value) +void cmSourceFile::SetProperty(const std::string& prop, cmValue value) { this->StoreProperty(prop, value); } @@ -327,7 +328,7 @@ void cmSourceFile::AppendProperty(const std::string& prop, } } -cmProp cmSourceFile::GetPropertyForUser(const std::string& prop) +cmValue cmSourceFile::GetPropertyForUser(const std::string& prop) { // This method is a consequence of design history and backwards // compatibility. GetProperty is (and should be) a const method. @@ -352,7 +353,7 @@ cmProp cmSourceFile::GetPropertyForUser(const std::string& prop) // if it is requested by the user. if (prop == propLANGUAGE) { // The pointer is valid until `this->Language` is modified. - return cmProp(this->GetOrDetermineLanguage()); + return cmValue(this->GetOrDetermineLanguage()); } // Special handling for GENERATED property. @@ -365,23 +366,23 @@ cmProp cmSourceFile::GetPropertyForUser(const std::string& prop) (policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD) ? CheckScope::GlobalAndLocal : CheckScope::Global)) { - return cmProp(propTRUE); + return cmValue(propTRUE); } - return cmProp(propFALSE); + return cmValue(propFALSE); } // Perform the normal property lookup. return this->GetProperty(prop); } -cmProp cmSourceFile::GetProperty(const std::string& prop) const +cmValue cmSourceFile::GetProperty(const std::string& prop) const { // Check for computed properties. if (prop == propLOCATION) { if (this->FullPath.empty()) { return nullptr; } - return cmProp(this->FullPath); + return cmValue(this->FullPath); } // Check for the properties with backtraces. @@ -392,7 +393,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->IncludeDirectories, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propCOMPILE_OPTIONS) { @@ -402,7 +403,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->CompileOptions, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propCOMPILE_DEFINITIONS) { @@ -412,10 +413,10 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->CompileDefinitions, ";"); - return cmProp(output); + return cmValue(output); } - cmProp retVal = this->Properties.GetPropertyValue(prop); + cmValue retVal = this->Properties.GetPropertyValue(prop); if (!retVal) { cmMakefile const* mf = this->Location.GetMakefile(); const bool chain = @@ -431,7 +432,7 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const const std::string& cmSourceFile::GetSafeProperty(const std::string& prop) const { - cmProp ret = this->GetProperty(prop); + cmValue ret = this->GetProperty(prop); if (ret) { return *ret; } diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 78e0d27..c1c5201 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -10,10 +10,10 @@ #include "cmCustomCommand.h" #include "cmListFileCache.h" -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmSourceFileLocation.h" #include "cmSourceFileLocationKind.h" +#include "cmValue.h" class cmMakefile; @@ -42,22 +42,22 @@ public: //! Set/Get a property of this source file void SetProperty(const std::string& prop, const char* value); - void SetProperty(const std::string& prop, cmProp value); + void SetProperty(const std::string& prop, cmValue value); void SetProperty(const std::string& prop, const std::string& value) { - this->SetProperty(prop, cmProp(value)); + this->SetProperty(prop, cmValue(value)); } void AppendProperty(const std::string& prop, const std::string& value, bool asString = false); //! 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 const std::string& GetSafeProperty(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const; /** Implement getting a property when called from a CMake language command like get_property or get_source_file_property. */ - cmProp GetPropertyForUser(const std::string& prop); + cmValue GetPropertyForUser(const std::string& prop); /// Marks this file as generated /** diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx index 499317d..c73f53a 100644 --- a/Source/cmStandardLevelResolver.cxx +++ b/Source/cmStandardLevelResolver.cxx @@ -20,9 +20,9 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmStringAlgorithms.h" #include "cmTarget.h" +#include "cmValue.h" #include "cmake.h" namespace { @@ -76,7 +76,7 @@ struct StandardLevelComputer const auto& stds = this->Levels; const auto& stdsStrings = this->LevelsAsStrings; - cmProp defaultStd = makefile->GetDefinition( + cmValue defaultStd = makefile->GetDefinition( cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT")); if (!cmNonempty(defaultStd)) { // this compiler has no notion of language standard levels @@ -84,13 +84,13 @@ struct StandardLevelComputer } bool ext = true; - if (cmProp extPropValue = target->GetLanguageExtensions(this->Language)) { + if (cmValue extPropValue = target->GetLanguageExtensions(this->Language)) { if (cmIsOff(*extPropValue)) { ext = false; } } - cmProp standardProp = target->GetLanguageStandard(this->Language, config); + cmValue standardProp = target->GetLanguageStandard(this->Language, config); if (!standardProp) { if (ext) { // No language standard is specified and extensions are not disabled. @@ -106,7 +106,7 @@ struct StandardLevelComputer std::string option_flag = cmStrCat( "CMAKE_", this->Language, *standardProp, "_", type, "_COMPILE_OPTION"); - cmProp opt = target->Target->GetMakefile()->GetDefinition(option_flag); + cmValue opt = target->Target->GetMakefile()->GetDefinition(option_flag); if (!opt) { std::ostringstream e; e << "Target \"" << target->GetName() @@ -174,7 +174,7 @@ struct StandardLevelComputer bool GetNewRequiredStandard(cmMakefile* makefile, std::string const& targetName, const std::string& feature, - cmProp currentLangStandardValue, + cmValue currentLangStandardValue, std::string& newRequiredStandard, std::string* error) const { @@ -186,9 +186,9 @@ struct StandardLevelComputer auto needed = this->HighestStandardNeeded(makefile, feature); - cmProp existingStandard = currentLangStandardValue; + cmValue existingStandard = currentLangStandardValue; if (!existingStandard) { - cmProp defaultStandard = makefile->GetDefinition( + cmValue defaultStandard = makefile->GetDefinition( cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT")); if (cmNonempty(defaultStandard)) { existingStandard = defaultStandard; @@ -231,7 +231,7 @@ struct StandardLevelComputer std::string const& config, std::string const& feature) const { - cmProp defaultStandard = makefile->GetDefinition( + cmValue defaultStandard = makefile->GetDefinition( cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT")); if (!defaultStandard) { makefile->IssueMessage( @@ -253,7 +253,7 @@ struct StandardLevelComputer return false; } - cmProp existingStandard = + cmValue existingStandard = target->GetLanguageStandard(this->Language, config); if (!existingStandard) { existingStandard = defaultStandard; @@ -283,7 +283,7 @@ struct StandardLevelComputer std::string prefix = cmStrCat("CMAKE_", this->Language); StandardNeeded maxLevel = { -1, -1 }; for (size_t i = 0; i < this->Levels.size(); ++i) { - if (cmProp prop = makefile->GetDefinition( + if (cmValue prop = makefile->GetDefinition( cmStrCat(prefix, this->LevelsAsStrings[i], "_COMPILE_FEATURES"))) { std::vector props = cmExpandedList(*prop); if (cm::contains(props, feature)) { @@ -393,7 +393,7 @@ bool cmStandardLevelResolver::CheckCompileFeaturesAvailable( return true; } - cmProp features = this->CompileFeaturesAvailable(lang, error); + cmValue features = this->CompileFeaturesAvailable(lang, error); if (!features) { return false; } @@ -471,7 +471,7 @@ bool cmStandardLevelResolver::CompileFeatureKnown( return false; } -cmProp cmStandardLevelResolver::CompileFeaturesAvailable( +cmValue cmStandardLevelResolver::CompileFeaturesAvailable( const std::string& lang, std::string* error) const { if (!this->Makefile->GetGlobalGenerator()->GetLanguageEnabled(lang)) { @@ -490,7 +490,7 @@ cmProp cmStandardLevelResolver::CompileFeaturesAvailable( return nullptr; } - cmProp featuresKnown = + cmValue featuresKnown = this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILE_FEATURES"); if (!cmNonempty(featuresKnown)) { @@ -518,7 +518,7 @@ cmProp cmStandardLevelResolver::CompileFeaturesAvailable( bool cmStandardLevelResolver::GetNewRequiredStandard( const std::string& targetName, const std::string& feature, - cmProp currentLangStandardValue, std::string& newRequiredStandard, + cmValue currentLangStandardValue, std::string& newRequiredStandard, std::string* error) const { std::string lang; diff --git a/Source/cmStandardLevelResolver.h b/Source/cmStandardLevelResolver.h index c01a3b1..4226456 100644 --- a/Source/cmStandardLevelResolver.h +++ b/Source/cmStandardLevelResolver.h @@ -4,7 +4,7 @@ #include -#include "cmProperty.h" +#include "cmValue.h" class cmMakefile; class cmGeneratorTarget; @@ -30,12 +30,12 @@ public: const std::string& feature, std::string& lang, std::string* error) const; - cmProp CompileFeaturesAvailable(const std::string& lang, - std::string* error) const; + cmValue CompileFeaturesAvailable(const std::string& lang, + std::string* error) const; bool GetNewRequiredStandard(const std::string& targetName, const std::string& feature, - cmProp currentLangStandardValue, + cmValue currentLangStandardValue, std::string& newRequiredStandard, std::string* error = nullptr) const; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 16718e8..7fbc8f8 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -144,20 +144,20 @@ std::vector cmState::GetCacheEntryKeys() const return this->CacheManager->GetCacheEntryKeys(); } -cmProp cmState::GetCacheEntryValue(std::string const& key) const +cmValue cmState::GetCacheEntryValue(std::string const& key) const { return this->CacheManager->GetCacheEntryValue(key); } std::string cmState::GetSafeCacheEntryValue(std::string const& key) const { - if (cmProp val = this->GetCacheEntryValue(key)) { + if (cmValue val = this->GetCacheEntryValue(key)) { return *val; } return std::string(); } -cmProp cmState::GetInitializedCacheValue(std::string const& key) const +cmValue cmState::GetInitializedCacheValue(std::string const& key) const { return this->CacheManager->GetInitializedCacheValue(key); } @@ -194,8 +194,8 @@ std::vector cmState::GetCacheEntryPropertyList( return this->CacheManager->GetCacheEntryPropertyList(key); } -cmProp cmState::GetCacheEntryProperty(std::string const& key, - std::string const& propertyName) +cmValue cmState::GetCacheEntryProperty(std::string const& key, + std::string const& propertyName) { return this->CacheManager->GetCacheEntryProperty(key, propertyName); } @@ -206,7 +206,7 @@ bool cmState::GetCacheEntryPropertyAsBool(std::string const& key, return this->CacheManager->GetCacheEntryPropertyAsBool(key, propertyName); } -void cmState::AddCacheEntry(const std::string& key, cmProp value, +void cmState::AddCacheEntry(const std::string& key, cmValue value, const char* helpString, cmStateEnums::CacheEntryType type) { @@ -472,7 +472,7 @@ void cmState::AddUnexpectedCommand(std::string const& name, const char* error) name, [name, error](std::vector const&, cmExecutionStatus& status) -> bool { - cmProp versionValue = + cmValue versionValue = status.GetMakefile().GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"); if (name == "endif" && (!versionValue || atof(versionValue->c_str()) <= 1.4)) { @@ -564,7 +564,7 @@ void cmState::SetGlobalProperty(const std::string& prop, const char* value) { this->GlobalProperties.SetProperty(prop, value); } -void cmState::SetGlobalProperty(const std::string& prop, cmProp value) +void cmState::SetGlobalProperty(const std::string& prop, cmValue value) { this->GlobalProperties.SetProperty(prop, value); } @@ -575,7 +575,7 @@ void cmState::AppendGlobalProperty(const std::string& prop, this->GlobalProperties.AppendProperty(prop, value, asString); } -cmProp cmState::GetGlobalProperty(const std::string& prop) +cmValue cmState::GetGlobalProperty(const std::string& prop) { if (prop == "CACHE_VARIABLES") { std::vector cacheKeys = this->GetCacheEntryKeys(); @@ -602,47 +602,47 @@ cmProp cmState::GetGlobalProperty(const std::string& prop) if (prop == "CMAKE_C_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_C90_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_C90_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_C99_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_C99_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_C11_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_C11_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_CXX_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_CXX98_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_CXX98_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_CXX11_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_CXX11_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_CXX14_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_CXX14_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } if (prop == "CMAKE_CUDA_KNOWN_FEATURES") { static const std::string s_out( &FOR_EACH_CUDA_FEATURE(STRING_LIST_ELEMENT)[1]); - return cmProp(s_out); + return cmValue(s_out); } #undef STRING_LIST_ELEMENT diff --git a/Source/cmState.h b/Source/cmState.h index 390f6d6..a1666ca 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -21,6 +21,7 @@ #include "cmPropertyMap.h" #include "cmStatePrivate.h" #include "cmStateTypes.h" +#include "cmValue.h" class cmCacheManager; class cmCommand; @@ -98,9 +99,9 @@ public: bool IsCacheLoaded() const; std::vector GetCacheEntryKeys() const; - cmProp GetCacheEntryValue(std::string const& key) const; + cmValue GetCacheEntryValue(std::string const& key) const; std::string GetSafeCacheEntryValue(std::string const& key) const; - cmProp GetInitializedCacheValue(std::string const& key) const; + cmValue GetInitializedCacheValue(std::string const& key) const; cmStateEnums::CacheEntryType GetCacheEntryType(std::string const& key) const; void SetCacheEntryValue(std::string const& key, std::string const& value); @@ -112,8 +113,8 @@ public: void SetCacheEntryBoolProperty(std::string const& key, std::string const& propertyName, bool value); std::vector GetCacheEntryPropertyList(std::string const& key); - cmProp GetCacheEntryProperty(std::string const& key, - std::string const& propertyName); + cmValue GetCacheEntryProperty(std::string const& key, + std::string const& propertyName); bool GetCacheEntryPropertyAsBool(std::string const& key, std::string const& propertyName); void AppendCacheEntryProperty(std::string const& key, @@ -178,10 +179,10 @@ public: std::vector GetCommandNames() const; void SetGlobalProperty(const std::string& prop, const char* value); - void SetGlobalProperty(const std::string& prop, cmProp value); + void SetGlobalProperty(const std::string& prop, cmValue value); void AppendGlobalProperty(const std::string& prop, const std::string& value, bool asString = false); - cmProp GetGlobalProperty(const std::string& prop); + cmValue GetGlobalProperty(const std::string& prop); bool GetGlobalPropertyAsBool(const std::string& prop); std::string const& GetSourceDirectory() const; @@ -222,15 +223,15 @@ private: 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); diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 8f83b02..b42e5c3 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -21,6 +21,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" static std::string const kBINARY_DIR = "BINARY_DIR"; static std::string const kBUILDSYSTEM_TARGETS = "BUILDSYSTEM_TARGETS"; @@ -322,7 +323,7 @@ void cmStateDirectory::SetProperty(const std::string& prop, const char* value, { this->StoreProperty(prop, value, lfbt); } -void cmStateDirectory::SetProperty(const std::string& prop, cmProp value, +void cmStateDirectory::SetProperty(const std::string& prop, cmValue value, cmListFileBacktrace const& lfbt) { this->StoreProperty(prop, value, lfbt); @@ -356,31 +357,32 @@ void cmStateDirectory::AppendProperty(const std::string& prop, this->DirectoryState->Properties.AppendProperty(prop, value, asString); } -cmProp cmStateDirectory::GetProperty(const std::string& prop) const +cmValue cmStateDirectory::GetProperty(const std::string& prop) const { const bool chain = this->Snapshot_.State->IsPropertyChained(prop, cmProperty::DIRECTORY); return this->GetProperty(prop, chain); } -cmProp cmStateDirectory::GetProperty(const std::string& prop, bool chain) const +cmValue cmStateDirectory::GetProperty(const std::string& prop, + bool chain) const { static std::string output; output.clear(); if (prop == "PARENT_DIRECTORY") { cmStateSnapshot parent = this->Snapshot_.GetBuildsystemDirectoryParent(); if (parent.IsValid()) { - return cmProp(parent.GetDirectory().GetCurrentSource()); + return cmValue(parent.GetDirectory().GetCurrentSource()); } - return cmProp(output); + return cmValue(output); } if (prop == kBINARY_DIR) { output = this->GetCurrentBinary(); - return cmProp(output); + return cmValue(output); } if (prop == kSOURCE_DIR) { output = this->GetCurrentSource(); - return cmProp(output); + return cmValue(output); } if (prop == kSUBDIRECTORIES) { std::vector child_dirs; @@ -391,15 +393,15 @@ cmProp cmStateDirectory::GetProperty(const std::string& prop, bool chain) const child_dirs.push_back(ci.GetDirectory().GetCurrentSource()); } output = cmJoin(child_dirs, ";"); - return cmProp(output); + return cmValue(output); } if (prop == kBUILDSYSTEM_TARGETS) { output = cmJoin(this->DirectoryState->NormalTargetNames, ";"); - return cmProp(output); + return cmValue(output); } if (prop == "IMPORTED_TARGETS"_s) { output = cmJoin(this->DirectoryState->ImportedTargetNames, ";"); - return cmProp(output); + return cmValue(output); } if (prop == "LISTFILE_STACK") { @@ -411,41 +413,41 @@ cmProp cmStateDirectory::GetProperty(const std::string& prop, bool chain) const } std::reverse(listFiles.begin(), listFiles.end()); output = cmJoin(listFiles, ";"); - return cmProp(output); + return cmValue(output); } if (prop == "CACHE_VARIABLES") { output = cmJoin(this->Snapshot_.State->GetCacheEntryKeys(), ";"); - return cmProp(output); + return cmValue(output); } if (prop == "VARIABLES") { std::vector res = this->Snapshot_.ClosureKeys(); cm::append(res, this->Snapshot_.State->GetCacheEntryKeys()); std::sort(res.begin(), res.end()); output = cmJoin(res, ";"); - return cmProp(output); + return cmValue(output); } if (prop == "INCLUDE_DIRECTORIES") { output = cmJoin(this->GetIncludeDirectoriesEntries(), ";"); - return cmProp(output); + return cmValue(output); } if (prop == "COMPILE_OPTIONS") { output = cmJoin(this->GetCompileOptionsEntries(), ";"); - return cmProp(output); + return cmValue(output); } if (prop == "COMPILE_DEFINITIONS") { output = cmJoin(this->GetCompileDefinitionsEntries(), ";"); - return cmProp(output); + return cmValue(output); } if (prop == "LINK_OPTIONS") { output = cmJoin(this->GetLinkOptionsEntries(), ";"); - return cmProp(output); + return cmValue(output); } if (prop == "LINK_DIRECTORIES") { output = cmJoin(this->GetLinkDirectoriesEntries(), ";"); - return cmProp(output); + return cmValue(output); } - cmProp retVal = this->DirectoryState->Properties.GetPropertyValue(prop); + cmValue retVal = this->DirectoryState->Properties.GetPropertyValue(prop); if (!retVal && chain) { cmStateSnapshot parentSnapshot = this->Snapshot_.GetBuildsystemDirectoryParent(); diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index fac5d58c..6429f32 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -11,9 +11,9 @@ #include "cmAlgorithms.h" #include "cmLinkedTree.h" #include "cmListFileCache.h" -#include "cmProperty.h" #include "cmStatePrivate.h" #include "cmStateSnapshot.h" +#include "cmValue.h" class cmStateDirectory { @@ -56,12 +56,12 @@ public: void SetProperty(const std::string& prop, const char* value, cmListFileBacktrace const& lfbt); - void SetProperty(const std::string& prop, cmProp value, + void SetProperty(const std::string& prop, cmValue value, cmListFileBacktrace const& lfbt); void AppendProperty(const std::string& prop, const std::string& value, bool asString, cmListFileBacktrace const& lfbt); - cmProp GetProperty(const std::string& prop) const; - cmProp GetProperty(const std::string& prop, bool chain) const; + cmValue GetProperty(const std::string& prop) const; + cmValue GetProperty(const std::string& prop, bool chain) const; bool GetPropertyAsBool(const std::string& prop) const; std::vector GetPropertyKeys() const; diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index bd7db85..f73df8f 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -11,12 +11,12 @@ #include "cmDefinitions.h" #include "cmListFileCache.h" -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStatePrivate.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmVersion.h" #if defined(__CYGWIN__) @@ -205,7 +205,7 @@ bool cmStateSnapshot::HasDefinedPolicyCMP0011() return !this->Position->Policies->IsEmpty(); } -cmProp cmStateSnapshot::GetDefinition(std::string const& name) const +cmValue cmStateSnapshot::GetDefinition(std::string const& name) const { assert(this->Position->Vars.IsValid()); return cmDefinitions::Get(name, this->Position->Vars, this->Position->Root); @@ -378,7 +378,7 @@ void cmStateSnapshot::InitializeFromParent() this->Position->BuildSystemDirectory->LinkDirectories, this->Position->LinkDirectoriesPosition); - cmProp include_regex = + cmValue include_regex = parent->BuildSystemDirectory->Properties.GetPropertyValue( "INCLUDE_REGULAR_EXPRESSION"); this->Position->BuildSystemDirectory->Properties.SetProperty( diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index a5fe7e2..a61ec83 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -12,8 +12,8 @@ #include "cmLinkedTree.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmStateTypes.h" +#include "cmValue.h" class cmState; class cmStateDirectory; @@ -24,7 +24,7 @@ public: cmStateSnapshot(cmState* state = nullptr); cmStateSnapshot(cmState* state, cmStateDetail::PositionType position); - cmProp GetDefinition(std::string const& name) const; + cmValue GetDefinition(std::string const& name) const; bool IsInitialized(std::string const& name) const; void SetDefinition(std::string const& name, cm::string_view value); void RemoveDefinition(std::string const& name); diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h index 33ab403..a9edcdf 100644 --- a/Source/cmStringAlgorithms.h +++ b/Source/cmStringAlgorithms.h @@ -14,8 +14,8 @@ #include -#include "cmProperty.h" #include "cmRange.h" +#include "cmValue.h" /** String range type. */ using cmStringRange = cmRange::const_iterator>; @@ -94,7 +94,7 @@ std::vector cmTokenize(cm::string_view str, cm::string_view sep); */ void cmExpandList(cm::string_view arg, std::vector& argsOut, bool emptyArgs = false); -inline void cmExpandList(cmProp arg, std::vector& argsOut, +inline void cmExpandList(cmValue arg, std::vector& argsOut, bool emptyArgs = false) { if (arg) { @@ -122,7 +122,7 @@ void cmExpandLists(InputIt first, InputIt last, */ std::vector cmExpandedList(cm::string_view arg, bool emptyArgs = false); -inline std::vector cmExpandedList(cmProp arg, +inline std::vector cmExpandedList(cmValue arg, bool emptyArgs = false) { if (!arg) { @@ -177,7 +177,7 @@ public: cmAlphaNum(unsigned long long int val); cmAlphaNum(float val); cmAlphaNum(double val); - cmAlphaNum(cmProp value) + cmAlphaNum(cmValue value) : View_(*value) { } @@ -232,7 +232,7 @@ inline bool cmIsInternallyOn(const char* val) } return cmIsInternallyOn(cm::string_view(val)); } -inline bool cmIsInternallyOn(cmProp val) +inline bool cmIsInternallyOn(cmValue val) { if (!val) { return false; @@ -243,13 +243,13 @@ inline bool cmIsInternallyOn(cmProp val) /** Check for non-empty Property/Variable value. */ inline bool cmNonempty(cm::string_view val) { - return !cmProp::IsEmpty(val); + return !cmValue::IsEmpty(val); } inline bool cmNonempty(const char* val) { - return !cmProp::IsEmpty(val); + return !cmValue::IsEmpty(val); } -inline bool cmNonempty(cmProp val) +inline bool cmNonempty(cmValue val) { return !val.IsEmpty(); } @@ -257,9 +257,9 @@ inline bool cmNonempty(cmProp val) /** Return true if value is NOTFOUND or ends in -NOTFOUND. */ inline bool cmIsNOTFOUND(cm::string_view val) { - return cmProp::IsNOTFOUND(val); + return cmValue::IsNOTFOUND(val); } -inline bool cmIsNOTFOUND(cmProp val) +inline bool cmIsNOTFOUND(cmValue val) { return val.IsNOTFOUND(); } @@ -269,13 +269,13 @@ inline bool cmIsNOTFOUND(cmProp val) */ inline bool cmIsOn(cm::string_view val) { - return cmProp::IsOn(val); + return cmValue::IsOn(val); } inline bool cmIsOn(const char* val) { - return cmProp::IsOn(val); + return cmValue::IsOn(val); } -inline bool cmIsOn(cmProp val) +inline bool cmIsOn(cmValue val) { return val.IsOn(); } @@ -289,13 +289,13 @@ inline bool cmIsOn(cmProp val) */ inline bool cmIsOff(cm::string_view val) { - return cmProp::IsOff(val); + return cmValue::IsOff(val); } inline bool cmIsOff(const char* val) { - return cmProp::IsOff(val); + return cmValue::IsOff(val); } -inline bool cmIsOff(cmProp val) +inline bool cmIsOff(cmValue val) { return val.IsOff(); } @@ -313,7 +313,7 @@ inline bool cmHasPrefix(cm::string_view str, cm::string_view prefix) } /** Returns true if string @a str starts with string @a prefix. */ -inline bool cmHasPrefix(cm::string_view str, cmProp prefix) +inline bool cmHasPrefix(cm::string_view str, cmValue prefix) { if (!prefix) { return false; @@ -343,7 +343,7 @@ inline bool cmHasSuffix(cm::string_view str, cm::string_view suffix) } /** Returns true if string @a str ends with string @a suffix. */ -inline bool cmHasSuffix(cm::string_view str, cmProp suffix) +inline bool cmHasSuffix(cm::string_view str, cmValue suffix) { if (!suffix) { return false; diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 5fa309d..1cb6193 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -31,7 +31,6 @@ #include "cmGeneratorExpression.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmStringAlgorithms.h" #include "cmStringReplaceHelper.h" @@ -39,6 +38,7 @@ #include "cmSystemTools.h" #include "cmTimestamp.h" #include "cmUuid.h" +#include "cmValue.h" namespace { @@ -572,7 +572,7 @@ bool HandlePrependCommand(std::vector const& args, const std::string& variable = args[1]; std::string value = cmJoin(cmMakeRange(args).advance(2), std::string()); - cmProp oldValue = status.GetMakefile().GetDefinition(variable); + cmValue oldValue = status.GetMakefile().GetDefinition(variable); if (oldValue) { value += *oldValue; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index af64dce..08734b4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -37,6 +37,7 @@ #include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTargetPropertyComputer.h" +#include "cmValue.h" #include "cmake.h" template <> @@ -79,7 +80,7 @@ const std::string& cmTargetPropertyComputer::ComputeLocation( } template <> -cmProp cmTargetPropertyComputer::GetSources( +cmValue cmTargetPropertyComputer::GetSources( cmTarget const* tgt, cmMessenger* messenger, cmListFileBacktrace const& context) { @@ -157,7 +158,7 @@ cmProp cmTargetPropertyComputer::GetSources( } static std::string srcs; srcs = ss.str(); - return cmProp(srcs); + return cmValue(srcs); } class cmTargetInternals @@ -257,7 +258,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, auto initProp = [this, mf, &defKey](const std::string& property) { // Replace everything after "CMAKE_" defKey.replace(defKey.begin() + 6, defKey.end(), property); - if (cmProp value = mf->GetDefinition(defKey)) { + if (cmValue value = mf->GetDefinition(defKey)) { this->SetProperty(property, value); } }; @@ -265,7 +266,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, const char* default_value) { // Replace everything after "CMAKE_" defKey.replace(defKey.begin() + 6, defKey.end(), property); - if (cmProp value = mf->GetDefinition(defKey)) { + if (cmValue value = mf->GetDefinition(defKey)) { this->SetProperty(property, value); } else if (default_value) { this->SetProperty(property, default_value); @@ -525,7 +526,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, // check for "CMAKE_VS_GLOBALS" variable and set up target properties // if any - cmProp globals = mf->GetDefinition("CMAKE_VS_GLOBALS"); + cmValue globals = mf->GetDefinition("CMAKE_VS_GLOBALS"); if (globals) { const std::string genName = mf->GetGlobalGenerator()->GetName(); if (cmHasLiteralPrefix(genName, "Visual Studio")) { @@ -1018,7 +1019,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, std::string const& lib, this->GetPolicyStatusCMP0073() == cmPolicies::WARN)) { std::string targetEntry = cmStrCat(this->impl->Name, "_LIB_DEPENDS"); std::string dependencies; - cmProp old_val = mf.GetDefinition(targetEntry); + cmValue old_val = mf.GetDefinition(targetEntry); if (old_val) { dependencies += *old_val; } @@ -1151,7 +1152,7 @@ std::string ConvertToString(const char* value) return std::string(value); } template <> -std::string ConvertToString(cmProp value) +std::string ConvertToString(cmValue value) { return std::string(*value); } @@ -1306,7 +1307,7 @@ void cmTarget::StoreProperty(const std::string& prop, ValueType value) reusedTarget->SetProperty("COMPILE_PDB_OUTPUT_DIRECTORY", cmStrCat(reusedFrom, ".dir/")); - cmProp tmp = reusedTarget->GetProperty("COMPILE_PDB_NAME"); + cmValue tmp = reusedTarget->GetProperty("COMPILE_PDB_NAME"); this->SetProperty("COMPILE_PDB_NAME", tmp); this->AddUtility(reusedFrom, false, this->impl->Makefile); } else if (prop == propC_STANDARD || prop == propCXX_STANDARD || @@ -1421,7 +1422,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) { this->StoreProperty(prop, value); } -void cmTarget::SetProperty(const std::string& prop, cmProp value) +void cmTarget::SetProperty(const std::string& prop, cmValue value) { this->StoreProperty(prop, value); } @@ -1579,17 +1580,17 @@ void cmTarget::CheckProperty(const std::string& prop, { // Certain properties need checking. if (cmHasLiteralPrefix(prop, "LINK_INTERFACE_LIBRARIES")) { - if (cmProp value = this->GetProperty(prop)) { + if (cmValue value = this->GetProperty(prop)) { cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, *value, context, false); } } if (cmHasLiteralPrefix(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES")) { - if (cmProp value = this->GetProperty(prop)) { + if (cmValue value = this->GetProperty(prop)) { cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, *value, context, true); } } if (prop == "INTERFACE_LINK_LIBRARIES") { - if (cmProp value = this->GetProperty(prop)) { + if (cmValue value = this->GetProperty(prop)) { cmTargetCheckINTERFACE_LINK_LIBRARIES(*value, context); } } @@ -1600,14 +1601,14 @@ void cmTarget::CheckProperty(const std::string& prop, } } -cmProp cmTarget::GetComputedProperty(const std::string& prop, - cmMessenger* messenger, - cmListFileBacktrace const& context) const +cmValue cmTarget::GetComputedProperty(const std::string& prop, + cmMessenger* messenger, + cmListFileBacktrace const& context) const { return cmTargetPropertyComputer::GetProperty(this, prop, messenger, context); } -cmProp cmTarget::GetProperty(const std::string& prop) const +cmValue cmTarget::GetProperty(const std::string& prop) const { static std::unordered_set const specialProps{ propC_STANDARD, @@ -1640,7 +1641,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const if (propertyIter == this->impl->LanguageStandardProperties.end()) { return nullptr; } - return cmProp(propertyIter->second.Value); + return cmValue(propertyIter->second.Value); } if (prop == propLINK_LIBRARIES) { if (this->impl->LinkImplementationPropertyEntries.empty()) { @@ -1649,11 +1650,11 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->LinkImplementationPropertyEntries, ";"); - return cmProp(output); + return cmValue(output); } // the type property returns what type the target is if (prop == propTYPE) { - return cmProp(cmState::GetTargetTypeName(this->GetType())); + return cmValue(cmState::GetTargetTypeName(this->GetType())); } if (prop == propINCLUDE_DIRECTORIES) { if (this->impl->IncludeDirectoriesEntries.empty()) { @@ -1662,7 +1663,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->IncludeDirectoriesEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propCOMPILE_FEATURES) { if (this->impl->CompileFeaturesEntries.empty()) { @@ -1671,7 +1672,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->CompileFeaturesEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propCOMPILE_OPTIONS) { if (this->impl->CompileOptionsEntries.empty()) { @@ -1680,7 +1681,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->CompileOptionsEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propCOMPILE_DEFINITIONS) { if (this->impl->CompileDefinitionsEntries.empty()) { @@ -1689,7 +1690,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->CompileDefinitionsEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propLINK_OPTIONS) { if (this->impl->LinkOptionsEntries.empty()) { @@ -1698,7 +1699,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->LinkOptionsEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propLINK_DIRECTORIES) { if (this->impl->LinkDirectoriesEntries.empty()) { @@ -1708,7 +1709,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->LinkDirectoriesEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propMANUALLY_ADDED_DEPENDENCIES) { if (this->impl->Utilities.empty()) { @@ -1725,7 +1726,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const return item.Value.first; }); output = cmJoin(utilities, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propPRECOMPILE_HEADERS) { if (this->impl->PrecompileHeadersEntries.empty()) { @@ -1734,31 +1735,31 @@ cmProp cmTarget::GetProperty(const std::string& prop) const static std::string output; output = cmJoin(this->impl->PrecompileHeadersEntries, ";"); - return cmProp(output); + return cmValue(output); } if (prop == propIMPORTED) { - return this->IsImported() ? cmProp(propTRUE) : cmProp(propFALSE); + return this->IsImported() ? cmValue(propTRUE) : cmValue(propFALSE); } if (prop == propIMPORTED_GLOBAL) { - return this->IsImportedGloballyVisible() ? cmProp(propTRUE) - : cmProp(propFALSE); + return this->IsImportedGloballyVisible() ? cmValue(propTRUE) + : cmValue(propFALSE); } if (prop == propNAME) { - return cmProp(this->GetName()); + return cmValue(this->GetName()); } if (prop == propBINARY_DIR) { - return cmProp(this->impl->Makefile->GetStateSnapshot() - .GetDirectory() - .GetCurrentBinary()); + return cmValue(this->impl->Makefile->GetStateSnapshot() + .GetDirectory() + .GetCurrentBinary()); } if (prop == propSOURCE_DIR) { - return cmProp(this->impl->Makefile->GetStateSnapshot() - .GetDirectory() - .GetCurrentSource()); + return cmValue(this->impl->Makefile->GetStateSnapshot() + .GetDirectory() + .GetCurrentSource()); } } - cmProp retVal = this->impl->Properties.GetPropertyValue(prop); + cmValue retVal = this->impl->Properties.GetPropertyValue(prop); if (!retVal) { const bool chain = this->impl->Makefile->GetState()->IsPropertyChained( prop, cmProperty::TARGET); @@ -1774,7 +1775,7 @@ cmProp cmTarget::GetProperty(const std::string& prop) const std::string const& cmTarget::GetSafeProperty(std::string const& prop) const { - cmProp ret = this->GetProperty(prop); + cmValue ret = this->GetProperty(prop); if (ret) { return *ret; } @@ -1935,8 +1936,8 @@ std::string cmTarget::ImportedGetFullPath( std::string result; - cmProp loc = nullptr; - cmProp imp = nullptr; + cmValue loc = nullptr; + cmValue imp = nullptr; std::string suffix; if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && @@ -1947,9 +1948,9 @@ std::string cmTarget::ImportedGetFullPath( result = *loc; } else { std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix); - if (cmProp config_location = this->GetProperty(impProp)) { + if (cmValue config_location = this->GetProperty(impProp)) { result = *config_location; - } else if (cmProp location = + } else if (cmValue location = this->GetProperty("IMPORTED_LOCATION")) { result = *location; } @@ -1962,9 +1963,9 @@ std::string cmTarget::ImportedGetFullPath( } 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)) { result = *config_implib; - } else if (cmProp implib = this->GetProperty("IMPORTED_IMPLIB")) { + } else if (cmValue implib = this->GetProperty("IMPORTED_IMPLIB")) { result = *implib; } } @@ -2042,8 +2043,8 @@ bool cmTargetInternals::CheckImportedLibName(std::string const& prop, return true; } -bool cmTarget::GetMappedConfig(std::string const& desired_config, cmProp& loc, - cmProp& imp, std::string& suffix) const +bool cmTarget::GetMappedConfig(std::string const& desired_config, cmValue& loc, + cmValue& imp, std::string& suffix) const { std::string config_upper; if (!desired_config.empty()) { @@ -2065,7 +2066,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, cmProp& loc, std::vector mappedConfigs; { std::string mapProp = cmStrCat("MAP_IMPORTED_CONFIG_", config_upper); - if (cmProp mapValue = this->GetProperty(mapProp)) { + if (cmValue mapValue = this->GetProperty(mapProp)) { cmExpandList(*mapValue, mappedConfigs, true); } } @@ -2147,7 +2148,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, cmProp& loc, // any available configuration. if (!loc && !imp) { std::vector availableConfigs; - if (cmProp iconfigs = this->GetProperty("IMPORTED_CONFIGURATIONS")) { + if (cmValue iconfigs = this->GetProperty("IMPORTED_CONFIGURATIONS")) { cmExpandList(*iconfigs, availableConfigs); } for (auto aci = availableConfigs.begin(); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index eced1ae..3cf6942 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -14,10 +14,10 @@ #include "cmAlgorithms.h" #include "cmListFileCache.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmTargetLinkLibraryType.h" +#include "cmValue.h" class cmCustomCommand; class cmGlobalGenerator; @@ -170,21 +170,21 @@ public: //! Set/Get a property of this target file void SetProperty(const std::string& prop, const char* value); - void SetProperty(const std::string& prop, cmProp value); + void SetProperty(const std::string& prop, cmValue value); void SetProperty(const std::string& prop, const std::string& value) { - this->SetProperty(prop, cmProp(value)); + this->SetProperty(prop, cmValue(value)); } void AppendProperty(const std::string& prop, const std::string& value, bool asString = false); //! 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; void CheckProperty(const std::string& prop, cmMakefile* context) const; - cmProp GetComputedProperty(const std::string& prop, cmMessenger* messenger, - cmListFileBacktrace const& context) const; + cmValue GetComputedProperty(const std::string& prop, cmMessenger* messenger, + cmListFileBacktrace const& context) const; //! Get all properties cmPropertyMap const& GetProperties() const; @@ -199,8 +199,8 @@ public: bool IsPerConfig() const; bool CanCompileSources() const; - bool GetMappedConfig(std::string const& desired_config, cmProp& loc, - cmProp& imp, std::string& suffix) const; + bool GetMappedConfig(std::string const& desired_config, cmValue& loc, + cmValue& imp, std::string& suffix) const; //! Return whether this target is an executable with symbol exports enabled. bool IsExecutableWithExports() const; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 3423b30..d39824b 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -14,13 +14,13 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetLinkLibraryType.h" +#include "cmValue.h" #include "cmake.h" namespace { @@ -278,7 +278,7 @@ bool cmTargetLinkLibrariesCommand(std::vector const& args, // with old versions of CMake and new) llt = GENERAL_LibraryType; std::string linkType = cmStrCat(args[0], "_LINK_TYPE"); - cmProp linkTypeString = mf.GetDefinition(linkType); + cmValue linkTypeString = mf.GetDefinition(linkType); if (linkTypeString) { if (*linkTypeString == "debug") { llt = DEBUG_LibraryType; diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index e41714a..3bd1ea3 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -5,9 +5,9 @@ #include "cmExecutionStatus.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmStateTypes.h" #include "cmTarget.h" +#include "cmValue.h" #include "cmake.h" cmTargetPropCommandBase::cmTargetPropCommandBase(cmExecutionStatus& status) @@ -181,7 +181,7 @@ void cmTargetPropCommandBase::HandleInterfaceContent( { if (prepend) { const std::string propName = std::string("INTERFACE_") + this->Property; - cmProp propValue = tgt->GetProperty(propName); + cmValue propValue = tgt->GetProperty(propName); const std::string totalContent = this->Join(content) + (propValue ? (";" + *propValue) : std::string()); tgt->SetProperty(propName, totalContent); diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index a749b53..e61a1fc 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -7,10 +7,10 @@ #include #include "cmListFileCache.h" -#include "cmProperty.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" class cmMessenger; @@ -18,11 +18,11 @@ class cmTargetPropertyComputer { public: template - static cmProp GetProperty(Target const* tgt, const std::string& prop, - cmMessenger* messenger, - cmListFileBacktrace const& context) + static cmValue GetProperty(Target const* tgt, const std::string& prop, + cmMessenger* messenger, + cmListFileBacktrace const& context) { - if (cmProp loc = GetLocation(tgt, prop, messenger, context)) { + if (cmValue loc = GetLocation(tgt, prop, messenger, context)) { return loc; } if (cmSystemTools::GetFatalErrorOccured()) { @@ -46,9 +46,9 @@ private: std::string const& config); template - static cmProp GetLocation(Target const* tgt, std::string const& prop, - cmMessenger* messenger, - cmListFileBacktrace const& context) + static cmValue GetLocation(Target const* tgt, std::string const& prop, + cmMessenger* messenger, + cmListFileBacktrace const& context) { // Watch for special "computed" properties that are dependent on @@ -65,7 +65,7 @@ private: context)) { return nullptr; } - return cmProp(ComputeLocationForBuild(tgt)); + return cmValue(ComputeLocationForBuild(tgt)); } // Support "LOCATION_". @@ -76,7 +76,7 @@ private: return nullptr; } std::string configName = prop.substr(9); - return cmProp(ComputeLocation(tgt, configName)); + return cmValue(ComputeLocation(tgt, configName)); } // Support "_LOCATION". @@ -89,7 +89,7 @@ private: context)) { return nullptr; } - return cmProp(ComputeLocation(tgt, configName)); + return cmValue(ComputeLocation(tgt, configName)); } } } @@ -97,6 +97,6 @@ private: } template - static cmProp GetSources(Target const* tgt, cmMessenger* messenger, - cmListFileBacktrace const& context); + static cmValue GetSources(Target const* tgt, cmMessenger* messenger, + cmListFileBacktrace const& context); }; diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 9d25ce9..5618487 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -6,6 +6,7 @@ #include "cmProperty.h" #include "cmState.h" #include "cmStringAlgorithms.h" +#include "cmValue.h" cmTest::cmTest(cmMakefile* mf) : CommandExpandLists(false) @@ -32,14 +33,14 @@ void cmTest::SetCommand(std::vector const& command) this->Command = command; } -cmProp cmTest::GetProperty(const std::string& prop) const +cmValue cmTest::GetProperty(const std::string& prop) const { - cmProp retVal = this->Properties.GetPropertyValue(prop); + cmValue retVal = this->Properties.GetPropertyValue(prop); if (!retVal) { const bool chain = this->Makefile->GetState()->IsPropertyChained(prop, cmProperty::TEST); if (chain) { - if (cmProp p = this->Makefile->GetProperty(prop, chain)) { + if (cmValue p = this->Makefile->GetProperty(prop, chain)) { return p; } } @@ -57,7 +58,7 @@ void cmTest::SetProperty(const std::string& prop, const char* value) { this->Properties.SetProperty(prop, value); } -void cmTest::SetProperty(const std::string& prop, cmProp value) +void cmTest::SetProperty(const std::string& prop, cmValue value) { this->Properties.SetProperty(prop, value); } diff --git a/Source/cmTest.h b/Source/cmTest.h index a790501..85978da 100644 --- a/Source/cmTest.h +++ b/Source/cmTest.h @@ -8,8 +8,8 @@ #include #include "cmListFileCache.h" -#include "cmProperty.h" #include "cmPropertyMap.h" +#include "cmValue.h" class cmMakefile; @@ -35,14 +35,14 @@ public: //! Set/Get a property of this source file void SetProperty(const std::string& prop, const char* value); - void SetProperty(const std::string& prop, cmProp value); + void SetProperty(const std::string& prop, cmValue value); void SetProperty(const std::string& prop, const std::string& value) { - this->SetProperty(prop, cmProp(value)); + this->SetProperty(prop, cmValue(value)); } void AppendProperty(const std::string& prop, const std::string& value, bool asString = false); - cmProp GetProperty(const std::string& prop) const; + cmValue GetProperty(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const; cmPropertyMap& GetProperties() { return this->Properties; } diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 7022c4e..dbb0876 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -19,13 +19,13 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmRange.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTest.h" +#include "cmValue.h" namespace /* anonymous */ { @@ -167,7 +167,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, exe = target->GetFullPath(config); // Prepend with the emulator when cross compiling if required. - cmProp emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); + cmValue emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); if (cmNonempty(emulator)) { std::vector emulatorWithArgs = cmExpandedList(*emulator); std::string emulatorExe(emulatorWithArgs[0]); diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8cac74d..cc9e158 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -9,12 +9,12 @@ #include "cmDuration.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmRange.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" class cmExecutionStatus; @@ -162,7 +162,7 @@ bool cmTryRunCommand::InitialPass(std::vector const& argv, if (!this->OutputVariable.empty()) { // if the TryCompileCore saved output in this outputVariable then // prepend that output to this output - cmProp compileOutput = + cmValue compileOutput = this->Makefile->GetDefinition(this->OutputVariable); if (compileOutput) { runOutputContents = *compileOutput + runOutputContents; @@ -260,7 +260,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmStateEnums::STRING); cmState* state = this->Makefile->GetState(); - cmProp existingValue = state->GetCacheEntryValue(this->RunResultVariable); + cmValue existingValue = state->GetCacheEntryValue(this->RunResultVariable); if (existingValue) { state->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } @@ -282,7 +282,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, internalRunOutputName, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmStateEnums::STRING); cmState* state = this->Makefile->GetState(); - cmProp existing = state->GetCacheEntryValue(internalRunOutputName); + cmValue existing = state->GetCacheEntryValue(internalRunOutputName); if (existing) { state->SetCacheEntryProperty(internalRunOutputName, "ADVANCED", "1"); } diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index d276c8a..2805a33 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -6,11 +6,11 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" // cmUtilitySourceCommand bool cmUtilitySourceCommand(std::vector const& args, @@ -25,7 +25,7 @@ bool cmUtilitySourceCommand(std::vector const& args, // The first argument is the cache entry name. std::string const& cacheEntry = *arg++; - cmProp cacheValue = status.GetMakefile().GetDefinition(cacheEntry); + cmValue cacheValue = status.GetMakefile().GetDefinition(cacheEntry); // If it exists already and appears up to date then we are done. If // the string contains "(IntDir)" but that is not the // CMAKE_CFG_INTDIR setting then the value is out of date. @@ -85,7 +85,7 @@ bool cmUtilitySourceCommand(std::vector const& args, std::string utilityDirectory = status.GetMakefile().GetCurrentBinaryDirectory(); std::string exePath; - if (cmProp d = + if (cmValue d = status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH")) { exePath = *d; } diff --git a/Source/cmValue.cxx b/Source/cmValue.cxx new file mode 100644 index 0000000..59bf201 --- /dev/null +++ b/Source/cmValue.cxx @@ -0,0 +1,113 @@ + +#include "cmValue.h" + +#include + +#include + +#include "cmStringAlgorithms.h" + +std::string cmValue::Empty; + +bool cmValue::IsOn(cm::string_view value) noexcept +{ + switch (value.size()) { + case 1: + return value[0] == '1' || value[0] == 'Y' || value[0] == 'y'; + case 2: + return // + (value[0] == 'O' || value[0] == 'o') && // + (value[1] == 'N' || value[1] == 'n'); + case 3: + return // + (value[0] == 'Y' || value[0] == 'y') && // + (value[1] == 'E' || value[1] == 'e') && // + (value[2] == 'S' || value[2] == 's'); + case 4: + return // + (value[0] == 'T' || value[0] == 't') && // + (value[1] == 'R' || value[1] == 'r') && // + (value[2] == 'U' || value[2] == 'u') && // + (value[3] == 'E' || value[3] == 'e'); + default: + break; + } + + return false; +} + +bool cmValue::IsOff(cm::string_view value) noexcept +{ + switch (value.size()) { + case 0: + return true; + case 1: + return value[0] == '0' || value[0] == 'N' || value[0] == 'n'; + case 2: + return // + (value[0] == 'N' || value[0] == 'n') && // + (value[1] == 'O' || value[1] == 'o'); + case 3: + return // + (value[0] == 'O' || value[0] == 'o') && // + (value[1] == 'F' || value[1] == 'f') && // + (value[2] == 'F' || value[2] == 'f'); + case 5: + return // + (value[0] == 'F' || value[0] == 'f') && // + (value[1] == 'A' || value[1] == 'a') && // + (value[2] == 'L' || value[2] == 'l') && // + (value[3] == 'S' || value[3] == 's') && // + (value[4] == 'E' || value[4] == 'e'); + case 6: + return // + (value[0] == 'I' || value[0] == 'i') && // + (value[1] == 'G' || value[1] == 'g') && // + (value[2] == 'N' || value[2] == 'n') && // + (value[3] == 'O' || value[3] == 'o') && // + (value[4] == 'R' || value[4] == 'r') && // + (value[5] == 'E' || value[5] == 'e'); + default: + break; + } + + return IsNOTFOUND(value); +} +bool cmValue::IsNOTFOUND(cm::string_view value) noexcept +{ + return (value == "NOTFOUND"_s) || cmHasSuffix(value, "-NOTFOUND"_s); +} + +int cmValue::Compare(cmValue value) const noexcept +{ + if (this->Value == nullptr && !value) { + return 0; + } + if (this->Value == nullptr) { + return -1; + } + if (!value) { + return 1; + } + return this->Value->compare(*value); +} + +int cmValue::Compare(cm::string_view value) const noexcept +{ + if (this->Value == nullptr && value.data() == nullptr) { + return 0; + } + if (this->Value == nullptr) { + return -1; + } + if (value.data() == nullptr) { + return 1; + } + return cm::string_view(*this->Value).compare(value); +} + +std::ostream& operator<<(std::ostream& o, cmValue v) +{ + o << *v; + return o; +} diff --git a/Source/cmValue.h b/Source/cmValue.h new file mode 100644 index 0000000..43a5e0d --- /dev/null +++ b/Source/cmValue.h @@ -0,0 +1,214 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +#include "cmConfigure.h" // IWYU pragma: keep + +#include +#include +#include + +#include + +class cmValue +{ +public: + cmValue() noexcept = default; + cmValue(std::nullptr_t) noexcept {} + explicit cmValue(const std::string* value) noexcept + : Value(value) + { + } + explicit cmValue(const std::string& value) noexcept + : Value(&value) + { + } + cmValue(const cmValue& other) noexcept = default; + + cmValue& operator=(const cmValue& other) noexcept = default; + cmValue& operator=(std::nullptr_t) noexcept + { + this->Value = nullptr; + return *this; + } + + const std::string* Get() const noexcept { return this->Value; } + const char* GetCStr() const noexcept + { + return this->Value == nullptr ? nullptr : this->Value->c_str(); + } + + const std::string* operator->() const noexcept + { + return this->Value == nullptr ? &cmValue::Empty : this->Value; + } + const std::string& operator*() const noexcept + { + return this->Value == nullptr ? cmValue::Empty : *this->Value; + } + + explicit operator bool() const noexcept { return this->Value != nullptr; } + operator const std::string&() const noexcept { return this->operator*(); } + explicit operator cm::string_view() const noexcept + { + return this->operator*(); + } + + /** + * Does the value indicate a true or ON value? + */ + bool IsOn() const noexcept + { + return this->Value != nullptr && + cmValue::IsOn(cm::string_view(*this->Value)); + } + /** + * Does the value indicate a false or off value ? Note that this is + * not the same as !IsOn(...) because there are a number of + * ambiguous values such as "/usr/local/bin" a path will result in + * IsOn and IsOff both returning false. Note that the special path + * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. + */ + bool IsOff() const noexcept + { + return this->Value == nullptr || + cmValue::IsOff(cm::string_view(*this->Value)); + } + /** Return true if value is NOTFOUND or ends in -NOTFOUND. */ + bool IsNOTFOUND() const noexcept + { + return this->Value != nullptr && + cmValue::IsNOTFOUND(cm::string_view(*this->Value)); + } + bool IsEmpty() const noexcept + { + return this->Value == nullptr || this->Value->empty(); + } + + bool IsSet() const noexcept + { + return !this->IsEmpty() && !this->IsNOTFOUND(); + } + + /** + * Does a string indicate a true or ON value? + */ + static bool IsOn(const char* value) noexcept + { + return value != nullptr && IsOn(cm::string_view(value)); + } + static bool IsOn(cm::string_view) noexcept; + + /** + * Compare method has same semantic as std::optional::compare + */ + int Compare(cmValue value) const noexcept; + int Compare(cm::string_view value) const noexcept; + + /** + * Does a string indicate a false or off value ? Note that this is + * not the same as !IsOn(...) because there are a number of + * ambiguous values such as "/usr/local/bin" a path will result in + * IsOn and IsOff both returning false. Note that the special path + * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. + */ + static bool IsOff(const char* value) noexcept + { + return value == nullptr || IsOff(cm::string_view(value)); + } + static bool IsOff(cm::string_view) noexcept; + + /** Return true if value is NOTFOUND or ends in -NOTFOUND. */ + static bool IsNOTFOUND(const char* value) noexcept + { + return value == nullptr || IsNOTFOUND(cm::string_view(value)); + } + static bool IsNOTFOUND(cm::string_view) noexcept; + + static bool IsEmpty(const char* value) noexcept + { + return value == nullptr || *value == '\0'; + } + static bool IsEmpty(cm::string_view value) noexcept { return value.empty(); } + +private: + static std::string Empty; + const std::string* Value = nullptr; +}; + +std::ostream& operator<<(std::ostream& o, cmValue v); + +inline bool operator==(cmValue l, cmValue r) noexcept +{ + return l.Compare(r) == 0; +} +inline bool operator!=(cmValue l, cmValue r) noexcept +{ + return l.Compare(r) != 0; +} +inline bool operator<(cmValue l, cmValue r) noexcept +{ + return l.Compare(r) < 0; +} +inline bool operator<=(cmValue l, cmValue r) noexcept +{ + return l.Compare(r) <= 0; +} +inline bool operator>(cmValue l, cmValue r) noexcept +{ + return l.Compare(r) > 0; +} +inline bool operator>=(cmValue l, cmValue r) noexcept +{ + return l.Compare(r) >= 0; +} + +inline bool operator==(cmValue l, cm::string_view r) noexcept +{ + return l.Compare(r) == 0; +} +inline bool operator!=(cmValue l, cm::string_view r) noexcept +{ + return l.Compare(r) != 0; +} +inline bool operator<(cmValue l, cm::string_view r) noexcept +{ + return l.Compare(r) < 0; +} +inline bool operator<=(cmValue l, cm::string_view r) noexcept +{ + return l.Compare(r) <= 0; +} +inline bool operator>(cmValue l, cm::string_view r) noexcept +{ + return l.Compare(r) > 0; +} +inline bool operator>=(cmValue l, cm::string_view r) noexcept +{ + return l.Compare(r) >= 0; +} + +inline bool operator==(cmValue l, std::nullptr_t) noexcept +{ + return l.Compare(cmValue{}) == 0; +} +inline bool operator!=(cmValue l, std::nullptr_t) noexcept +{ + return l.Compare(cmValue{}) != 0; +} +inline bool operator<(cmValue l, std::nullptr_t) noexcept +{ + return l.Compare(cmValue{}) < 0; +} +inline bool operator<=(cmValue l, std::nullptr_t) noexcept +{ + return l.Compare(cmValue{}) <= 0; +} +inline bool operator>(cmValue l, std::nullptr_t) noexcept +{ + return l.Compare(cmValue{}) > 0; +} +inline bool operator>=(cmValue l, std::nullptr_t) noexcept +{ + return l.Compare(cmValue{}) >= 0; +} diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 1fe03ab..2b1efba 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -4,10 +4,10 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" // cmLibraryCommand bool cmVariableRequiresCommand(std::vector const& args, @@ -38,7 +38,7 @@ bool cmVariableRequiresCommand(std::vector const& args, } } } - cmProp reqVar = status.GetMakefile().GetDefinition(resultVariable); + cmValue reqVar = status.GetMakefile().GetDefinition(resultVariable); // if reqVar is unset, then set it to requirementsMet // if reqVar is set to true, but requirementsMet is false , then // set reqVar to false. diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index 7c7fbca..fd5402c 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -10,9 +10,9 @@ #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmVariableWatch.h" #include "cmake.h" @@ -45,7 +45,7 @@ void cmVariableWatchCommandVariableAccessed(const std::string& variable, std::string stack = *mf->GetProperty("LISTFILE_STACK"); if (!data->Command.empty()) { - cmProp const currentListFile = + cmValue const currentListFile = mf->GetDefinition("CMAKE_CURRENT_LIST_FILE"); const auto fakeLineNo = std::numeric_limits::max(); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index e7ef7ea..1ea0461 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -437,7 +437,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->VerifyNecessaryFiles(); } - cmProp vsProjectTypes = + cmValue vsProjectTypes = this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES"); if (vsProjectTypes) { const char* tagName = "ProjectTypes"; @@ -447,11 +447,11 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Element(tagName, *vsProjectTypes); } - cmProp vsProjectName = + cmValue vsProjectName = this->GeneratorTarget->GetProperty("VS_SCC_PROJECTNAME"); - cmProp vsLocalPath = + cmValue vsLocalPath = this->GeneratorTarget->GetProperty("VS_SCC_LOCALPATH"); - cmProp vsProvider = + cmValue vsProvider = this->GeneratorTarget->GetProperty("VS_SCC_PROVIDER"); if (vsProjectName && vsLocalPath && vsProvider) { @@ -459,7 +459,7 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Element("SccLocalPath", *vsLocalPath); e1.Element("SccProvider", *vsProvider); - cmProp vsAuxPath = + cmValue vsAuxPath = this->GeneratorTarget->GetProperty("VS_SCC_AUXPATH"); if (vsAuxPath) { e1.Element("SccAuxPath", *vsAuxPath); @@ -470,7 +470,7 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Element("WinMDAssembly", "true"); } - cmProp vsGlobalKeyword = + cmValue vsGlobalKeyword = this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD"); if (!vsGlobalKeyword) { if (this->GlobalGenerator->TargetsAndroid()) { @@ -482,17 +482,17 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Element("Keyword", *vsGlobalKeyword); } - cmProp vsGlobalRootNamespace = + cmValue vsGlobalRootNamespace = this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE"); if (vsGlobalRootNamespace) { e1.Element("RootNamespace", *vsGlobalRootNamespace); } e1.Element("Platform", this->Platform); - cmProp projLabel = this->GeneratorTarget->GetProperty("PROJECT_LABEL"); + cmValue projLabel = this->GeneratorTarget->GetProperty("PROJECT_LABEL"); e1.Element("ProjectName", projLabel ? projLabel : this->Name); { - cmProp targetFramework = + cmValue targetFramework = this->GeneratorTarget->GetProperty("DOTNET_TARGET_FRAMEWORK"); if (targetFramework) { if (targetFramework->find(';') != std::string::npos) { @@ -502,7 +502,7 @@ void cmVisualStudio10TargetGenerator::Generate() } } else { // TODO: add deprecation warning for VS_* property? - cmProp p = this->GeneratorTarget->GetProperty( + cmValue p = this->GeneratorTarget->GetProperty( "VS_DOTNET_TARGET_FRAMEWORK_VERSION"); if (!p) { p = this->GeneratorTarget->GetProperty( @@ -527,12 +527,12 @@ void cmVisualStudio10TargetGenerator::Generate() } if (this->ProjectType == csproj && this->GlobalGenerator->TargetsWindowsCE()) { - cmProp targetFrameworkId = this->GeneratorTarget->GetProperty( + cmValue targetFrameworkId = this->GeneratorTarget->GetProperty( "VS_TARGET_FRAMEWORK_IDENTIFIER"); e1.Element("TargetFrameworkIdentifier", targetFrameworkId ? *targetFrameworkId : "WindowsEmbeddedCompact"); - cmProp targetFrameworkVer = this->GeneratorTarget->GetProperty( + cmValue targetFrameworkVer = this->GeneratorTarget->GetProperty( "VS_TARGET_FRAMEWORKS_TARGET_VERSION"); e1.Element("TargetFrameworkTargetsVersion", targetFrameworkVer ? *targetFrameworkVer : "v8.0"); @@ -571,7 +571,7 @@ void cmVisualStudio10TargetGenerator::Generate() globalKey == "ROOTNAMESPACE" || globalKey == "KEYWORD") { continue; } - cmProp value = this->GeneratorTarget->GetProperty(keyIt); + cmValue value = this->GeneratorTarget->GetProperty(keyIt); if (!value) continue; e1.Element(globalKey, *value); @@ -694,7 +694,7 @@ void cmVisualStudio10TargetGenerator::Generate() props = VS10_CSharp_USER_PROPS; break; } - if (cmProp p = this->GeneratorTarget->GetProperty("VS_USER_PROPS")) { + if (cmValue p = this->GeneratorTarget->GetProperty("VS_USER_PROPS")) { props = *p; } if (!props.empty()) { @@ -807,7 +807,7 @@ void cmVisualStudio10TargetGenerator::Generate() void cmVisualStudio10TargetGenerator::WritePackageReferences(Elem& e0) { std::vector packageReferences; - if (cmProp vsPackageReferences = + if (cmValue vsPackageReferences = this->GeneratorTarget->GetProperty("VS_PACKAGE_REFERENCES")) { cmExpandList(*vsPackageReferences, packageReferences); } @@ -827,7 +827,7 @@ void cmVisualStudio10TargetGenerator::WritePackageReferences(Elem& e0) void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0) { std::vector references; - if (cmProp vsDotNetReferences = + if (cmValue vsDotNetReferences = this->GeneratorTarget->GetProperty("VS_DOTNET_REFERENCES")) { cmExpandList(*vsDotNetReferences, references); } @@ -886,7 +886,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference( e2.Element("ReferenceOutputAssembly", "true"); if (!hint.empty()) { const char* privateReference = "True"; - if (cmProp value = this->GeneratorTarget->GetProperty( + if (cmValue value = this->GeneratorTarget->GetProperty( "VS_DOTNET_REFERENCES_COPY_LOCAL")) { if (cmIsOff(*value)) { privateReference = "False"; @@ -900,7 +900,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference( void cmVisualStudio10TargetGenerator::WriteImports(Elem& e0) { - cmProp imports = + cmValue imports = this->GeneratorTarget->Target->GetProperty("VS_PROJECT_IMPORT"); if (imports) { std::vector argsSplit = cmExpandedList(*imports, false); @@ -1004,7 +1004,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0) ".Designer.cs"; if (cmsys::SystemTools::FileExists(designerResource)) { std::string generator = "PublicResXFileCodeGenerator"; - if (cmProp g = oi->GetProperty("VS_RESOURCE_GENERATOR")) { + if (cmValue g = oi->GetProperty("VS_RESOURCE_GENERATOR")) { generator = *g; } if (!generator.empty()) { @@ -1028,7 +1028,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0) cm::string_view tagName = cm::string_view(p).substr(propNamePrefix.length()); if (!tagName.empty()) { - cmProp value = props.GetPropertyValue(p); + cmValue value = props.GetPropertyValue(p); if (cmNonempty(value)) { e2.Element(tagName, *value); } @@ -1047,7 +1047,7 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0) for (cmSourceFile const* oi : this->XamlObjs) { std::string obj = oi->GetFullPath(); std::string xamlType; - cmProp xamlTypeProperty = oi->GetProperty("VS_XAML_TYPE"); + cmValue xamlTypeProperty = oi->GetProperty("VS_XAML_TYPE"); if (xamlTypeProperty) { xamlType = *xamlTypeProperty; } else { @@ -1101,7 +1101,7 @@ void cmVisualStudio10TargetGenerator::WriteTargetsFileReferences(Elem& e1) void cmVisualStudio10TargetGenerator::WriteWinRTReferences(Elem& e0) { std::vector references; - if (cmProp vsWinRTReferences = + if (cmValue vsWinRTReferences = this->GeneratorTarget->GetProperty("VS_WINRT_REFERENCES")) { cmExpandList(*vsWinRTReferences, references); } @@ -1144,7 +1144,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) if (this->ProjectType != csproj) { std::string configType; - if (cmProp vsConfigurationType = + if (cmValue vsConfigurationType = this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE")) { configType = cmGeneratorExpression::Evaluate(*vsConfigurationType, this->LocalGenerator, c); @@ -1206,9 +1206,9 @@ void cmVisualStudio10TargetGenerator::WriteCEDebugProjectConfigurationValues( if (!this->GlobalGenerator->TargetsWindowsCE()) { return; } - cmProp additionalFiles = + cmValue additionalFiles = this->GeneratorTarget->GetProperty("DEPLOYMENT_ADDITIONAL_FILES"); - cmProp remoteDirectory = + cmValue remoteDirectory = this->GeneratorTarget->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY"); if (!(additionalFiles || remoteDirectory)) { return; @@ -1230,7 +1230,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues( Elem& e1, std::string const& config) { cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator; - cmProp mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); + cmValue mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); if (mfcFlag) { std::string const mfcFlagValue = cmGeneratorExpression::Evaluate(*mfcFlag, this->LocalGenerator, config); @@ -1260,7 +1260,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues( } else { e1.Element("CharacterSet", "MultiByte"); } - if (cmProp projectToolsetOverride = + if (cmValue projectToolsetOverride = this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) { e1.Element("PlatformToolset", *projectToolsetOverride); } else if (const char* toolset = gg->GetPlatformToolset()) { @@ -1306,7 +1306,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged( o.RemoveFlag("Platform"); } - if (cmProp projectToolsetOverride = + if (cmValue projectToolsetOverride = this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) { e1.Element("PlatformToolset", *projectToolsetOverride); } else if (const char* toolset = gg->GetPlatformToolset()) { @@ -1317,7 +1317,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged( cmStrCat(cmSystemTools::UpperCase(config), "_POSTFIX"); std::string assemblyName = this->GeneratorTarget->GetOutputName( config, cmStateEnums::RuntimeBinaryArtifact); - if (cmProp postfix = this->GeneratorTarget->GetProperty(postfixName)) { + if (cmValue postfix = this->GeneratorTarget->GetProperty(postfixName)) { assemblyName += *postfix; } e1.Element("AssemblyName", assemblyName); @@ -1338,18 +1338,18 @@ void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues( cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator; const char* toolset = gg->GetPlatformToolset(); e1.Element("NdkToolchainVersion", toolset ? toolset : "Default"); - if (cmProp minApi = this->GeneratorTarget->GetProperty("ANDROID_API_MIN")) { + if (cmValue minApi = this->GeneratorTarget->GetProperty("ANDROID_API_MIN")) { e1.Element("AndroidMinAPI", "android-" + *minApi); } - if (cmProp api = this->GeneratorTarget->GetProperty("ANDROID_API")) { + if (cmValue api = this->GeneratorTarget->GetProperty("ANDROID_API")) { e1.Element("AndroidTargetAPI", "android-" + *api); } - if (cmProp cpuArch = this->GeneratorTarget->GetProperty("ANDROID_ARCH")) { + if (cmValue cpuArch = this->GeneratorTarget->GetProperty("ANDROID_ARCH")) { e1.Element("AndroidArch", *cpuArch); } - if (cmProp stlType = + if (cmValue stlType = this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE")) { e1.Element("AndroidStlType", *stlType); } @@ -1359,13 +1359,13 @@ void cmVisualStudio10TargetGenerator::WriteAndroidConfigurationValues( Elem& e1, std::string const&) { cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator; - if (cmProp projectToolsetOverride = + if (cmValue projectToolsetOverride = this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) { e1.Element("PlatformToolset", *projectToolsetOverride); } else if (const char* toolset = gg->GetPlatformToolset()) { e1.Element("PlatformToolset", toolset); } - if (cmProp stlType = + if (cmValue stlType = this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE")) { if (*stlType != "none") { e1.Element("UseOfStl", *stlType); @@ -1891,37 +1891,37 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( if (ext == "hlsl") { tool = "FXCompile"; // Figure out the type of shader compiler to use. - if (cmProp st = sf->GetProperty("VS_SHADER_TYPE")) { + if (cmValue st = sf->GetProperty("VS_SHADER_TYPE")) { for (const std::string& config : this->Configurations) { toolSettings[config]["ShaderType"] = *st; } } // Figure out which entry point to use if any - if (cmProp se = sf->GetProperty("VS_SHADER_ENTRYPOINT")) { + if (cmValue se = sf->GetProperty("VS_SHADER_ENTRYPOINT")) { for (const std::string& config : this->Configurations) { toolSettings[config]["EntryPointName"] = *se; } } // Figure out which shader model to use if any - if (cmProp sm = sf->GetProperty("VS_SHADER_MODEL")) { + if (cmValue sm = sf->GetProperty("VS_SHADER_MODEL")) { for (const std::string& config : this->Configurations) { toolSettings[config]["ShaderModel"] = *sm; } } // Figure out which output header file to use if any - if (cmProp ohf = sf->GetProperty("VS_SHADER_OUTPUT_HEADER_FILE")) { + if (cmValue ohf = sf->GetProperty("VS_SHADER_OUTPUT_HEADER_FILE")) { for (const std::string& config : this->Configurations) { toolSettings[config]["HeaderFileOutput"] = *ohf; } } // Figure out which variable name to use if any - if (cmProp vn = sf->GetProperty("VS_SHADER_VARIABLE_NAME")) { + if (cmValue vn = sf->GetProperty("VS_SHADER_VARIABLE_NAME")) { for (const std::string& config : this->Configurations) { toolSettings[config]["VariableName"] = *vn; } } // Figure out if there's any additional flags to use - if (cmProp saf = sf->GetProperty("VS_SHADER_FLAGS")) { + if (cmValue saf = sf->GetProperty("VS_SHADER_FLAGS")) { cmGeneratorExpression ge; std::unique_ptr cge = ge.Parse(*saf); @@ -1934,7 +1934,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } } // Figure out if debug information should be generated - if (cmProp sed = sf->GetProperty("VS_SHADER_ENABLE_DEBUG")) { + if (cmValue sed = sf->GetProperty("VS_SHADER_ENABLE_DEBUG")) { cmGeneratorExpression ge; std::unique_ptr cge = ge.Parse(*sed); @@ -1948,7 +1948,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } } // Figure out if optimizations should be disabled - if (cmProp sdo = sf->GetProperty("VS_SHADER_DISABLE_OPTIMIZATIONS")) { + if (cmValue sdo = sf->GetProperty("VS_SHADER_DISABLE_OPTIMIZATIONS")) { cmGeneratorExpression ge; std::unique_ptr cge = ge.Parse(*sdo); @@ -1961,7 +1961,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } } } - if (cmProp sofn = sf->GetProperty("VS_SHADER_OBJECT_FILE_NAME")) { + if (cmValue sofn = sf->GetProperty("VS_SHADER_OBJECT_FILE_NAME")) { for (const std::string& config : this->Configurations) { toolSettings[config]["ObjectFileOutput"] = *sofn; } @@ -1984,7 +1984,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } else if (ext == "vsixmanifest") { subType = "Designer"; } - if (cmProp c = sf->GetProperty("VS_COPY_TO_OUT_DIR")) { + if (cmValue c = sf->GetProperty("VS_COPY_TO_OUT_DIR")) { tool = "Content"; copyToOutDir = *c; toolHasSettings = true; @@ -2013,7 +2013,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } } - cmProp toolOverride = sf->GetProperty("VS_TOOL_OVERRIDE"); + cmValue toolOverride = sf->GetProperty("VS_TOOL_OVERRIDE"); if (cmNonempty(toolOverride)) { tool = toolOverride->c_str(); } @@ -2022,12 +2022,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( std::string deployLocation; if (this->GlobalGenerator->TargetsWindowsPhone() || this->GlobalGenerator->TargetsWindowsStore()) { - cmProp content = sf->GetProperty("VS_DEPLOYMENT_CONTENT"); + cmValue content = sf->GetProperty("VS_DEPLOYMENT_CONTENT"); if (cmNonempty(content)) { toolHasSettings = true; deployContent = *content; - cmProp location = sf->GetProperty("VS_DEPLOYMENT_LOCATION"); + cmValue location = sf->GetProperty("VS_DEPLOYMENT_LOCATION"); if (cmNonempty(location)) { deployLocation = *location; } @@ -2035,7 +2035,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } if (ParsedToolTargetSettings.find(tool) == ParsedToolTargetSettings.end()) { - cmProp toolTargetProperty = this->GeneratorTarget->Target->GetProperty( + cmValue toolTargetProperty = this->GeneratorTarget->Target->GetProperty( "VS_SOURCE_SETTINGS_" + std::string(tool)); ConfigToSettings toolTargetSettings; if (toolTargetProperty) { @@ -2202,7 +2202,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) for (const auto& config : this->Configurations) { toolSettings[config]; } - if (cmProp p = si.Source->GetProperty("VS_SETTINGS")) { + if (cmValue p = si.Source->GetProperty("VS_SETTINGS")) { ParseSettingsProperty(*p, toolSettings); } @@ -2399,22 +2399,22 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( bool configDependentDefines = false; std::string includes; bool configDependentIncludes = false; - if (cmProp cflags = sf.GetProperty("COMPILE_FLAGS")) { + if (cmValue cflags = sf.GetProperty("COMPILE_FLAGS")) { configDependentFlags = cmGeneratorExpression::Find(*cflags) != std::string::npos; flags += *cflags; } - if (cmProp coptions = sf.GetProperty("COMPILE_OPTIONS")) { + if (cmValue coptions = sf.GetProperty("COMPILE_OPTIONS")) { configDependentOptions = cmGeneratorExpression::Find(*coptions) != std::string::npos; options += *coptions; } - if (cmProp cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) { + if (cmValue cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) { configDependentDefines = cmGeneratorExpression::Find(*cdefs) != std::string::npos; defines += *cdefs; } - if (cmProp cincludes = sf.GetProperty("INCLUDE_DIRECTORIES")) { + if (cmValue cincludes = sf.GetProperty("INCLUDE_DIRECTORIES")) { configDependentIncludes = cmGeneratorExpression::Find(*cincludes) != std::string::npos; includes += *cincludes; @@ -2452,7 +2452,7 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( std::string configUpper = cmSystemTools::UpperCase(config); std::string configDefines = defines; std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", configUpper); - if (cmProp ccdefs = sf.GetProperty(defPropName)) { + if (cmValue ccdefs = sf.GetProperty(defPropName)) { if (!configDefines.empty()) { configDefines += ";"; } @@ -2628,7 +2628,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( const std::string cond = this->CalcCondition(config); if (ttype <= cmStateEnums::UTILITY) { - if (cmProp workingDir = this->GeneratorTarget->GetProperty( + if (cmValue workingDir = this->GeneratorTarget->GetProperty( "VS_DEBUGGER_WORKING_DIRECTORY")) { std::string genWorkingDir = cmGeneratorExpression::Evaluate( *workingDir, this->LocalGenerator, config); @@ -2636,7 +2636,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( genWorkingDir); } - if (cmProp environment = + if (cmValue environment = this->GeneratorTarget->GetProperty("VS_DEBUGGER_ENVIRONMENT")) { std::string genEnvironment = cmGeneratorExpression::Evaluate( *environment, this->LocalGenerator, config); @@ -2644,7 +2644,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( genEnvironment); } - if (cmProp debuggerCommand = + if (cmValue debuggerCommand = this->GeneratorTarget->GetProperty("VS_DEBUGGER_COMMAND")) { std::string genDebuggerCommand = cmGeneratorExpression::Evaluate( *debuggerCommand, this->LocalGenerator, config); @@ -2652,7 +2652,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( genDebuggerCommand); } - if (cmProp commandArguments = this->GeneratorTarget->GetProperty( + if (cmValue commandArguments = this->GeneratorTarget->GetProperty( "VS_DEBUGGER_COMMAND_ARGUMENTS")) { std::string genCommandArguments = cmGeneratorExpression::Evaluate( *commandArguments, this->LocalGenerator, config); @@ -2684,40 +2684,40 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions( e1.WritePlatformConfigTag("IntDir", cond, intermediateDir); - if (cmProp sdkExecutableDirectories = this->Makefile->GetDefinition( + if (cmValue sdkExecutableDirectories = this->Makefile->GetDefinition( "CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES")) { e1.WritePlatformConfigTag("ExecutablePath", cond, *sdkExecutableDirectories); } - if (cmProp sdkIncludeDirectories = this->Makefile->GetDefinition( + if (cmValue sdkIncludeDirectories = this->Makefile->GetDefinition( "CMAKE_VS_SDK_INCLUDE_DIRECTORIES")) { e1.WritePlatformConfigTag("IncludePath", cond, *sdkIncludeDirectories); } - if (cmProp sdkReferenceDirectories = this->Makefile->GetDefinition( + if (cmValue sdkReferenceDirectories = this->Makefile->GetDefinition( "CMAKE_VS_SDK_REFERENCE_DIRECTORIES")) { e1.WritePlatformConfigTag("ReferencePath", cond, *sdkReferenceDirectories); } - if (cmProp sdkLibraryDirectories = this->Makefile->GetDefinition( + if (cmValue sdkLibraryDirectories = this->Makefile->GetDefinition( "CMAKE_VS_SDK_LIBRARY_DIRECTORIES")) { e1.WritePlatformConfigTag("LibraryPath", cond, *sdkLibraryDirectories); } - if (cmProp sdkLibraryWDirectories = this->Makefile->GetDefinition( + if (cmValue sdkLibraryWDirectories = this->Makefile->GetDefinition( "CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES")) { e1.WritePlatformConfigTag("LibraryWPath", cond, *sdkLibraryWDirectories); } - if (cmProp sdkSourceDirectories = + if (cmValue sdkSourceDirectories = this->Makefile->GetDefinition("CMAKE_VS_SDK_SOURCE_DIRECTORIES")) { e1.WritePlatformConfigTag("SourcePath", cond, *sdkSourceDirectories); } - if (cmProp sdkExcludeDirectories = this->Makefile->GetDefinition( + if (cmValue sdkExcludeDirectories = this->Makefile->GetDefinition( "CMAKE_VS_SDK_EXCLUDE_DIRECTORIES")) { e1.WritePlatformConfigTag("ExcludePath", cond, *sdkExcludeDirectories); } @@ -2915,7 +2915,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( this->Makefile->IssueMessage(MessageType::WARNING, message); } } - if (cmProp clr = + if (cmValue clr = this->GeneratorTarget->GetProperty("COMMON_LANGUAGE_RUNTIME")) { std::string clrString = *clr; if (!clrString.empty()) { @@ -3058,7 +3058,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( oh.OutputPreprocessorDefinitions(this->LangForClCompile); if (this->NsightTegra) { - if (cmProp processMax = + if (cmValue processMax = this->GeneratorTarget->GetProperty("ANDROID_PROCESS_MAX")) { e2.Element("ProcessMax", *processMax); } @@ -3616,7 +3616,7 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions( std::vector manifest_srcs; this->GeneratorTarget->GetManifests(manifest_srcs, config); - cmProp dpiAware = this->GeneratorTarget->GetProperty("VS_DPI_AWARE"); + cmValue dpiAware = this->GeneratorTarget->GetProperty("VS_DPI_AWARE"); if (!manifest_srcs.empty() || dpiAware) { Elem e2(e1, "Manifest"); @@ -3677,24 +3677,24 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( e2.Element("EnableProGuard", "true"); } - if (cmProp proGuardConfigLocation = + if (cmValue proGuardConfigLocation = this->GeneratorTarget->GetProperty("ANDROID_PROGUARD_CONFIG_PATH")) { e2.Element("ProGuardConfigLocation", *proGuardConfigLocation); } - if (cmProp securePropertiesLocation = + if (cmValue securePropertiesLocation = this->GeneratorTarget->GetProperty("ANDROID_SECURE_PROPS_PATH")) { e2.Element("SecurePropertiesLocation", *securePropertiesLocation); } - if (cmProp nativeLibDirectoriesExpression = + if (cmValue nativeLibDirectoriesExpression = this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES")) { std::string nativeLibDirs = cmGeneratorExpression::Evaluate( *nativeLibDirectoriesExpression, this->LocalGenerator, configName); e2.Element("NativeLibDirectories", nativeLibDirs); } - if (cmProp nativeLibDependenciesExpression = + if (cmValue nativeLibDependenciesExpression = this->GeneratorTarget->GetProperty( "ANDROID_NATIVE_LIB_DEPENDENCIES")) { std::string nativeLibDeps = cmGeneratorExpression::Evaluate( @@ -3702,24 +3702,24 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( e2.Element("NativeLibDependencies", nativeLibDeps); } - if (cmProp javaSourceDir = + if (cmValue javaSourceDir = this->GeneratorTarget->GetProperty("ANDROID_JAVA_SOURCE_DIR")) { e2.Element("JavaSourceDir", *javaSourceDir); } - if (cmProp jarDirectoriesExpression = + if (cmValue jarDirectoriesExpression = this->GeneratorTarget->GetProperty("ANDROID_JAR_DIRECTORIES")) { std::string jarDirectories = cmGeneratorExpression::Evaluate( *jarDirectoriesExpression, this->LocalGenerator, configName); e2.Element("JarDirectories", jarDirectories); } - if (cmProp jarDeps = + if (cmValue jarDeps = this->GeneratorTarget->GetProperty("ANDROID_JAR_DEPENDENCIES")) { e2.Element("JarDependencies", *jarDeps); } - if (cmProp assetsDirectories = + if (cmValue assetsDirectories = this->GeneratorTarget->GetProperty("ANDROID_ASSETS_DIRECTORIES")) { e2.Element("AssetsDirectories", *assetsDirectories); } @@ -3730,7 +3730,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( e2.Element("AndroidManifestLocation", manifest_xml); } - if (cmProp antAdditionalOptions = + if (cmValue antAdditionalOptions = this->GeneratorTarget->GetProperty("ANDROID_ANT_ADDITIONAL_OPTIONS")) { e2.Element("AdditionalOptions", *antAdditionalOptions + " %(AdditionalOptions)"); @@ -3785,13 +3785,13 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::string linkFlagVar = linkFlagVarBase + "_" + CONFIG; flags += " "; flags += this->Makefile->GetRequiredDefinition(linkFlagVar); - cmProp targetLinkFlags = this->GeneratorTarget->GetProperty("LINK_FLAGS"); + cmValue targetLinkFlags = this->GeneratorTarget->GetProperty("LINK_FLAGS"); if (targetLinkFlags) { flags += " "; flags += *targetLinkFlags; } std::string flagsProp = cmStrCat("LINK_FLAGS_", CONFIG); - if (cmProp flagsConfig = this->GeneratorTarget->GetProperty(flagsProp)) { + if (cmValue flagsConfig = this->GeneratorTarget->GetProperty(flagsProp)) { flags += " "; flags += *flagsConfig; } @@ -3872,7 +3872,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( }; } - if (cmProp stackVal = this->Makefile->GetDefinition( + if (cmValue stackVal = this->Makefile->GetDefinition( "CMAKE_" + linkLanguage + "_STACK_SIZE")) { linkOptions.AddFlag("StackReserveSize", *stackVal); } @@ -4273,7 +4273,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) cmLocalGenerator* lg = dt->GetLocalGenerator(); std::string name = dt->GetName(); std::string path; - if (cmProp p = dt->GetProperty("EXTERNAL_MSPROJECT")) { + if (cmValue p = dt->GetProperty("EXTERNAL_MSPROJECT")) { path = *p; } else { path = cmStrCat(lg->GetCurrentBinaryDirectory(), '/', dt->GetName(), @@ -4303,13 +4303,13 @@ void cmVisualStudio10TargetGenerator::WritePlatformExtensions(Elem& e1) // This only applies to Windows 10 apps if (this->GlobalGenerator->TargetsWindowsStore() && cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) { - cmProp desktopExtensionsVersion = + cmValue desktopExtensionsVersion = this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION"); if (desktopExtensionsVersion) { this->WriteSinglePlatformExtension(e1, "WindowsDesktop", *desktopExtensionsVersion); } - cmProp mobileExtensionsVersion = + cmValue mobileExtensionsVersion = this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION"); if (mobileExtensionsVersion) { this->WriteSinglePlatformExtension(e1, "WindowsMobile", @@ -4338,7 +4338,7 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) { std::vector sdkReferences; std::unique_ptr spe1; - if (cmProp vsSDKReferences = + if (cmValue vsSDKReferences = this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) { cmExpandList(*vsSDKReferences, sdkReferences); spe1 = cm::make_unique(e0, "ItemGroup"); @@ -4350,11 +4350,11 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) // This only applies to Windows 10 apps if (this->GlobalGenerator->TargetsWindowsStore() && cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) { - cmProp desktopExtensionsVersion = + cmValue desktopExtensionsVersion = this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION"); - cmProp mobileExtensionsVersion = + cmValue mobileExtensionsVersion = this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION"); - cmProp iotExtensionsVersion = + cmValue iotExtensionsVersion = this->GeneratorTarget->GetProperty("VS_IOT_EXTENSIONS_VERSION"); if (desktopExtensionsVersion || mobileExtensionsVersion || @@ -4564,7 +4564,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1) if (!targetPlatformVersion.empty()) { e1.Element("WindowsTargetPlatformVersion", targetPlatformVersion); } - cmProp targetPlatformMinVersion = this->GeneratorTarget->GetProperty( + cmValue targetPlatformMinVersion = this->GeneratorTarget->GetProperty( "VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION"); if (targetPlatformMinVersion) { e1.Element("WindowsTargetPlatformMinVersion", *targetPlatformMinVersion); @@ -5060,7 +5060,7 @@ void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties( if (cmHasPrefix(p, propNamePrefix)) { std::string tagName = p.substr(propNamePrefix.length()); if (!tagName.empty()) { - cmProp val = props.GetPropertyValue(p); + cmValue val = props.GetPropertyValue(p); if (cmNonempty(val)) { tags[tagName] = *val; } else { @@ -5112,7 +5112,7 @@ std::string cmVisualStudio10TargetGenerator::GetCSharpSourceLink( } else if (!cmHasSuffix(fullFileName, ".cs") && cmHasPrefix(fullFileName, binDir)) { link = fullFileName.substr(binDir.length() + 1); - } else if (cmProp l = source->GetProperty("VS_CSHARP_Link")) { + } else if (cmValue l = source->GetProperty("VS_CSHARP_Link")) { link = *l; } diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index e4329af..e2c0f2d 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -204,7 +204,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, // Info tab begin - if (cmProp exe = + if (cmValue exe = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_EXECUTABLE")) { xout.StartElement("PathRunnable"); @@ -220,7 +220,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, // Arguments tab begin - if (cmProp argList = + if (cmValue argList = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ARGUMENTS")) { std::vector arguments = cmExpandedList(*argList); if (!arguments.empty()) { @@ -240,7 +240,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, } } - if (cmProp envList = + if (cmValue envList = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ENVIRONMENT")) { std::vector envs = cmExpandedList(*envList); if (!envs.empty()) { @@ -323,7 +323,7 @@ bool cmXCodeScheme::WriteLaunchActionBooleanAttribute( cmXMLWriter& xout, const std::string& attrName, const std::string& varName, bool defaultValue) { - cmProp property = Target->GetTarget()->GetProperty(varName); + cmValue property = Target->GetTarget()->GetProperty(varName); bool isOn = (!property && defaultValue) || cmIsOn(property); if (isOn) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7cafaee..fda7900 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -599,7 +599,7 @@ void cmake::ProcessCacheArg(const std::string& var, const std::string& value, bool haveValue = false; std::string cachedValue; if (this->WarnUnusedCli) { - if (cmProp v = this->State->GetInitializedCacheValue(var)) { + if (cmValue v = this->State->GetInitializedCacheValue(var)) { haveValue = true; cachedValue = *v; } @@ -1468,7 +1468,7 @@ void cmake::SetDirectoriesFromFile(const std::string& arg) // If there is a CMakeCache.txt file, use its settings. if (!cachePath.empty()) { if (this->LoadCache(cachePath)) { - cmProp existingValue = + cmValue existingValue = this->State->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (existingValue) { this->SetHomeOutputDirectory(cachePath); @@ -1865,10 +1865,10 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) warning << "\n"; i -= 1; } - cmProp existingValue = this->State->GetCacheEntryValue(save.key); + cmValue existingValue = this->State->GetCacheEntryValue(save.key); if (existingValue) { save.type = this->State->GetCacheEntryType(save.key); - if (cmProp help = + if (cmValue help = this->State->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = *help; } @@ -1917,9 +1917,9 @@ int cmake::Configure() if (this->DiagLevels.count("dev") == 1) { bool setDeprecatedVariables = false; - cmProp cachedWarnDeprecated = + cmValue cachedWarnDeprecated = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); - cmProp cachedErrorDeprecated = + cmValue cachedErrorDeprecated = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED"); // don't overwrite deprecated warning setting from a previous invocation @@ -1958,7 +1958,7 @@ int cmake::Configure() // Cache variables may have already been set by a previous invocation, // so we cannot rely on command line options alone. Always ensure our // messenger is in sync with the cache. - cmProp value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); + cmValue value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(*value)); value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED"); @@ -1971,7 +1971,7 @@ int cmake::Configure() this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(*value)); int ret = this->ActualConfigure(); - cmProp delCacheVars = + cmValue delCacheVars = this->State->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if (delCacheVars && !delCacheVars->empty()) { return this->HandleDeleteCacheVariables(*delCacheVars); @@ -1999,8 +1999,8 @@ int cmake::ActualConfigure() // no generator specified on the command line if (!this->GlobalGenerator) { - cmProp genName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); - cmProp extraGenName = + cmValue genName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); + cmValue extraGenName = this->State->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); if (genName) { std::string fullName = @@ -2023,7 +2023,7 @@ int cmake::ActualConfigure() } } - cmProp genName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); + cmValue genName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); if (genName) { if (!this->GlobalGenerator->MatchesGeneratorName(*genName)) { std::string message = @@ -2053,7 +2053,7 @@ int cmake::ActualConfigure() } } - if (cmProp instance = + if (cmValue instance = this->State->GetInitializedCacheValue("CMAKE_GENERATOR_INSTANCE")) { if (this->GeneratorInstanceSet && this->GeneratorInstance != *instance) { std::string message = @@ -2070,7 +2070,7 @@ int cmake::ActualConfigure() cmStateEnums::INTERNAL); } - if (cmProp platformName = + if (cmValue platformName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) { if (this->GeneratorPlatformSet && this->GeneratorPlatform != *platformName) { @@ -2087,7 +2087,7 @@ int cmake::ActualConfigure() "Name of generator platform.", cmStateEnums::INTERNAL); } - if (cmProp tsName = + if (cmValue tsName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if (this->GeneratorToolsetSet && this->GeneratorToolset != *tsName) { std::string message = @@ -2410,7 +2410,7 @@ int cmake::Generate() return 0; } -void cmake::AddCacheEntry(const std::string& key, cmProp value, +void cmake::AddCacheEntry(const std::string& key, cmValue value, const char* helpString, int type) { this->State->AddCacheEntry(key, value, helpString, @@ -2486,7 +2486,7 @@ std::string cmake::StripExtension(const std::string& file) const return file; } -cmProp cmake::GetCacheDefinition(const std::string& name) const +cmValue cmake::GetCacheDefinition(const std::string& name) const { return this->State->GetInitializedCacheValue(name); } @@ -2695,7 +2695,7 @@ void cmake::PrintGeneratorList() void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: - cmProp tablepath = + cmValue tablepath = this->State->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE"); if (tablepath) { @@ -2913,7 +2913,7 @@ void cmake::SetProperty(const std::string& prop, const char* value) { this->State->SetGlobalProperty(prop, value); } -void cmake::SetProperty(const std::string& prop, cmProp value) +void cmake::SetProperty(const std::string& prop, cmValue value) { this->State->SetGlobalProperty(prop, value); } @@ -2924,7 +2924,7 @@ void cmake::AppendProperty(const std::string& prop, const std::string& value, this->State->AppendGlobalProperty(prop, value, asString); } -cmProp cmake::GetProperty(const std::string& prop) +cmValue cmake::GetProperty(const std::string& prop) { return this->State->GetGlobalProperty(prop); } @@ -3169,7 +3169,7 @@ void cmake::IssueMessage(MessageType t, std::string const& text, std::vector cmake::GetDebugConfigs() { std::vector configs; - if (cmProp config_list = + if (cmValue config_list = this->State->GetGlobalProperty("DEBUG_CONFIGURATIONS")) { // Expand the specified list and convert to upper-case. cmExpandList(*config_list, configs); @@ -3318,7 +3318,7 @@ int cmake::Build(int jobs, std::string dir, std::vector targets, std::cerr << "Error: could not load cache\n"; return 1; } - cmProp cachedGenerator = this->State->GetCacheEntryValue("CMAKE_GENERATOR"); + cmValue cachedGenerator = this->State->GetCacheEntryValue("CMAKE_GENERATOR"); if (!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; @@ -3330,7 +3330,7 @@ int cmake::Build(int jobs, std::string dir, std::vector targets, return 1; } this->SetGlobalGenerator(std::move(gen)); - cmProp cachedGeneratorInstance = + cmValue cachedGeneratorInstance = this->State->GetCacheEntryValue("CMAKE_GENERATOR_INSTANCE"); if (cachedGeneratorInstance) { cmMakefile mf(this->GetGlobalGenerator(), this->GetCurrentSnapshot()); @@ -3339,7 +3339,7 @@ int cmake::Build(int jobs, std::string dir, std::vector targets, return 1; } } - cmProp cachedGeneratorPlatform = + cmValue cachedGeneratorPlatform = this->State->GetCacheEntryValue("CMAKE_GENERATOR_PLATFORM"); if (cachedGeneratorPlatform) { cmMakefile mf(this->GetGlobalGenerator(), this->GetCurrentSnapshot()); @@ -3348,7 +3348,7 @@ int cmake::Build(int jobs, std::string dir, std::vector targets, return 1; } } - cmProp cachedGeneratorToolset = + cmValue cachedGeneratorToolset = this->State->GetCacheEntryValue("CMAKE_GENERATOR_TOOLSET"); if (cachedGeneratorToolset) { cmMakefile mf(this->GetGlobalGenerator(), this->GetCurrentSnapshot()); @@ -3359,7 +3359,7 @@ int cmake::Build(int jobs, std::string dir, std::vector targets, } std::string output; std::string projName; - cmProp cachedProjectName = + cmValue cachedProjectName = this->State->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if (!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; @@ -3451,12 +3451,12 @@ bool cmake::Open(const std::string& dir, bool dryRun) std::cerr << "Error: could not load cache\n"; return false; } - cmProp genName = this->State->GetCacheEntryValue("CMAKE_GENERATOR"); + cmValue genName = this->State->GetCacheEntryValue("CMAKE_GENERATOR"); if (!genName) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return false; } - cmProp extraGenName = + cmValue extraGenName = this->State->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string fullName = cmExternalMakefileProjectGenerator::CreateFullGeneratorName( @@ -3470,7 +3470,7 @@ bool cmake::Open(const std::string& dir, bool dryRun) return false; } - cmProp cachedProjectName = + cmValue cachedProjectName = this->State->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if (!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; diff --git a/Source/cmake.h b/Source/cmake.h index 7408044..3f2b2ed 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -21,10 +21,10 @@ #include "cmInstalledFile.h" #include "cmListFileCache.h" #include "cmMessageType.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" +#include "cmValue.h" #if !defined(CMAKE_BOOTSTRAP) # include @@ -329,21 +329,21 @@ public: /** * Given a variable name, return its value (as a string). */ - cmProp GetCacheDefinition(const std::string&) const; + cmValue GetCacheDefinition(const std::string&) const; //! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, const char* helpString, int 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, int 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, int type); bool DoWriteGlobVerifyTarget() const; @@ -408,14 +408,14 @@ public: //! Set/Get a property of this target file void SetProperty(const std::string& prop, const char* value); - void SetProperty(const std::string& prop, cmProp value); + void SetProperty(const std::string& prop, cmValue value); void SetProperty(const std::string& prop, const std::string& value) { - this->SetProperty(prop, cmProp(value)); + this->SetProperty(prop, cmValue(value)); } void AppendProperty(const std::string& prop, const std::string& value, bool asString = false); - cmProp GetProperty(const std::string& prop); + cmValue GetProperty(const std::string& prop); bool GetPropertyAsBool(const std::string& prop); //! Get or create an cmInstalledFile instance and return a pointer to it diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 64d93df..61d4ae4 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -25,11 +25,11 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmMessageMetadata.h" -#include "cmProperty.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" #include "cmake.h" #include "cmcmd.h" @@ -375,11 +375,11 @@ int do_cmake(int ac, char const* const* av) cmStateEnums::CacheEntryType t = cm.GetState()->GetCacheEntryType(k); if (t != cmStateEnums::INTERNAL && t != cmStateEnums::STATIC && t != cmStateEnums::UNINITIALIZED) { - cmProp advancedProp = + cmValue advancedProp = cm.GetState()->GetCacheEntryProperty(k, "ADVANCED"); if (list_all_cached || !advancedProp) { if (list_help) { - cmProp help = + cmValue help = cm.GetState()->GetCacheEntryProperty(k, "HELPSTRING"); std::cout << "// " << (help ? *help : "") << std::endl; } diff --git a/bootstrap b/bootstrap index d0329fb..d48a867 100755 --- a/bootstrap +++ b/bootstrap @@ -426,7 +426,7 @@ CMAKE_CXX_SOURCES="\ cmPolicies \ cmProcessOutput \ cmProjectCommand \ - cmProperty \ + cmValue \ cmPropertyDefinition \ cmPropertyMap \ cmGccDepfileLexerHelper \ -- cgit v0.12