From 4a62e3d97c3ae907d9c43d139ff5bef55ef356aa Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 24 Jan 2020 10:32:18 -0600 Subject: macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties Fixes: #17652 --- Source/cmGeneratorTarget.cxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'Source/cmGeneratorTarget.cxx') diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 792cd4d95a..c525a6e8cd 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5280,11 +5280,23 @@ cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation( void cmGeneratorTarget::GetTargetVersion(int& major, int& minor) const { int patch; - this->GetTargetVersion(false, major, minor, patch); + this->GetTargetVersion("VERSION", major, minor, patch); } -void cmGeneratorTarget::GetTargetVersion(bool soversion, int& major, - int& minor, int& patch) const +void cmGeneratorTarget::GetTargetVersionFallback( + const std::string& property, const std::string& fallback_property, + int& major, int& minor, int& patch) const +{ + if (this->GetProperty(property)) { + this->GetTargetVersion(property, major, minor, patch); + } else { + this->GetTargetVersion(fallback_property, major, minor, patch); + } +} + +void cmGeneratorTarget::GetTargetVersion(const std::string& property, + int& major, int& minor, + int& patch) const { // Set the default values. major = 0; @@ -5293,9 +5305,7 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion, int& major, assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); - // Look for a VERSION or SOVERSION property. - const char* prop = soversion ? "SOVERSION" : "VERSION"; - if (const char* version = this->GetProperty(prop)) { + if (const char* version = this->GetProperty(property)) { // Try to parse the version number and store the results that were // successfully parsed. int parsed_major; -- cgit v1.2.1