diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-21 15:12:35 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-21 15:14:04 (GMT) |
commit | cc56dc7468bfee49dedbf395d6fca5c372d200fe (patch) | |
tree | c4463a4dcdada55ca57cba3713fea88d8d2f3f57 /Source/cmGeneratorTarget.cxx | |
parent | 62834c07603e82aafabc082bbbcf74179a4cda27 (diff) | |
download | CMake-cc56dc7468bfee49dedbf395d6fca5c372d200fe.zip CMake-cc56dc7468bfee49dedbf395d6fca5c372d200fe.tar.gz CMake-cc56dc7468bfee49dedbf395d6fca5c372d200fe.tar.bz2 |
Rename cmProp in cmValue
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 251 |
1 files changed, 127 insertions, 124 deletions
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<cmGeneratorTarget>( +cmValue cmTargetPropertyComputer::GetSources<cmGeneratorTarget>( cmGeneratorTarget const* tgt, cmMessenger* /* messenger */, cmListFileBacktrace const& /* context */) { @@ -322,7 +322,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) cmGeneratorTarget::~cmGeneratorTarget() = default; -cmProp cmGeneratorTarget::GetSourcesProperty() const +cmValue cmGeneratorTarget::GetSourcesProperty() const { std::vector<std::string> values; for (auto const& se : this->SourceEntries) { @@ -331,7 +331,7 @@ cmProp cmGeneratorTarget::GetSourcesProperty() const static std::string value; value.clear(); value = cmJoin(values, ";"); - return cmProp(value); + return cmValue(value); } cmGlobalGenerator* cmGeneratorTarget::GetGlobalGenerator() const @@ -356,7 +356,7 @@ const std::string& cmGeneratorTarget::GetName() const std::string cmGeneratorTarget::GetExportName() const { - cmProp exportName = this->GetProperty("EXPORT_NAME"); + cmValue exportName = this->GetProperty("EXPORT_NAME"); if (cmNonempty(exportName)) { if (!cmGeneratorExpression::IsValidTargetName(*exportName)) { @@ -371,9 +371,9 @@ std::string cmGeneratorTarget::GetExportName() const return this->GetName(); } -cmProp cmGeneratorTarget::GetProperty(const std::string& prop) const +cmValue cmGeneratorTarget::GetProperty(const std::string& prop) const { - if (cmProp result = cmTargetPropertyComputer::GetProperty( + if (cmValue result = cmTargetPropertyComputer::GetProperty( this, prop, this->Makefile->GetMessenger(), this->GetBacktrace())) { return result; } @@ -475,7 +475,7 @@ std::string cmGeneratorTarget::GetOutputName( std::string outName; for (std::string const& p : props) { - if (cmProp outNameProp = this->GetProperty(p)) { + if (cmValue outNameProp = this->GetProperty(p)) { outName = *outNameProp; break; } @@ -503,7 +503,7 @@ std::string cmGeneratorTarget::GetFilePrefix( const std::string& config, cmStateEnums::ArtifactType artifact) const { if (this->IsImported()) { - cmProp prefix = this->GetFilePrefixInternal(config, artifact); + cmValue prefix = this->GetFilePrefixInternal(config, artifact); return prefix ? *prefix : std::string(); } @@ -517,7 +517,7 @@ std::string cmGeneratorTarget::GetFileSuffix( const std::string& config, cmStateEnums::ArtifactType artifact) const { if (this->IsImported()) { - cmProp suffix = this->GetFileSuffixInternal(config, artifact); + cmValue suffix = this->GetFileSuffixInternal(config, artifact); return suffix ? *suffix : std::string(); } @@ -530,7 +530,7 @@ std::string cmGeneratorTarget::GetFileSuffix( std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const { - cmProp postfix = nullptr; + cmValue postfix = nullptr; std::string frameworkPostfix; if (!config.empty()) { std::string configProp = @@ -548,7 +548,7 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const // framework postfix. frameworkPostfix = this->GetFrameworkMultiConfigPostfix(config); if (!frameworkPostfix.empty()) { - postfix = cmProp(frameworkPostfix); + postfix = cmValue(frameworkPostfix); } } return postfix ? *postfix : std::string(); @@ -557,7 +557,7 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const std::string cmGeneratorTarget::GetFrameworkMultiConfigPostfix( const std::string& config) const { - cmProp postfix = nullptr; + cmValue postfix = nullptr; if (!config.empty()) { std::string configProp = cmStrCat("FRAMEWORK_MULTI_CONFIG_POSTFIX_", cmSystemTools::UpperCase(config)); @@ -572,7 +572,7 @@ std::string cmGeneratorTarget::GetFrameworkMultiConfigPostfix( return postfix ? *postfix : std::string(); } -cmProp cmGeneratorTarget::GetFilePrefixInternal( +cmValue cmGeneratorTarget::GetFilePrefixInternal( std::string const& config, cmStateEnums::ArtifactType artifact, const std::string& language) const { @@ -602,7 +602,7 @@ cmProp cmGeneratorTarget::GetFilePrefixInternal( } // Compute prefix value. - cmProp targetPrefix = + cmValue targetPrefix = (isImportedLibraryArtifact ? this->GetProperty("IMPORT_PREFIX") : this->GetProperty("PREFIX")); @@ -623,7 +623,7 @@ cmProp cmGeneratorTarget::GetFilePrefixInternal( return targetPrefix; } -cmProp cmGeneratorTarget::GetFileSuffixInternal( +cmValue cmGeneratorTarget::GetFileSuffixInternal( std::string const& config, cmStateEnums::ArtifactType artifact, const std::string& language) const { @@ -653,7 +653,7 @@ cmProp cmGeneratorTarget::GetFileSuffixInternal( } // Compute suffix value. - cmProp targetSuffix = + cmValue targetSuffix = (isImportedLibraryArtifact ? this->GetProperty("IMPORT_SUFFIX") : this->GetProperty("SUFFIX")); @@ -738,7 +738,7 @@ void handleSystemIncludesDep(cmLocalGenerator* lg, std::vector<std::string>& result, bool excludeImported, std::string const& language) { - if (cmProp dirs = + if (cmValue dirs = depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) { cmExpandList(cmGeneratorExpression::Evaluate(*dirs, lg, config, headTarget, dagChecker, depTgt, language), @@ -748,7 +748,7 @@ void handleSystemIncludesDep(cmLocalGenerator* lg, return; } - if (cmProp dirs = depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) { + if (cmValue dirs = depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) { cmExpandList(cmGeneratorExpression::Evaluate(*dirs, lg, config, headTarget, dagChecker, depTgt, language), result); @@ -800,17 +800,17 @@ void cmGeneratorTarget::ComputeObjectMapping() } } -cmProp cmGeneratorTarget::GetFeature(const std::string& feature, - const std::string& config) const +cmValue cmGeneratorTarget::GetFeature(const std::string& feature, + const std::string& config) const { if (!config.empty()) { std::string featureConfig = cmStrCat(feature, '_', cmSystemTools::UpperCase(config)); - if (cmProp value = this->GetProperty(featureConfig)) { + if (cmValue value = this->GetProperty(featureConfig)) { return value; } } - if (cmProp value = this->GetProperty(feature)) { + if (cmValue value = this->GetProperty(feature)) { return value; } return this->LocalGenerator->GetFeature(feature, config); @@ -838,7 +838,7 @@ const char* cmGeneratorTarget::GetLinkPIEProperty( bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang, std::string const& config) const { - cmProp feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config); + cmValue feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config); if (!cmIsOn(feature)) { // 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies @@ -946,23 +946,23 @@ BTs<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty( cmStrCat(lang, "_STANDARD")); } -cmProp cmGeneratorTarget::GetLanguageStandard(std::string const& lang, - std::string const& config) const +cmValue cmGeneratorTarget::GetLanguageStandard(std::string const& lang, + std::string const& config) const { BTs<std::string> const* languageStandard = this->GetLanguageStandardProperty(lang, config); if (languageStandard) { - return cmProp(languageStandard->Value); + return cmValue(languageStandard->Value); } return nullptr; } -cmProp cmGeneratorTarget::GetPropertyWithPairedLanguageSupport( +cmValue cmGeneratorTarget::GetPropertyWithPairedLanguageSupport( std::string const& lang, const char* suffix) const { - cmProp propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix)); + cmValue propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix)); if (!propertyValue) { // Check if we should use the value set by another language. if (lang == "OBJC") { @@ -975,7 +975,7 @@ cmProp cmGeneratorTarget::GetPropertyWithPairedLanguageSupport( return propertyValue; } -cmProp cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const +cmValue cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const { return this->GetPropertyWithPairedLanguageSupport(lang, "_EXTENSIONS"); } @@ -1170,7 +1170,7 @@ const std::string& cmGeneratorTarget::GetLocationForBuild() const // Now handle the deprecated build-time configuration location. std::string const noConfig; location = this->GetDirectory(noConfig); - cmProp cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR"); + cmValue cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR"); if (cfgid && (*cfgid != ".")) { location += "/"; location += *cfgid; @@ -1330,7 +1330,7 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty( cmGeneratorTarget const* headTarget = context->HeadTarget ? context->HeadTarget : this; - if (cmProp p = this->GetProperty(prop)) { + if (cmValue p = this->GetProperty(prop)) { result = cmGeneratorExpressionNode::EvaluateDependentExpression( *p, context->LG, context, headTarget, &dagChecker, this); } @@ -1453,7 +1453,7 @@ void AddLangSpecificImplicitIncludeDirectories( auto* lg = dependency->GetLocalGenerator(); EvaluatedTargetPropertyEntry entry{ library, library.Backtrace }; - if (cmProp val = dependency->GetProperty(propertyName)) { + if (cmValue val = dependency->GetProperty(propertyName)) { entry.Values.emplace_back(*val); } else { if (mode == IncludeDirectoryFallBack::BINARY) { @@ -1985,12 +1985,12 @@ std::string cmGeneratorTarget::GetCompilePDBName( // Check for a per-configuration output directory target property. std::string configUpper = cmSystemTools::UpperCase(config); std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper); - cmProp config_name = this->GetProperty(configProp); + cmValue config_name = this->GetProperty(configProp); if (cmNonempty(config_name)) { return prefix + *config_name + ".pdb"; } - cmProp name = this->GetProperty("COMPILE_PDB_NAME"); + cmValue name = this->GetProperty("COMPILE_PDB_NAME"); if (cmNonempty(name)) { return prefix + *name + ".pdb"; } @@ -2135,11 +2135,11 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const if (!ll.empty()) { std::string sepVar = cmStrCat("CMAKE_SHARED_LIBRARY_RUNTIME_", ll, "_FLAG_SEP"); - cmProp sep = this->Makefile->GetDefinition(sepVar); + cmValue sep = this->Makefile->GetDefinition(sepVar); if (cmNonempty(sep)) { // TODO: Add binary format check to ABI detection and get rid of // CMAKE_EXECUTABLE_FORMAT. - if (cmProp fmt = + if (cmValue fmt = this->Makefile->GetDefinition("CMAKE_EXECUTABLE_FORMAT")) { if (*fmt == "ELF") { return true; @@ -2192,7 +2192,7 @@ bool cmGeneratorTarget::DetermineHasMacOSXRpathInstallNameDir( if (this->GetType() != cmStateEnums::SHARED_LIBRARY) { return false; } - cmProp install_name = this->GetProperty("INSTALL_NAME_DIR"); + cmValue install_name = this->GetProperty("INSTALL_NAME_DIR"); bool use_install_name = this->MacOSXUseInstallNameDir(); if (install_name && use_install_name && *install_name == "@rpath") { install_name_is_rpath = true; @@ -2250,7 +2250,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const return false; } - cmProp macosx_rpath_str = this->GetProperty("MACOSX_RPATH"); + cmValue macosx_rpath_str = this->GetProperty("MACOSX_RPATH"); if (macosx_rpath_str) { return this->GetPropertyAsBool("MACOSX_RPATH"); } @@ -2267,7 +2267,7 @@ bool cmGeneratorTarget::MacOSXRpathInstallNameDirDefault() const bool cmGeneratorTarget::MacOSXUseInstallNameDir() const { - cmProp build_with_install_name = + cmValue build_with_install_name = this->GetProperty("BUILD_WITH_INSTALL_NAME_DIR"); if (build_with_install_name) { return cmIsOn(*build_with_install_name); @@ -2360,7 +2360,7 @@ std::string cmGeneratorTarget::GetAppBundleDirectory( { std::string fpath = cmStrCat( this->GetFullName(config, cmStateEnums::RuntimeBinaryArtifact), '.'); - cmProp ext = this->GetProperty("BUNDLE_EXTENSION"); + cmValue ext = this->GetProperty("BUNDLE_EXTENSION"); fpath += (ext ? *ext : "app"); if (shouldAddContentLevel(level) && !this->Makefile->PlatformIsAppleEmbedded()) { @@ -2390,7 +2390,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory( std::string fpath = cmStrCat( this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact), '.'); std::string ext; - if (cmProp p = this->GetProperty("BUNDLE_EXTENSION")) { + if (cmValue p = this->GetProperty("BUNDLE_EXTENSION")) { ext = *p; } else { if (this->IsXCTestOnApple()) { @@ -2415,7 +2415,7 @@ std::string cmGeneratorTarget::GetFrameworkDirectory( { std::string fpath = cmStrCat( this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact), '.'); - cmProp ext = this->GetProperty("BUNDLE_EXTENSION"); + cmValue ext = this->GetProperty("BUNDLE_EXTENSION"); fpath += (ext ? *ext : "framework"); if (shouldAddFullLevel(level) && !this->Makefile->PlatformIsAppleEmbedded()) { @@ -2467,7 +2467,7 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree( { if (this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { std::string dir; - cmProp install_name_dir = this->GetProperty("INSTALL_NAME_DIR"); + cmValue install_name_dir = this->GetProperty("INSTALL_NAME_DIR"); if (this->CanGenerateInstallNameDir(INSTALL_NAME_FOR_INSTALL)) { if (cmNonempty(install_name_dir)) { @@ -2516,7 +2516,7 @@ const std::string* cmGeneratorTarget::GetExportMacro() const if (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->GetType() == cmStateEnums::MODULE_LIBRARY || this->IsExecutableWithExports()) { - if (cmProp custom_export_name = this->GetProperty("DEFINE_SYMBOL")) { + if (cmValue custom_export_name = this->GetProperty("DEFINE_SYMBOL")) { this->ExportMacro = *custom_export_name; } else { std::string in = cmStrCat(this->GetName(), "_EXPORTS"); @@ -2814,7 +2814,7 @@ std::string cmGeneratorTarget::GetEffectiveFolderName() const return effectiveFolder; } - cmProp targetFolder = this->GetProperty("FOLDER"); + cmValue targetFolder = this->GetProperty("FOLDER"); if (targetFolder) { effectiveFolder += *targetFolder; } @@ -3042,7 +3042,7 @@ void cmTargetTraceDependencies::Trace() this->CurrentEntry = &this->GeneratorTarget->SourceDepends[sf]; // Queue dependencies added explicitly by the user. - if (cmProp additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) { + if (cmValue additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) { std::vector<std::string> objDeps = cmExpandedList(*additionalDeps); for (std::string& objDep : objDeps) { if (cmSystemTools::FileIsFullPath(objDep)) { @@ -3240,7 +3240,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config, if (!this->Makefile->IsOn("APPLE")) { return; } - cmProp archs = nullptr; + cmValue archs = nullptr; if (!config.empty()) { std::string defVarName = cmStrCat("OSX_ARCHITECTURES_", cmSystemTools::UpperCase(config)); @@ -3260,7 +3260,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config, void cmGeneratorTarget::AddExplicitLanguageFlags(std::string& flags, cmSourceFile const& sf) const { - cmProp lang = sf.GetProperty("LANGUAGE"); + cmValue lang = sf.GetProperty("LANGUAGE"); if (!lang) { return; } @@ -3641,7 +3641,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories( // If this target has ISPC sources make sure to add the header // directory to other compilation units if (cm::contains(this->GetAllConfigCompileLanguages(), "ISPC")) { - if (cmProp val = this->GetProperty(propertyName)) { + if (cmValue val = this->GetProperty(propertyName)) { includes.emplace_back(*val); } else { includes.emplace_back(this->GetObjectDirectory(config)); @@ -3971,7 +3971,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions( if (!config.empty()) { std::string configPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); - cmProp configProp = this->GetProperty(configPropName); + cmValue configProp = this->GetProperty(configPropName); if (configProp) { switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0043)) { case cmPolicies::WARN: { @@ -4046,7 +4046,7 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config, return std::string(); } const cmGeneratorTarget* generatorTarget = this; - cmProp pchReuseFrom = + cmValue pchReuseFrom = generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM"); const auto inserted = @@ -4087,8 +4087,10 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config, const std::string filename_tmp = cmStrCat(filename, ".tmp"); if (!pchReuseFrom) { - cmProp pchPrologue = this->Makefile->GetDefinition("CMAKE_PCH_PROLOGUE"); - cmProp pchEpilogue = this->Makefile->GetDefinition("CMAKE_PCH_EPILOGUE"); + cmValue pchPrologue = + this->Makefile->GetDefinition("CMAKE_PCH_PROLOGUE"); + cmValue pchEpilogue = + this->Makefile->GetDefinition("CMAKE_PCH_EPILOGUE"); std::string firstHeaderOnDisk; { @@ -4159,7 +4161,7 @@ std::string cmGeneratorTarget::GetPchSource(const std::string& config, std::string& filename = inserted.first->second; const cmGeneratorTarget* generatorTarget = this; - cmProp pchReuseFrom = + cmValue pchReuseFrom = generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM"); if (pchReuseFrom) { generatorTarget = @@ -4257,7 +4259,7 @@ std::string cmGeneratorTarget::GetPchFile(const std::string& config, }; cmGeneratorTarget* generatorTarget = this; - cmProp pchReuseFrom = + cmValue pchReuseFrom = generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM"); if (pchReuseFrom) { generatorTarget = @@ -4553,7 +4555,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions( nullptr, nullptr); EvaluatedTargetPropertyEntries entries; - if (cmProp linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { + if (cmValue linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { std::vector<std::string> options = cmExpandedList(*linkOptions); for (const auto& option : options) { std::unique_ptr<TargetPropertyEntry> entry = @@ -4704,7 +4706,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends( nullptr); EvaluatedTargetPropertyEntries entries; - if (cmProp linkDepends = this->GetProperty("LINK_DEPENDS")) { + if (cmValue linkDepends = this->GetProperty("LINK_DEPENDS")) { std::vector<std::string> depends = cmExpandedList(*linkDepends); for (const auto& depend : depends) { std::unique_ptr<TargetPropertyEntry> entry = @@ -4785,7 +4787,7 @@ bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const } std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang); - cmProp currentLanguageStandard = this->GetLanguageStandard(lang, config); + cmValue currentLanguageStandard = this->GetLanguageStandard(lang, config); std::string newRequiredStandard; if (!standardResolver.GetNewRequiredStandard( @@ -4825,7 +4827,7 @@ bool cmGeneratorTarget::ComputeCompileFeatures( this->LanguageStandardMap[key] = *standardToCopy; generatorTargetLanguageStandard = &this->LanguageStandardMap[key]; } else { - cmProp defaultStandard = this->Makefile->GetDefinition( + cmValue defaultStandard = this->Makefile->GetDefinition( cmStrCat("CMAKE_", language.second, "_STANDARD_DEFAULT")); if (defaultStandard) { this->LanguageStandardMap[key] = BTs<std::string>(*defaultStandard); @@ -4928,8 +4930,8 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames( } // Check for library version properties. - cmProp version = this->GetProperty("VERSION"); - cmProp soversion = this->GetProperty("SOVERSION"); + cmValue version = this->GetProperty("VERSION"); + cmValue soversion = this->GetProperty("SOVERSION"); if (!this->HasSOName(config) || this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") || this->IsFrameworkOnApple()) { @@ -5007,10 +5009,10 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames( // This versioning is supported only for executables and then only // when the platform supports symbolic links. #if defined(_WIN32) && !defined(__CYGWIN__) - cmProp version; + cmValue version; #else // Check for executable version properties. - cmProp version = this->GetProperty("VERSION"); + cmValue version = this->GetProperty("VERSION"); if (this->GetType() != cmStateEnums::EXECUTABLE || this->Makefile->IsOn("XCODE")) { version = nullptr; @@ -5104,8 +5106,8 @@ void cmGeneratorTarget::GetFullNameInternal( // retrieve prefix and suffix std::string ll = this->GetLinkerLanguage(config); - cmProp targetPrefix = this->GetFilePrefixInternal(config, artifact, ll); - cmProp targetSuffix = this->GetFileSuffixInternal(config, artifact, ll); + cmValue targetPrefix = this->GetFilePrefixInternal(config, artifact, ll); + cmValue targetSuffix = this->GetFileSuffixInternal(config, artifact, ll); // The implib option is only allowed for shared libraries, module // libraries, and executables. @@ -5123,13 +5125,13 @@ void cmGeneratorTarget::GetFullNameInternal( if (this->IsFrameworkOnApple()) { fw_prefix = cmStrCat(this->GetFrameworkDirectory(config, ContentLevel), '/'); - targetPrefix = cmProp(fw_prefix); + targetPrefix = cmValue(fw_prefix); targetSuffix = nullptr; } if (this->IsCFBundleOnApple()) { fw_prefix = cmStrCat(this->GetCFBundleDirectory(config, FullLevel), '/'); - targetPrefix = cmProp(fw_prefix); + targetPrefix = cmValue(fw_prefix); targetSuffix = nullptr; } @@ -5145,13 +5147,13 @@ void cmGeneratorTarget::GetFullNameInternal( // EXECUTABLE_SUFFIX attribute. if (this->IsFrameworkOnApple() && this->GetGlobalGenerator()->GetName() == "Xcode") { - targetSuffix = cmProp(configPostfix); + targetSuffix = cmValue(configPostfix); } else { outBase += configPostfix; } // Name shared libraries with their version number on some platforms. - if (cmProp soversion = this->GetProperty("SOVERSION")) { + if (cmValue soversion = this->GetProperty("SOVERSION")) { if (this->GetType() == cmStateEnums::SHARED_LIBRARY && !isImportedLibraryArtifact && this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION")) { @@ -5187,7 +5189,7 @@ std::string cmGeneratorTarget::GetPDBOutputName( props.emplace_back("PDB_NAME"); for (std::string const& p : props) { - if (cmProp outName = this->GetProperty(p)) { + if (cmValue outName = this->GetProperty(p)) { base = *outName; break; } @@ -5214,7 +5216,7 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const props.emplace_back("PDB_NAME"); for (std::string const& p : props) { - if (cmProp outName = this->GetProperty(p)) { + if (cmValue outName = this->GetProperty(p)) { base = *outName; break; } @@ -5297,7 +5299,7 @@ cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const } else { // Handle the MACOSX_PACKAGE_LOCATION property on source files that // were not listed in one of the other lists. - if (cmProp location = sf->GetProperty("MACOSX_PACKAGE_LOCATION")) { + if (cmValue location = sf->GetProperty("MACOSX_PACKAGE_LOCATION")) { flags.MacFolder = location->c_str(); const bool stripResources = this->GlobalGenerator->ShouldStripResourcePath(this->Makefile); @@ -5327,7 +5329,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const this->SourceFileFlagsConstructed = true; // Process public headers to mark the source files. - if (cmProp files = this->GetProperty("PUBLIC_HEADER")) { + if (cmValue files = this->GetProperty("PUBLIC_HEADER")) { std::vector<std::string> relFiles = cmExpandedList(*files); for (std::string const& relFile : relFiles) { if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) { @@ -5340,7 +5342,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const // Process private headers after public headers so that they take // precedence if a file is listed in both. - if (cmProp files = this->GetProperty("PRIVATE_HEADER")) { + if (cmValue files = this->GetProperty("PRIVATE_HEADER")) { std::vector<std::string> relFiles = cmExpandedList(*files); for (std::string const& relFile : relFiles) { if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) { @@ -5352,7 +5354,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const } // Mark sources listed as resources. - if (cmProp files = this->GetProperty("RESOURCE")) { + if (cmValue files = this->GetProperty("RESOURCE")) { std::vector<std::string> relFiles = cmExpandedList(*files); for (std::string const& relFile : relFiles) { if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) { @@ -5380,7 +5382,7 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const this->GetLinkImplementationClosure(config); for (cmGeneratorTarget const* li : deps) { #define CM_READ_COMPATIBLE_INTERFACE(X, x) \ - if (cmProp prop = li->GetProperty("COMPATIBLE_INTERFACE_" #X)) { \ + if (cmValue prop = li->GetProperty("COMPATIBLE_INTERFACE_" #X)) { \ std::vector<std::string> props; \ cmExpandList(*prop, props); \ compat.Props##x.insert(props.begin(), props.end()); \ @@ -5490,7 +5492,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender, const std::string& config, CompatibleType t, PropertyType* /*unused*/) { - cmProp prop = dependee->GetProperty(propName); + cmValue prop = dependee->GetProperty(propName); if (!prop) { return; } @@ -5676,7 +5678,7 @@ std::string valueAsString<std::string>(std::string value) return value; } template <> -std::string valueAsString<cmProp>(cmProp value) +std::string valueAsString<cmValue>(cmValue value) { return value ? value : std::string("(unset)"); } @@ -5730,7 +5732,7 @@ bool getTypedProperty<bool>(cmGeneratorTarget const* tgt, return tgt->GetPropertyAsBool(prop); } - cmProp value = tgt->GetProperty(prop); + cmValue value = tgt->GetProperty(prop); return cmIsOn(genexInterpreter->Evaluate(value ? *value : "", prop)); } @@ -5739,7 +5741,7 @@ const char* getTypedProperty<const char*>( cmGeneratorTarget const* tgt, const std::string& prop, cmGeneratorExpressionInterpreter* genexInterpreter) { - cmProp value = tgt->GetProperty(prop); + cmValue value = tgt->GetProperty(prop); if (genexInterpreter == nullptr) { return value.GetCStr(); @@ -5753,7 +5755,7 @@ std::string getTypedProperty<std::string>( cmGeneratorTarget const* tgt, const std::string& prop, cmGeneratorExpressionInterpreter* genexInterpreter) { - cmProp value = tgt->GetProperty(prop); + cmValue value = tgt->GetProperty(prop); if (genexInterpreter == nullptr) { return valueAsString(value); @@ -6130,7 +6132,7 @@ void cmGeneratorTarget::GetTargetVersion(const std::string& property, assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); - if (cmProp version = this->GetProperty(property)) { + if (cmValue version = this->GetProperty(property)) { // Try to parse the version number and store the results that were // successfully parsed. int parsed_major; @@ -6158,12 +6160,12 @@ std::string cmGeneratorTarget::GetRuntimeLinkLibrary( { // This is activated by the presence of a default selection whether or // not it is overridden by a property. - cmProp runtimeLibraryDefault = this->Makefile->GetDefinition( + cmValue runtimeLibraryDefault = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_RUNTIME_LIBRARY_DEFAULT")); if (!cmNonempty(runtimeLibraryDefault)) { return std::string(); } - cmProp runtimeLibraryValue = + cmValue runtimeLibraryValue = this->Target->GetProperty(cmStrCat(lang, "_RUNTIME_LIBRARY")); if (!runtimeLibraryValue) { runtimeLibraryValue = runtimeLibraryDefault; @@ -6186,7 +6188,8 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory( bool cmGeneratorTarget::IsFortranBuildingInstrinsicModules() const { - if (cmProp prop = this->GetProperty("Fortran_BUILDING_INSTRINSIC_MODULES")) { + if (cmValue prop = + this->GetProperty("Fortran_BUILDING_INSTRINSIC_MODULES")) { return cmIsOn(*prop); } return false; @@ -6197,7 +6200,7 @@ std::string cmGeneratorTarget::CreateFortranModuleDirectory( { std::string mod_dir; std::string target_mod_dir; - if (cmProp prop = this->GetProperty("Fortran_MODULE_DIRECTORY")) { + if (cmValue prop = this->GetProperty("Fortran_MODULE_DIRECTORY")) { target_mod_dir = *prop; } else { std::string const& default_mod_dir = @@ -6206,7 +6209,7 @@ std::string cmGeneratorTarget::CreateFortranModuleDirectory( target_mod_dir = default_mod_dir; } } - cmProp moddir_flag = + cmValue moddir_flag = this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG"); if (!target_mod_dir.empty() && moddir_flag) { // Compute the full path to the module directory. @@ -6289,10 +6292,10 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const { assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); - if (cmProp fversion = this->GetProperty("FRAMEWORK_VERSION")) { + if (cmValue fversion = this->GetProperty("FRAMEWORK_VERSION")) { return *fversion; } - if (cmProp tversion = this->GetProperty("VERSION")) { + if (cmValue tversion = this->GetProperty("VERSION")) { return *tversion; } return "A"; @@ -6300,7 +6303,7 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const void cmGeneratorTarget::ComputeVersionedName( std::string& vName, std::string const& prefix, std::string const& base, - std::string const& suffix, std::string const& name, cmProp version) const + std::string const& suffix, std::string const& name, cmValue version) const { vName = this->Makefile->IsOn("APPLE") ? (prefix + base) : name; if (version) { @@ -6548,9 +6551,9 @@ void cmGeneratorTarget::ComputeLinkInterface( // How many repetitions are needed if this library has cyclic // dependencies? std::string propName = cmStrCat("LINK_INTERFACE_MULTIPLICITY", suffix); - if (cmProp config_reps = this->GetProperty(propName)) { + if (cmValue config_reps = this->GetProperty(propName)) { sscanf(config_reps->c_str(), "%u", &iface.Multiplicity); - } else if (cmProp reps = + } else if (cmValue reps = this->GetProperty("LINK_INTERFACE_MULTIPLICITY")) { sscanf(reps->c_str(), "%u", &iface.Multiplicity); } @@ -6707,14 +6710,14 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config, } // Select an output directory. - if (cmProp config_outdir = this->GetProperty(configProp)) { + if (cmValue config_outdir = this->GetProperty(configProp)) { // Use the user-specified per-configuration output directory. out = cmGeneratorExpression::Evaluate(*config_outdir, this->LocalGenerator, config, this); // Skip per-configuration subdirectory. conf.clear(); - } else if (cmProp outdir = this->GetProperty(propertyName)) { + } else if (cmValue outdir = this->GetProperty(propertyName)) { // Use the user-specified output directory. out = cmGeneratorExpression::Evaluate(*outdir, this->LocalGenerator, config, this); @@ -6777,14 +6780,14 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind, } // Select an output directory. - if (cmProp config_outdir = this->GetProperty(configProp)) { + if (cmValue config_outdir = this->GetProperty(configProp)) { // Use the user-specified per-configuration output directory. out = cmGeneratorExpression::Evaluate(*config_outdir, this->LocalGenerator, config); // Skip per-configuration subdirectory. conf.clear(); - } else if (cmProp outdir = this->GetProperty(propertyName)) { + } else if (cmValue outdir = this->GetProperty(propertyName)) { // Use the user-specified output directory. out = cmGeneratorExpression::Evaluate(*outdir, this->LocalGenerator, config); @@ -6837,7 +6840,7 @@ bool cmGeneratorTarget::GetRPATH(const std::string& config, const std::string& prop, std::string& rpath) const { - cmProp value = this->GetProperty(prop); + cmValue value = this->GetProperty(prop); if (!value) { return false; } @@ -6862,7 +6865,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // An explicit list of interface libraries may be set for shared // libraries and executables that export symbols. - cmProp explicitLibraries = nullptr; + cmValue explicitLibraries = nullptr; std::string linkIfaceProp; bool const cmp0022NEW = (this->GetPolicyStatusCMP0022() != cmPolicies::OLD && this->GetPolicyStatusCMP0022() != cmPolicies::WARN); @@ -6891,7 +6894,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( !this->PolicyWarnedCMP0022) { // Compare the explicitly set old link interface properties to the // preferred new link interface property one and warn if different. - cmProp newExplicitLibraries = + cmValue newExplicitLibraries = this->GetProperty("INTERFACE_LINK_LIBRARIES"); if (newExplicitLibraries && (*newExplicitLibraries != *explicitLibraries)) { @@ -6948,7 +6951,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // preferred new link interface property and warn if different. cmLinkInterface ifaceNew; static const std::string newProp = "INTERFACE_LINK_LIBRARIES"; - if (cmProp newExplicitLibraries = this->GetProperty(newProp)) { + if (cmValue newExplicitLibraries = this->GetProperty(newProp)) { this->ExpandLinkItems(newProp, *newExplicitLibraries, config, headTarget, usage_requirements_only, ifaceNew); } @@ -7016,7 +7019,7 @@ std::vector<ValueType> computeImplicitLanguageTargets( std::string const& runtimeLibrary = currentTarget->GetRuntimeLinkLibrary(lang, config); - if (cmProp runtimeLinkOptions = currentTarget->Makefile->GetDefinition( + if (cmValue runtimeLinkOptions = currentTarget->Makefile->GetDefinition( "CMAKE_" + lang + "_RUNTIME_LIBRARIES_" + runtimeLibrary)) { std::vector<std::string> libsVec = cmExpandedList(*runtimeLinkOptions); result.reserve(libsVec.size()); @@ -7154,8 +7157,8 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Initialize members. info.NoSOName = false; - cmProp loc = nullptr; - cmProp imp = nullptr; + cmValue loc = nullptr; + cmValue imp = nullptr; std::string suffix; if (!this->Target->GetMappedConfig(desired_config, loc, imp, suffix)) { return; @@ -7164,7 +7167,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Get the link interface. { std::string linkProp = "INTERFACE_LINK_LIBRARIES"; - cmProp propertyLibs = this->GetProperty(linkProp); + cmValue propertyLibs = this->GetProperty(linkProp); if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) { if (!propertyLibs) { @@ -7197,9 +7200,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, info.Location = *loc; } else { std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix); - if (cmProp config_location = this->GetProperty(impProp)) { + if (cmValue config_location = this->GetProperty(impProp)) { info.Location = *config_location; - } else if (cmProp location = this->GetProperty("IMPORTED_LOCATION")) { + } else if (cmValue location = this->GetProperty("IMPORTED_LOCATION")) { info.Location = *location; } } @@ -7207,9 +7210,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Get the soname. if (this->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string soProp = cmStrCat("IMPORTED_SONAME", suffix); - if (cmProp config_soname = this->GetProperty(soProp)) { + if (cmValue config_soname = this->GetProperty(soProp)) { info.SOName = *config_soname; - } else if (cmProp soname = this->GetProperty("IMPORTED_SONAME")) { + } else if (cmValue soname = this->GetProperty("IMPORTED_SONAME")) { info.SOName = *soname; } } @@ -7217,9 +7220,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Get the "no-soname" mark. if (this->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string soProp = cmStrCat("IMPORTED_NO_SONAME", suffix); - if (cmProp config_no_soname = this->GetProperty(soProp)) { + if (cmValue config_no_soname = this->GetProperty(soProp)) { info.NoSOName = cmIsOn(*config_no_soname); - } else if (cmProp no_soname = this->GetProperty("IMPORTED_NO_SONAME")) { + } else if (cmValue no_soname = this->GetProperty("IMPORTED_NO_SONAME")) { info.NoSOName = cmIsOn(*no_soname); } } @@ -7230,9 +7233,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->IsExecutableWithExports()) { std::string impProp = cmStrCat("IMPORTED_IMPLIB", suffix); - if (cmProp config_implib = this->GetProperty(impProp)) { + if (cmValue config_implib = this->GetProperty(impProp)) { info.ImportLibrary = *config_implib; - } else if (cmProp implib = this->GetProperty("IMPORTED_IMPLIB")) { + } else if (cmValue implib = this->GetProperty("IMPORTED_IMPLIB")) { info.ImportLibrary = *implib; } } @@ -7241,9 +7244,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, { std::string linkProp = cmStrCat("IMPORTED_LINK_DEPENDENT_LIBRARIES", suffix); - if (cmProp config_libs = this->GetProperty(linkProp)) { + if (cmValue config_libs = this->GetProperty(linkProp)) { info.SharedDeps = *config_libs; - } else if (cmProp libs = + } else if (cmValue libs = this->GetProperty("IMPORTED_LINK_DEPENDENT_LIBRARIES")) { info.SharedDeps = *libs; } @@ -7253,9 +7256,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, if (this->LinkLanguagePropagatesToDependents()) { std::string linkProp = cmStrCat("IMPORTED_LINK_INTERFACE_LANGUAGES", suffix); - if (cmProp config_libs = this->GetProperty(linkProp)) { + if (cmValue config_libs = this->GetProperty(linkProp)) { info.Languages = *config_libs; - } else if (cmProp libs = + } else if (cmValue libs = this->GetProperty("IMPORTED_LINK_INTERFACE_LANGUAGES")) { info.Languages = *libs; } @@ -7264,9 +7267,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Get information if target is managed assembly. { std::string linkProp = "IMPORTED_COMMON_LANGUAGE_RUNTIME"; - if (cmProp pc = this->GetProperty(linkProp + suffix)) { + if (cmValue pc = this->GetProperty(linkProp + suffix)) { info.Managed = this->CheckManagedType(*pc); - } else if (cmProp p = this->GetProperty(linkProp)) { + } else if (cmValue p = this->GetProperty(linkProp)) { info.Managed = this->CheckManagedType(*p); } } @@ -7275,9 +7278,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, if (this->GetType() == cmStateEnums::STATIC_LIBRARY) { std::string linkProp = cmStrCat("IMPORTED_LINK_INTERFACE_MULTIPLICITY", suffix); - if (cmProp config_reps = this->GetProperty(linkProp)) { + if (cmValue config_reps = this->GetProperty(linkProp)) { sscanf(config_reps->c_str(), "%u", &info.Multiplicity); - } else if (cmProp reps = + } else if (cmValue reps = this->GetProperty("IMPORTED_LINK_INTERFACE_MULTIPLICITY")) { sscanf(reps->c_str(), "%u", &info.Multiplicity); } @@ -7456,14 +7459,14 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const bool cmGeneratorTarget::IsDeprecated() const { - cmProp deprecation = this->GetProperty("DEPRECATION"); + cmValue deprecation = this->GetProperty("DEPRECATION"); return cmNonempty(deprecation); } std::string cmGeneratorTarget::GetDeprecation() const { // find DEPRECATION property - if (cmProp deprecation = this->GetProperty("DEPRECATION")) { + if (cmValue deprecation = this->GetProperty("DEPRECATION")) { return *deprecation; } return std::string(); @@ -7534,7 +7537,7 @@ bool cmGeneratorTarget::IsCSharpOnly() const std::set<std::string> languages = this->GetAllConfigCompileLanguages(); // Consider an explicit linker language property, but *not* the // computed linker language that may depend on linked targets. - cmProp linkLang = this->GetProperty("LINKER_LANGUAGE"); + cmValue linkLang = this->GetProperty("LINKER_LANGUAGE"); if (cmNonempty(linkLang)) { languages.insert(*linkLang); } @@ -7943,7 +7946,7 @@ cmGeneratorTarget::ManagedType cmGeneratorTarget::GetManagedType( } // Check for explicitly set clr target property. - if (cmProp clr = this->GetProperty("COMMON_LANGUAGE_RUNTIME")) { + if (cmValue clr = this->GetProperty("COMMON_LANGUAGE_RUNTIME")) { return this->CheckManagedType(*clr); } |