Help: module CPack: New section on targets.

To explain in full detail to what extent the targets package and
package_source are supported by different generators.
This commit is contained in:
Joachim Wuttke (o) 2020-02-12 15:40:04 +01:00 committed by Brad King
parent f33708eed9
commit 59e9f33d78

View File

@ -15,13 +15,9 @@ and ``CPackSourceConfig.cmake``. They are intended for use in a subsequent
run of the :manual:`cpack <cpack(1)>` program where they steer the generation
of installers or/and source packages.
The CPack module also adds two new build targets, ``package`` and
``package_source``. This makes it possible to build a binary installer
from CMake, Make, or Ninja: Instead of ``cpack``, call ``cmake --build .
--target package`` or ``make package`` or ``ninja package``. Similary, to build
a source package, instead of ``cpack -G TGZ --config CPackConfig.cmake``,
call ``cmake --build . --target package_source``, ``make package_source``,
or ``ninja package_source``.
Depending on the CMake generator, the CPack module may also add two new build
targets, ``package`` and ``package_source``. See the targets_ section below
for details.
The generated binary installers contain everything installed via CMake's
:command:`install` command (and the deprecated commands :command:`install_files`,
@ -70,6 +66,24 @@ internally to *the one currently being used* and then include the
For a list of available generators, see :manual:`cpack-generators(7)`.
.. _targets:
Targets package and package_source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If CMake is run with the Makefile, Ninja, or Xcode generator, then
``include(CPack)`` generates a target ``package``. This makes it possible
to build a binary installer from CMake, Make, or Ninja: Instead of ``cpack``,
one may call ``cmake --build . --target package`` or ``make package`` or
``ninja package``. The VS generator creates an uppercase target ``PACKAGE``.
If CMake is run with the Makefile or Ninja generator, then ``include(CPack)``
also generates a target ``package_source``. To build a source package,
instead of ``cpack -G TGZ --config CPackConfig.cmake`` one may call
``cmake --build . --target package_source``, ``make package_source``,
or ``ninja package_source``.
Variables common to all CPack Generators
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^