mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 05:01:50 -06:00
macOS: Rename OSX_*_VERSION properties to MACHO_*_VERSION
The properties added by commit 4a62e3d97c (macOS: Add
OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties,
2020-01-24, v3.17.0-rc1~80^2~1) are general-purpose for all platforms
using Mach-O formats and not just on OS X. Rename them accordingly.
The properties are new to the CMake 3.17 release so we can rename
them without compatibility concerns.
Fixes: #20442
This commit is contained in:
@@ -285,6 +285,8 @@ Properties on Targets
|
|||||||
/prop_tgt/LINK_WHAT_YOU_USE
|
/prop_tgt/LINK_WHAT_YOU_USE
|
||||||
/prop_tgt/LOCATION_CONFIG
|
/prop_tgt/LOCATION_CONFIG
|
||||||
/prop_tgt/LOCATION
|
/prop_tgt/LOCATION
|
||||||
|
/prop_tgt/MACHO_COMPATIBILITY_VERSION
|
||||||
|
/prop_tgt/MACHO_CURRENT_VERSION
|
||||||
/prop_tgt/MACOSX_BUNDLE_INFO_PLIST
|
/prop_tgt/MACOSX_BUNDLE_INFO_PLIST
|
||||||
/prop_tgt/MACOSX_BUNDLE
|
/prop_tgt/MACOSX_BUNDLE
|
||||||
/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST
|
/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST
|
||||||
@@ -303,8 +305,6 @@ Properties on Targets
|
|||||||
/prop_tgt/OBJCXX_STANDARD_REQUIRED
|
/prop_tgt/OBJCXX_STANDARD_REQUIRED
|
||||||
/prop_tgt/OSX_ARCHITECTURES_CONFIG
|
/prop_tgt/OSX_ARCHITECTURES_CONFIG
|
||||||
/prop_tgt/OSX_ARCHITECTURES
|
/prop_tgt/OSX_ARCHITECTURES
|
||||||
/prop_tgt/OSX_CURRENT_VERSION
|
|
||||||
/prop_tgt/OSX_COMPATIBILITY_VERSION
|
|
||||||
/prop_tgt/OUTPUT_NAME_CONFIG
|
/prop_tgt/OUTPUT_NAME_CONFIG
|
||||||
/prop_tgt/OUTPUT_NAME
|
/prop_tgt/OUTPUT_NAME
|
||||||
/prop_tgt/PDB_NAME_CONFIG
|
/prop_tgt/PDB_NAME_CONFIG
|
||||||
|
|||||||
14
Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst
Normal file
14
Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
MACHO_COMPATIBILITY_VERSION
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
What compatibility version number is this target for Mach-O binaries.
|
||||||
|
|
||||||
|
For shared libraries on Mach-O systems (e.g. macOS, iOS)
|
||||||
|
the ``MACHO_COMPATIBILITY_VERSION`` property correspond to
|
||||||
|
``compatibility version`` and :prop_tgt:`MACHO_CURRENT_VERSION` to
|
||||||
|
``current version``.
|
||||||
|
See the :prop_tgt:`FRAMEWORK` target property for an example.
|
||||||
|
|
||||||
|
Versions of Mach-O binaries may be checked with the ``otool -L <binary>``
|
||||||
|
command. If ``MACHO_COMPATIBILITY_VERSION`` is not set, the value of
|
||||||
|
the :prop_tgt:`SOVERSION` property will be used.
|
||||||
13
Help/prop_tgt/MACHO_CURRENT_VERSION.rst
Normal file
13
Help/prop_tgt/MACHO_CURRENT_VERSION.rst
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
MACHO_CURRENT_VERSION
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
What current version number is this target for Mach-O binaries.
|
||||||
|
|
||||||
|
For shared libraries on Mach-O systems (e.g. macOS, iOS)
|
||||||
|
the :prop_tgt:`MACHO_COMPATIBILITY_VERSION` property correspond to
|
||||||
|
``compatibility version`` and ``MACHO_CURRENT_VERSION`` to ``current version``.
|
||||||
|
See the :prop_tgt:`FRAMEWORK` target property for an example.
|
||||||
|
|
||||||
|
Versions of Mach-O binaries may be checked with the ``otool -L <binary>``
|
||||||
|
command. If ``MACHO_CURRENT_VERSION`` is not set, the value of
|
||||||
|
the :prop_tgt:`VERSION` property will be used.
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
OSX_COMPATIBILITY_VERSION
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
What compatibility version number is this target for OSX.
|
|
||||||
|
|
||||||
For shared libraries on Mach-O systems (e.g. macOS, iOS)
|
|
||||||
the ``OSX_COMPATIBILITY_VERSION`` property correspond to
|
|
||||||
``compatibility version`` and :prop_tgt:`OSX_CURRENT_VERSION` to
|
|
||||||
``current version``.
|
|
||||||
See the :prop_tgt:`FRAMEWORK` target property for an example.
|
|
||||||
|
|
||||||
Versions of Mach-O binaries may be checked with the ``otool -L <binary>``
|
|
||||||
command. If ``OSX_COMPATIBILITY_VERSION`` is not set, the value of
|
|
||||||
the :prop_tgt:``SOVERSION`` property will be used.
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
OSX_CURRENT_VERSION
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
What current version number is this target for OSX.
|
|
||||||
|
|
||||||
For shared libraries on Mach-O systems (e.g. macOS, iOS)
|
|
||||||
the :prop_tgt:`OSX_COMPATIBILITY_VERSION` property correspond to
|
|
||||||
``compatibility version`` and ``OSX_CURRENT_VERSION`` to ``current version``.
|
|
||||||
See the :prop_tgt:`FRAMEWORK` target property for an example.
|
|
||||||
|
|
||||||
Versions of Mach-O binaries may be checked with the ``otool -L <binary>``
|
|
||||||
command. If ``OSX_CURRENT_VERSION`` is not set, the value of
|
|
||||||
the :prop_tgt:``VERSION`` property will be used.
|
|
||||||
@@ -22,8 +22,8 @@ Mach-O Versions
|
|||||||
|
|
||||||
For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
|
For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
|
||||||
the ``SOVERSION`` property is a fallback to
|
the ``SOVERSION`` property is a fallback to
|
||||||
:prop_tgt:`OSX_COMPATIBILITY_VERSION` property which corresponds to
|
:prop_tgt:`MACHO_COMPATIBILITY_VERSION` property which corresponds to
|
||||||
*compatiblity version* and :prop_tgt:`VERSION` is a fallback to
|
*compatiblity version* and :prop_tgt:`VERSION` is a fallback to
|
||||||
:prop_tgt:`OSX_CURRENT_VERSION` which corresponds to *current version*.
|
:prop_tgt:`MACHO_CURRENT_VERSION` which corresponds to *current version*.
|
||||||
See the :prop_tgt:`FRAMEWORK` target property for an example. Versions
|
See the :prop_tgt:`FRAMEWORK` target property for an example. Versions
|
||||||
of Mach-O binaries may be checked with the ``otool -L <binary>`` command.
|
of Mach-O binaries may be checked with the ``otool -L <binary>`` command.
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ Mach-O Versions
|
|||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
|
For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
|
||||||
the ``VERSION`` property is a fallback to :prop_tgt:`OSX_CURRENT_VERSION`
|
the ``VERSION`` property is a fallback to :prop_tgt:`MACHO_CURRENT_VERSION`
|
||||||
property which corresponds to *current version* and :prop_tgt:`SOVERSION`
|
property which corresponds to *current version* and :prop_tgt:`SOVERSION`
|
||||||
is a fallback to :prop_tgt:`OSX_COMPATIBILITY_VERSION` which corresponds
|
is a fallback to :prop_tgt:`MACHO_COMPATIBILITY_VERSION` which corresponds
|
||||||
to *compatiblity version*. See the :prop_tgt:`FRAMEWORK` target
|
to *compatiblity version*. See the :prop_tgt:`FRAMEWORK` target
|
||||||
property for an example. Versions of Mach-O binaries may be checked with the
|
property for an example. Versions of Mach-O binaries may be checked with the
|
||||||
``otool -L <binary>`` command.
|
``otool -L <binary>`` command.
|
||||||
|
|||||||
@@ -140,10 +140,10 @@ Properties
|
|||||||
In particular, the ``$<INSTALL_PREFIX>`` generator expression can
|
In particular, the ``$<INSTALL_PREFIX>`` generator expression can
|
||||||
be used to set the directory relative to the install-time prefix.
|
be used to set the directory relative to the install-time prefix.
|
||||||
|
|
||||||
* Target properties :prop_tgt:`OSX_COMPATIBILITY_VERSION` and
|
* Target properties :prop_tgt:`MACHO_COMPATIBILITY_VERSION` and
|
||||||
:prop_tgt:`OSX_CURRENT_VERSION` were added to set the
|
:prop_tgt:`MACHO_CURRENT_VERSION` were added to set the
|
||||||
``compatibility_version`` and ``curent_version`` respectively
|
``compatibility_version`` and ``curent_version``, respectively,
|
||||||
on macOS. For backwards compatibility, if these properties
|
for Mach-O binaries. For backwards compatibility, if these properties
|
||||||
are not set, :prop_tgt:`SOVERSION` and :prop_tgt:`VERSION`
|
are not set, :prop_tgt:`SOVERSION` and :prop_tgt:`VERSION`
|
||||||
are used respectively as fallbacks.
|
are used respectively as fallbacks.
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
|
|||||||
int major;
|
int major;
|
||||||
int minor;
|
int minor;
|
||||||
int patch;
|
int patch;
|
||||||
std::string prop = cmStrCat("OSX_", name, "_VERSION");
|
std::string prop = cmStrCat("MACHO_", name, "_VERSION");
|
||||||
std::string fallback_prop = so ? "SOVERSION" : "VERSION";
|
std::string fallback_prop = so ? "SOVERSION" : "VERSION";
|
||||||
this->GeneratorTarget->GetTargetVersionFallback(prop, fallback_prop, major,
|
this->GeneratorTarget->GetTargetVersionFallback(prop, fallback_prop, major,
|
||||||
minor, patch);
|
minor, patch);
|
||||||
|
|||||||
@@ -2368,8 +2368,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
|||||||
int minor;
|
int minor;
|
||||||
int patch;
|
int patch;
|
||||||
|
|
||||||
// OSX_CURRENT_VERSION or VERSION -> current_version
|
// MACHO_CURRENT_VERSION or VERSION -> current_version
|
||||||
gtgt->GetTargetVersionFallback("OSX_CURRENT_VERSION", "VERSION", major,
|
gtgt->GetTargetVersionFallback("MACHO_CURRENT_VERSION", "VERSION", major,
|
||||||
minor, patch);
|
minor, patch);
|
||||||
std::ostringstream v;
|
std::ostringstream v;
|
||||||
|
|
||||||
@@ -2380,8 +2380,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
|||||||
buildSettings->AddAttribute("DYLIB_CURRENT_VERSION",
|
buildSettings->AddAttribute("DYLIB_CURRENT_VERSION",
|
||||||
this->CreateString(v.str()));
|
this->CreateString(v.str()));
|
||||||
|
|
||||||
// OSX_COMPATIBILITY_VERSION or SOVERSION -> compatibility_version
|
// MACHO_COMPATIBILITY_VERSION or SOVERSION -> compatibility_version
|
||||||
gtgt->GetTargetVersionFallback("OSX_COMPATIBILITY_VERSION", "SOVERSION",
|
gtgt->GetTargetVersionFallback("MACHO_COMPATIBILITY_VERSION", "SOVERSION",
|
||||||
major, minor, patch);
|
major, minor, patch);
|
||||||
std::ostringstream vso;
|
std::ostringstream vso;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ add_library(foo SHARED foo.c)
|
|||||||
set_target_properties(foo PROPERTIES
|
set_target_properties(foo PROPERTIES
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
SOVERSION 1
|
SOVERSION 1
|
||||||
OSX_COMPATIBILITY_VERSION 2.1.0
|
MACHO_COMPATIBILITY_VERSION 2.1.0
|
||||||
OSX_CURRENT_VERSION 3.2.1
|
MACHO_CURRENT_VERSION 3.2.1
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user