diff options
author | Isuru Fernando <isuruf@gmail.com> | 2020-01-24 16:32:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-24 19:13:41 (GMT) |
commit | 4a62e3d97c3ae907d9c43d139ff5bef55ef356aa (patch) | |
tree | 77ec7a313d4394a5416bde806ac0df8cab83b73b /Source/cmGeneratorTarget.cxx | |
parent | f45b2c48129ce302d100b0965374bcaacbb74219 (diff) | |
download | CMake-4a62e3d97c3ae907d9c43d139ff5bef55ef356aa.zip CMake-4a62e3d97c3ae907d9c43d139ff5bef55ef356aa.tar.gz CMake-4a62e3d97c3ae907d9c43d139ff5bef55ef356aa.tar.bz2 |
macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties
Fixes: #17652
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 792cd4d..c525a6e 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; |