diff options
author | Brad King <brad.king@kitware.com> | 2009-10-26 14:05:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-10-26 14:05:46 (GMT) |
commit | 7b28fbd6561285ef0eb4a9a1bcb857c7cb5adad3 (patch) | |
tree | 07035922cd42c098d3709297a1832063c63376cd /Source | |
parent | 99697308f34a1ee012529c591268a000ba8fa456 (diff) | |
download | CMake-7b28fbd6561285ef0eb4a9a1bcb857c7cb5adad3.zip CMake-7b28fbd6561285ef0eb4a9a1bcb857c7cb5adad3.tar.gz CMake-7b28fbd6561285ef0eb4a9a1bcb857c7cb5adad3.tar.bz2 |
Fix Xcode dylib version default
The commit "Set version info for shared libs on OSX" taught the Xcode
generator to honor VERSION and SOVERSION properties. However, it also
set version '1.0.0' as the default when no version property is set,
which is inconsistent with the Makefiles generator. This commit fixes
the default to '0.0.0' for consistency.
See issue #9773.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e46521b..e0d6b5d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1865,25 +1865,25 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // VERSION -> current_version target.GetTargetVersion(false, major, minor, patch); - if(major == 0 && minor == 0 && patch == 0) + cmOStringStream v; + + // Xcode always wants at least 1.0.0 or nothing + if(!(major == 0 && minor == 0 && patch == 0)) { - // Xcode always wants at least 1.0.0 - major = 1; + v << major << "." << minor << "." << patch; } - cmOStringStream v; - v << major << "." << minor << "." << patch; buildSettings->AddAttribute("DYLIB_CURRENT_VERSION", this->CreateString(v.str().c_str())); // SOVERSION -> compatibility_version target.GetTargetVersion(true, major, minor, patch); - if(major == 0 && minor == 0 && patch == 0) + cmOStringStream vso; + + // Xcode always wants at least 1.0.0 or nothing + if(!(major == 0 && minor == 0 && patch == 0)) { - // Xcode always wants at least 1.0.0 - major = 1; + vso << major << "." << minor << "." << patch; } - cmOStringStream vso; - vso << major << "." << minor << "." << patch; buildSettings->AddAttribute("DYLIB_COMPATIBILITY_VERSION", this->CreateString(vso.str().c_str())); } |