diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-01 17:01:21 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-02 17:43:14 (GMT) |
commit | dd968ca38828f45b40a8270783b9a7ef53074f25 (patch) | |
tree | e8e5a363fd6284a98eebcf3bf9398a64a034f7a5 /Source | |
parent | b69fba7cd747c4b7a7a2887aac98a4a214fa82d1 (diff) | |
download | CMake-dd968ca38828f45b40a8270783b9a7ef53074f25.zip CMake-dd968ca38828f45b40a8270783b9a7ef53074f25.tar.gz CMake-dd968ca38828f45b40a8270783b9a7ef53074f25.tar.bz2 |
cmTarget: convert VS property settings to the new property lambda
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8b06031..e8d66cc 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -936,20 +936,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->impl->IsAndroid = (this->impl->Makefile->GetSafeDefinition( "CMAKE_SYSTEM_NAME") == "Android"); - std::string defKey; - defKey.reserve(128); - defKey += "CMAKE_"; - 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 (cmValue value = mf->GetDefinition(defKey)) { - this->SetProperty(property, value); - } else if (default_value) { - this->SetProperty(property, default_value); - } - }; - // Save the backtrace of target construction. this->impl->Backtrace = this->impl->Makefile->GetBacktrace(); @@ -1037,6 +1023,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, config = cmSystemTools::UpperCase(config); } + std::string defKey; + defKey.reserve(128); + defKey += "CMAKE_"; auto initProperty = [this, mf, &defKey](const std::string& property, const char* default_value) { // Replace everything after "CMAKE_" @@ -1096,7 +1085,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (assignment != std::string::npos) { const std::string propName = vsGlobal + i.substr(0, assignment); const std::string propValue = i.substr(assignment + 1); - initPropValue(propName, propValue.c_str()); + initProperty(propName, propValue.c_str()); } } } |