diff --git a/Source/cmPackageInfoReader.cxx b/Source/cmPackageInfoReader.cxx index 63288f71f2..b4adf76bc8 100644 --- a/Source/cmPackageInfoReader.cxx +++ b/Source/cmPackageInfoReader.cxx @@ -646,13 +646,13 @@ void cmPackageInfoReader::SetImportProperty(cmTarget* target, } void cmPackageInfoReader::SetMetaProperty( - cmTarget* target, cm::string_view property, Json::Value const& value, + cmTarget* target, std::string const& property, Json::Value const& value, std::string const& defaultValue) const { if (!value.isNull()) { - target->SetProperty(property.data(), value.asString()); + target->SetProperty(property, value.asString()); } else if (!defaultValue.empty()) { - target->SetProperty(property.data(), defaultValue); + target->SetProperty(property, defaultValue); } } @@ -734,7 +734,7 @@ void cmPackageInfoReader::SetTargetProperties( // Add other information. if (configuration.empty()) { - this->SetMetaProperty(target, "SPDX_LICENSE"_s, data["license"], + this->SetMetaProperty(target, "SPDX_LICENSE", data["license"], this->DefaultLicense); } } diff --git a/Source/cmPackageInfoReader.h b/Source/cmPackageInfoReader.h index 440f571be3..1f1e9d7410 100644 --- a/Source/cmPackageInfoReader.h +++ b/Source/cmPackageInfoReader.h @@ -100,7 +100,7 @@ private: void SetImportProperty(cmTarget* target, cm::string_view property, cm::string_view configuration, Json::Value const& value) const; - void SetMetaProperty(cmTarget* target, cm::string_view property, + void SetMetaProperty(cmTarget* target, std::string const& property, Json::Value const& value, std::string const& defaultValue = {}) const;