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