diff options
-rw-r--r-- | Modules/CPack.cmake | 28 |
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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |