From c35a9ff9c312db83ac34b64f7eec9a79068a7b05 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Wed, 12 Feb 2020 12:37:48 +0100 Subject: [PATCH 1/5] Help: CPack module: Correct the summary (configure, not build) Including CPack does not "build" installers. It just *configures* them. --- Modules/CPack.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 684edae4bd..65e61da4eb 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -5,7 +5,7 @@ CPack ----- -Build binary and source package installers. +Configure the binary and source package installers. Introduction ^^^^^^^^^^^^ From 72eaeb41f5c0ba7dd4a3a4fa562fcd057fb68332 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Wed, 12 Feb 2020 13:07:31 +0100 Subject: [PATCH 2/5] Help: module CPack: correction: 2 config files are generated, not just 1 Besides CPackConfig.cmake, the module also generates CPackSourceConfig.cmake. --- Modules/CPack.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 65e61da4eb..84493f6ea3 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -10,9 +10,10 @@ Configure the binary and source package installers. Introduction ^^^^^^^^^^^^ -The CPack module generates a file ``CPackConfig.cmake`` intended for -use in a subsequent run of the :manual:`cpack ` program -where it steers the generation of installers or/and source packages. +The CPack module generates the configuration files ``CPackConfig.cmake`` +and ``CPackSourceConfig.cmake``. They are intended for use in a subsequent +run of the :manual:`cpack ` program where they steer the generation +of installers or/and source packages. Inclusion of the CPack module adds two new build targets, ``package`` and ``package_source``, which build the binary and source installers From 4949e1261a7b81f8627b6edd961513b08d667991 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Wed, 12 Feb 2020 13:23:08 +0100 Subject: [PATCH 3/5] Help: module CPack. Explain usage of the build targets. Explain the usage of the two new build targets, package and package_source. --- Modules/CPack.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 84493f6ea3..f998abf126 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -15,13 +15,17 @@ and ``CPackSourceConfig.cmake``. They are intended for use in a subsequent run of the :manual:`cpack ` program where they steer the generation of installers or/and source packages. -Inclusion of the CPack module adds two new build targets, ``package`` -and ``package_source``, which build the binary and source installers -respectively. The generated binary installers contain everything -installed via CMake's :command:`install` command (and the deprecated -commands :command:`install_files`, :command:`install_programs`, and -:command:`install_targets`). +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``. +The generated binary installers contain everything installed via CMake's +:command:`install` command (and the deprecated commands :command:`install_files`, +:command:`install_programs`, and :command:`install_targets`). For certain kinds of binary installers (including the graphical installers on macOS and Windows), CPack generates installers that allow users to select individual application components to install. From f33708eed981b4eba4274711609d21c2f7ea3376 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Wed, 12 Feb 2020 13:37:15 +0100 Subject: [PATCH 4/5] Help: module CPack: add cross-reference to cpack-generators(7). --- Modules/CPack.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index f998abf126..ef28bde1ac 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -68,6 +68,8 @@ This is the key: For each generator listed in :variable:`CPACK_GENERATOR` in internally to *the one currently being used* and then include the :variable:`CPACK_PROJECT_CONFIG_FILE`. +For a list of available generators, see :manual:`cpack-generators(7)`. + Variables common to all CPack Generators ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 59e9f33d78acb3d4e2c0e95e6cf7b43ff587c69c Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Wed, 12 Feb 2020 15:40:04 +0100 Subject: [PATCH 5/5] 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. --- Modules/CPack.cmake | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index ef28bde1ac..eb08f1c4e2 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 ` 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^