diff options
author | Brad King <brad.king@kitware.com> | 2020-09-03 13:17:58 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-03 13:18:05 (GMT) |
commit | ca5babfd7a1da8e32f927ad086fdd91c2b09853b (patch) | |
tree | 23619c551a1b4c24ff228f98a3503b64a189fb32 /Source/cmTarget.cxx | |
parent | 85e52ea704e13bbf932cd65c225b82f9b945e071 (diff) | |
parent | 11425041f04fd0945480b8f9e9933d1549b93981 (diff) | |
download | CMake-ca5babfd7a1da8e32f927ad086fdd91c2b09853b.zip CMake-ca5babfd7a1da8e32f927ad086fdd91c2b09853b.tar.gz CMake-ca5babfd7a1da8e32f927ad086fdd91c2b09853b.tar.bz2 |
Merge topic 'getdef'
11425041f0 cmMakefile::GetDefinition: return cmProp
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5179
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 4a72d7a..ba648b7 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -265,16 +265,16 @@ 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 (const char* value = mf->GetDefinition(defKey)) { - this->SetProperty(property, value); + if (cmProp value = mf->GetDefinition(defKey)) { + this->SetProperty(property, *value); } }; auto initPropValue = [this, mf, &defKey](const std::string& property, const char* default_value) { // Replace everything after "CMAKE_" defKey.replace(defKey.begin() + 6, defKey.end(), property); - if (const char* value = mf->GetDefinition(defKey)) { - this->SetProperty(property, value); + if (cmProp value = mf->GetDefinition(defKey)) { + this->SetProperty(property, *value); } else if (default_value) { this->SetProperty(property, default_value); } @@ -525,11 +525,11 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, // check for "CMAKE_VS_GLOBALS" variable and set up target properties // if any - const char* globals = mf->GetDefinition("CMAKE_VS_GLOBALS"); + cmProp globals = mf->GetDefinition("CMAKE_VS_GLOBALS"); if (globals) { const std::string genName = mf->GetGlobalGenerator()->GetName(); if (cmHasLiteralPrefix(genName, "Visual Studio")) { - std::vector<std::string> props = cmExpandedList(globals); + std::vector<std::string> props = cmExpandedList(*globals); const std::string vsGlobal = "VS_GLOBAL_"; for (const std::string& i : props) { // split NAME=VALUE @@ -1018,9 +1018,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, std::string const& lib, this->GetPolicyStatusCMP0073() == cmPolicies::WARN)) { std::string targetEntry = cmStrCat(impl->Name, "_LIB_DEPENDS"); std::string dependencies; - const char* old_val = mf.GetDefinition(targetEntry); + cmProp old_val = mf.GetDefinition(targetEntry); if (old_val) { - dependencies += old_val; + dependencies += *old_val; } switch (llt) { case GENERAL_LibraryType: |