summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Wuttke (o) <j.wuttke@fz-juelich.de>2020-02-12 14:40:04 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-12 14:49:26 (GMT)
commit59e9f33d78acb3d4e2c0e95e6cf7b43ff587c69c (patch)
treef6f7bee5f38abba6f5b3e27a27240887322de7f6
parentf33708eed981b4eba4274711609d21c2f7ea3376 (diff)
downloadCMake-59e9f33d78acb3d4e2c0e95e6cf7b43ff587c69c.zip
CMake-59e9f33d78acb3d4e2c0e95e6cf7b43ff587c69c.tar.gz
CMake-59e9f33d78acb3d4e2c0e95e6cf7b43ff587c69c.tar.bz2
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.
-rw-r--r--Modules/CPack.cmake28
1 files changed, 21 insertions, 7 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index ef28bde..eb08f1c 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^