Imported Upstream version 3.17.1
[platform/upstream/cmake.git] / Help / prop_tgt / SOVERSION.rst
1 SOVERSION
2 ---------
3
4 What version number is this target.
5
6 For shared libraries :prop_tgt:`VERSION` and ``SOVERSION`` can be used to
7 specify the build version and API version respectively.  When building or
8 installing appropriate symlinks are created if the platform supports
9 symlinks and the linker supports so-names.  If only one of both is
10 specified the missing is assumed to have the same version number.
11 ``SOVERSION`` is ignored if :prop_tgt:`NO_SONAME` property is set.
12
13 Windows Versions
14 ^^^^^^^^^^^^^^^^
15
16 For shared libraries and executables on Windows the :prop_tgt:`VERSION`
17 attribute is parsed to extract a ``<major>.<minor>`` version number.
18 These numbers are used as the image version of the binary.
19
20 Mach-O Versions
21 ^^^^^^^^^^^^^^^
22
23 For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
24 the ``SOVERSION`` property corresponds to the *compatibility version* and
25 :prop_tgt:`VERSION` corresponds to the *current version* (unless Mach-O
26 specific overrides are provided, as discussed below).
27 See the :prop_tgt:`FRAMEWORK` target property for an example.
28
29 For shared libraries, the :prop_tgt:`MACHO_COMPATIBILITY_VERSION` and
30 :prop_tgt:`MACHO_CURRENT_VERSION` properties can be used to
31 override the *compatibility version* and *current version* respectively.
32 Note that ``SOVERSION`` will still be used to form the ``install_name``
33 and both ``SOVERSION`` and :prop_tgt:`VERSION` may also affect the file
34 and symlink names.
35
36 Versions of Mach-O binaries may be checked with the ``otool -L <binary>``
37 command.