summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorIsuru Fernando <isuruf@gmail.com>2020-01-24 16:32:18 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-24 19:13:41 (GMT)
commit4a62e3d97c3ae907d9c43d139ff5bef55ef356aa (patch)
tree77ec7a313d4394a5416bde806ac0df8cab83b73b /Source/cmGlobalXCodeGenerator.cxx
parentf45b2c48129ce302d100b0965374bcaacbb74219 (diff)
downloadCMake-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/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f887284..da56f3f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2366,8 +2366,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
int minor;
int patch;
- // VERSION -> current_version
- gtgt->GetTargetVersion(false, major, minor, patch);
+ // OSX_CURRENT_VERSION or VERSION -> current_version
+ gtgt->GetTargetVersionFallback("OSX_CURRENT_VERSION", "VERSION", major,
+ minor, patch);
std::ostringstream v;
// Xcode always wants at least 1.0.0 or nothing
@@ -2377,8 +2378,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
buildSettings->AddAttribute("DYLIB_CURRENT_VERSION",
this->CreateString(v.str()));
- // SOVERSION -> compatibility_version
- gtgt->GetTargetVersion(true, major, minor, patch);
+ // OSX_COMPATIBILITY_VERSION or SOVERSION -> compatibility_version
+ gtgt->GetTargetVersionFallback("OSX_COMPATIBILITY_VERSION", "SOVERSION",
+ major, minor, patch);
std::ostringstream vso;
// Xcode always wants at least 1.0.0 or nothing