cmake/Help/prop_tgt/SOVERSION.rst

40 lines
1.5 KiB
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
SOVERSION
---------
2024-04-14 22:45:38 +02:00
ABI version number of a shared library target.
2014-08-03 19:52:23 +02:00
2016-07-09 11:21:54 +02:00
For shared libraries :prop_tgt:`VERSION` and ``SOVERSION`` can be used to
2024-04-14 22:45:38 +02:00
specify the build version and ABI version respectively. When building or
2014-08-03 19:52:23 +02:00
installing appropriate symlinks are created if the platform supports
symlinks and the linker supports so-names. If only one of both is
specified the missing is assumed to have the same version number.
2016-07-09 11:21:54 +02:00
``SOVERSION`` is ignored if :prop_tgt:`NO_SONAME` property is set.
2024-04-14 22:45:38 +02:00
.. include:: VERSION_SOVERSION_EXAMPLE.txt
2016-07-09 11:21:54 +02:00
Windows Versions
^^^^^^^^^^^^^^^^
For shared libraries and executables on Windows the :prop_tgt:`VERSION`
attribute is parsed to extract a ``<major>.<minor>`` version number.
These numbers are used as the image version of the binary.
Mach-O Versions
^^^^^^^^^^^^^^^
2018-10-28 12:09:07 +01:00
For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
2020-08-30 11:54:41 +02:00
the ``SOVERSION`` property corresponds to the *compatibility version* and
:prop_tgt:`VERSION` corresponds to the *current version* (unless Mach-O
specific overrides are provided, as discussed below).
See the :prop_tgt:`FRAMEWORK` target property for an example.
For shared libraries, the :prop_tgt:`MACHO_COMPATIBILITY_VERSION` and
:prop_tgt:`MACHO_CURRENT_VERSION` properties can be used to
override the *compatibility version* and *current version* respectively.
Note that ``SOVERSION`` will still be used to form the ``install_name``
and both ``SOVERSION`` and :prop_tgt:`VERSION` may also affect the file
and symlink names.
Versions of Mach-O binaries may be checked with the ``otool -L <binary>``
command.