Commit Graph

140 Commits

Author SHA1 Message Date
Joachim Wuttke (o)
0ea52ece71 Help: module CPack: improve summary and Introduction
* In summary:
  * we configure generators, not the generated installers
  * we generate installers or source packages, not source package installers

* In Introduction:
  * Make paragraph on binary installers more concise
  * Remove example that refered to CMake source tree
  * Add paragraph on source packages
  * omit the parenthesis on graphical installers
2020-02-14 21:49:47 +11:00
Brad King
3af0b33ec6 Help: module CPack: Make internal hyperlink target more unique
We already have a `.. _targets:` in `Help/command/install.rst`.
2020-02-12 10:28:10 -05:00
Joachim Wuttke (o)
59e9f33d78 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.
2020-02-12 09:49:26 -05:00
Joachim Wuttke (o)
f33708eed9 Help: module CPack: add cross-reference to cpack-generators(7). 2020-02-12 13:37:15 +01:00
Joachim Wuttke (o)
4949e1261a Help: module CPack. Explain usage of the build targets.
Explain the usage of the two new build targets, package and
package_source.
2020-02-12 13:23:08 +01:00
Joachim Wuttke (o)
72eaeb41f5 Help: module CPack: correction: 2 config files are generated, not just 1
Besides CPackConfig.cmake, the module also generates CPackSourceConfig.cmake.
2020-02-12 13:22:51 +01:00
Joachim Wuttke (o)
c35a9ff9c3 Help: CPack module: Correct the summary (configure, not build)
Including CPack does not "build" installers.
It just *configures* them.
2020-02-12 12:37:48 +01:00
Brad King
2ed00e8ef8 CPack: Deprecate OSXX11 generator
The CPack OSXX11 generator has not had any updates since 2011 except as
part of sweeping maintenance changes.  It also creates packages with a
OSXScriptLauncher binary that has only ppc and i386 architectures which
are not supported by Apple anymore.  Furthermore, the generator is not
even mentioned in our documentation.  Add a deprecation warning.

Fixes: #20235
2020-01-31 10:04:41 -05:00
Brad King
7bf187499f CPack: Deprecate PackageMaker generator
Xcode no longer distributes the PackageMaker tools.
Add a deprecation warning when the generator is used.

Issue: #20235
2020-01-31 10:04:31 -05:00
Brad King
64e3bb4aee Merge topic 'cpack-deb-fix-description'
baec299ecd CPack: Fix regression in Deb description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4271
2020-01-27 09:27:36 -05:00
Kyle Edwards
baec299ecd CPack: Fix regression in Deb description
Fixes: #20254
2020-01-24 08:50:43 -05:00
Ben Boeckel
b6c7a10b23 CPack: mark options as advanced only if defined 2020-01-14 17:40:29 -05:00
Brad King
e61c2ed9ac Merge topic 'fix-cpack-deb-description-file'
d491f34a5e CPack: Fix regression in DEB generator description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4204
2020-01-13 10:23:26 -05:00
Kyle Edwards
d491f34a5e CPack: Fix regression in DEB generator description
Fixes: #20102
2020-01-10 17:22:52 -05:00
Craig Scott
27020c81d5 Merge topic 'remove-CPACK_INSTALL_CMAKE_CONFIGURATIONS'
1d1fa5d3e4 Tests: Add RunCMake.CPackCommandLine case for multi-config package
108207cc84 CPack: Remove CPACK_INSTALL_CMAKE_CONFIGURATIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4025
2019-11-12 08:16:31 -05:00
Alex Turbov
108207cc84 CPack: Remove CPACK_INSTALL_CMAKE_CONFIGURATIONS
In commit da5ac4bb60 (cpack: Add `CPACK_INSTALL_CMAKE_CONFIGURATIONS`
variable, 2019-07-10, v3.16.0-rc1~165^2) we added both the variable
and support for `cpack -C` with multiple configurations.  Drop the
variable because the `package` target cannot ensure that all of the
configurations are built.  Keep the command-line interface so that
it can be used manually in scripts.

Fixes: #19918
2019-11-11 14:15:09 -05:00
Johnny Jazeix
c97abc9688 CPack/NSIS: Add option for custom Uninstall filename
Fixes: #10728
2019-10-25 14:13:25 -04:00
Alex Turbov
da5ac4bb60 cpack: Add CPACK_INSTALL_CMAKE_CONFIGURATIONS variable
For the multi-configuration generators one can specify the list
of configurations to include in the package.

E.g. having a project, where debug libraries have a suffix to
distinct them from the release builds, one can build the package
containing both `Debug` and `Release` binaries.
2019-08-30 11:02:43 -04:00
Alex Turbov
5f96601675 CPack: Introduce CPACK_INSTALL_SCRIPTS variable
The singular name `CPACK_INSTALL_SCRIPT` has existed but was not linked
from the CPack documentation.  Also, it supported multiple values and
should have had a plural name.  Add a plural-named alternative now.
If both `CPACK_INSTALL_SCRIPTS` and `CPACK_INSTALL_SCRIPT` are set then
ignore the latter with a warning.

Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2019-07-22 02:01:44 +03:00
Joachim Wuttke (l)
a26ac919ef Help: Explain interaction of cpack(1) and CPack.
In particular, make clear that package/installer generators
are not the makefile generators of the cmake command.

Also insert sections in CPack doc, and capitalize section titles.
2018-11-15 16:50:52 +01:00
Joachim Wuttke (h)
e286627334 Help: Insert section headers in CPack module
The one extant section header was confusing at least:
Not all the doc page is on Variables.
2018-11-12 09:18:02 -05:00
Bartosz Kosiorek
fc1602456a Help: Replace occurrences of "Mac OS X" with "macOS"
Apple's main Operating system changed their name from OS X to macOS:

    https://www.engadget.com/2016/06/13/os-x-is-now-macos/

Revise documentation accordingly.
2018-09-05 16:10:49 -04:00
Brad King
ed015bde2b CPack: Restore support for 0-valued version components
In commit v3.12.0-rc1~136^2 (CPack: Use project version as default for
`CPACK_PACKAGE_VERSION`, 2018-04-29) we did not account for the value of
`CMAKE_PROJECT_VERSION_{MAJOR,MINOR,PATCH}` having `0`.  Fix the logic
to distinguish between unprovided version components and `0` components.

While at it, add a test case covering the behavior described in the
documentation by the original commit.  The number of version components
in the package name should match those provided to the `project()`
command `VERSION` option.

Fixes: #18199
2018-07-27 10:01:29 -04:00
Alex Turbov
f739752ad6 CPack: Add NuGet support
Create a CPack generator that uses `nuget.exe` to create packages:

    https://docs.microsoft.com/en-us/nuget/what-is-nuget

NuGet packages could be easily produced from a `*.nuspec` file (running
`nuget pack` in the directory w/ the spec file).  The spec filename does
not affect the result `*.nupkg` name -- only `id` and `version` elements
of the spec are used (by NuGet).

Some implementation details:

* Minimize C++ code -- use CMake script do to the job. It just let the
  base class (`cmCPackGenerator`) to preinstall everything to a temp
  directory, render the spec file and run `nuget pack` in it, harvesting
  `*.nupkg` files...;

* Ignore package name (and use default paths) prepared by the base class
  (only `CPACK_TEMPORARY_DIRECTORY` is important) -- final package
  filename is a responsibility of NuGet, so after generation just scan the
  temp directory for the result `*.nupkg` file(s) and update
  `packageFileNames` data-member of the generator;

* The generator supports _all-in-one_ (default), _one-group-per-package_
  and _one-component-per-package_ modes.
2018-05-11 09:28:44 -04:00
Alex Turbov
bfb91ff7f2 CPack: Add more markup to module documentation
Also indent variable docs consistently.
2018-05-08 14:01:07 -04:00
Alex Turbov
5fc59ea7c8 CPack: Document CPACK_PACKAGE_DESCRIPTION variable 2018-05-08 14:00:00 -04:00
Alex Turbov
3f354d65b4 CPack: Move CPACK_BINARY_<GENNAME> with rest of docs 2018-05-08 13:57:10 -04:00
Alex Turbov
53ec402069 CPack: Convert documentation to long-bracket comment syntax
Use `#[===...==[.rst:` comments for docs.
2018-05-08 13:53:50 -04:00
Craig Scott
a01c6e9921 CPack: Fix indentation
Addresses indentation not matching guidelines, missed in !2020.
No functional changes and no changes to docs.
2018-05-05 09:48:25 +10:00
Craig Scott
7de29da7c4 Merge topic 'feature/cpack-default-package-version'
af1c48871c CPack: Use project version as default for `CPACK_PACKAGE_VERSION`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Harry Mallon <hjmallon@gmail.com>
Merge-request: !2020
2018-05-03 17:18:38 -04:00
Alex Turbov
af1c48871c CPack: Use project version as default for CPACK_PACKAGE_VERSION
* Introduce `CMAKE_PROJECT_VERSION` and the corresponsing components:
  `CMAKE_PROJECT_VERSION_MAJOR`, `CMAKE_PROJECT_VERSION_MINOR`,
  `CMAKE_PROJECT_VERSION_PATCH` and `CMAKE_PROJECT_VERSION_TWEAK`.

* `CPack` module use `CMAKE_PROJECT_VERSION_MAJOR`,
  `CMAKE_PROJECT_VERSION_MINOR` and `CMAKE_PROJECT_VERSION_PATCH`
  to initialize corresponsing CPack variables.
2018-05-03 08:26:03 +10:00
Craig Scott
9a8687121f Help: Improve accuracy, readability and cross-referencing of cpack docs
This is primarily a cleanup of the cpack(1) page. The cpack.cxx file
and CPack module were also updated to make the docs relating to
the generator specification and option names consistent in all
three places.
2018-04-28 09:31:42 +10:00
Alex Turbov
30c8c9f55d CPack: Add CPACK_PACKAGE_HOMEPAGE_URL setting
Initialize it from `CMAKE_PROJECT_HOMEPAGE_URL`.
2018-04-23 11:08:21 -04:00
Alex Turbov
c9fa8f9442 CPack: Fix documented CPACK_PACKAGE_DESCRIPTION_SUMMARY default 2018-04-23 11:07:02 -04:00
Harry Mallon
e415364058 Cpack.cmake: Document some CPACK_* default values 2017-12-20 13:40:28 +00:00
Domen Vrankar
cf0c25995d CPack: set variable commands in lower case 2017-11-19 14:55:00 +01:00
Domen Vrankar
7e896029cd CPack: enable setting default dir creation permissions
Introduces CPACK_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS
variable which adds support for functionality introduced
by CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS variable.

Fixes #17333

# Conflicts:
#	Help/release/dev/cmake-default-dir-install-permissions.rst
2017-11-08 20:27:11 +01:00
Adriaan de Groot
2042cae9a5 CPack-FreeBSD: add a generator for FreeBSD pkg(8)
Adds an option CPACK_ENABLE_FREEBSD_PKG to allow CPack to look
for FreeBSD's libpkg / pkg(8). If this is set and the libpkg
headers and library are found (which they will be, by default,
on any FreeBSD system), then add a FreeBSD pkg(8) generator.

The FreeBSD package tool pkg(8) uses tar.xz files (.txz) with two
metadata files embedded (+MANIFEST and +COMPACT_MANIFEST).
This introduces a bunch of FreeBSD-specific CPACK_FREEBSD_PACKAGE_*
variables for filling in the metadata; the Debian generator does
something similar. Documentation for the CPack CMake-script is styled
after the Debian generator.

Implementation notes:
 - Checks for libpkg -- the underlying implementation for pkg(8) --
   and includes FreeBSD package-generation if building CMake on
   a UNIX host. Since libpkg can be used on BSDs, Linux and OSX,
   this potentially adds one more packaging format. In practice,
   this will only happen on FreeBSD and DragonflyBSD.
 - Copy-paste from cmCPackArchiveGenerator to special-case
   the metadata generation and to run around the internal
   archive generation: use libpkg instead.
 - Generating the metadata files is a little contrived.
 - Most of the validation logic for package settings is in
   CPackFreeBSD.cmake, as well as the code that tries to re-use
   packaging settings that may already be set up for Debian.
 - libpkg has its own notion of output filename, so we have
   another contrived bit of code that munges the output file
   list so that CPack can find the output.
 - Stick with C++98.
2017-06-10 07:53:59 -04:00
Alex Turbov
3b4848717a project: Add DESCRIPTION parameter
It is quite often the project description has used in a real world software.
Examples include:

* part of a help screen of the application
* builtin resources (`*.rc` files, data for "About" dialog of a GUI app, & etc)
* most generators for CPack can use it
* it could be used by documentary software (Doxygen, Sphinx) which is usually
  integrated to CMake based projects via `add_custom_target()`

Now `project()` call learned an optional `DESCRIPTION` parameter with a
short string describing a project. Being specified, it would set the
`PROJECT_DESCRIPTION` variable which could be used in `configure_file()`
or whatever user wants.  Also `PROJECT_DESCRIPTION` is a default value
for `CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
2017-04-11 10:17:00 -04:00
Brad King
979e8ba6c6 Help: De-duplicate and spell out supported hash algorithms
Spell out the supported algorithms in a definition list in the
`string(<HASH>)` command documentation.  Revise the `file(<HASH>)`
command and CPack module documentation to reference it instead of
duplicating the list.
2016-11-10 16:07:46 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Domen Vrankar
b78fcf0d2f CPack/RPM debuginfo packages must contain sources
Issue #15668 fix was missing relevant source
files in debuginfo package.
2016-09-27 08:18:21 -04:00
Brad King
290d48ebc7 Merge topic 'cpack-rpm-srpm-package'
d9cec8ad CPack/RPM: Generate source rpm (SRPM) packages on demand
2016-09-20 08:40:55 -04:00
Domen Vrankar
d9cec8adca CPack/RPM: Generate source rpm (SRPM) packages on demand
Closes: #15839
2016-09-20 08:24:28 -04:00
Petr Orlov
1c63aa4d43 CPack: Add option to generate a checksum file next to each package file
Add variable CPACK_PACKAGE_CHECKSUM to activate it.
2016-09-19 10:22:50 -04:00
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
Automate with:

find Modules -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:41:13 +02:00
Clinton Stimpson
2e3c67d1b6 productbuild: Add new productbuild cpack generator.
This cpack generator basically replaces the obsolete PackageMaker generator.
2016-06-03 14:41:57 -06:00
Brad King
63e2af0f8d CPack: Fix CPACK_OSX_SYSROOT with symbolic CMAKE_OSX_SYSROOT (#15816)
We support setting CMAKE_OSX_SYSROOT to a symbolic value like "macosx".
Modules/Platform/Darwin-Initialize.cmake takes care of finding the
actual SDK path on disk.  Use that result to set CPACK_OSX_SYSROOT
instead.
2015-10-28 10:15:39 -04:00
Roman Donchenko
bc2e54db55 Introduction of CPACK_VERBATIM_VARIABLES variable
If variable is set to TRUE, values of all variables prefixed with CPACK_
will be escaped so special characters such as dolar sign, quotes or
foreward slash will not be lost. By default variable is treated as set
to FALSE for back compatibility.

The cpack_encode_variables macro is changed into a function to remove
scope pollution. There should be no other effects.
2015-09-20 23:39:03 +02:00
Roman Donchenko
2a7772ff4c CPack: don't mangle CMake-special characters when applying default settings
Mangling is prevented by using a function instead of a macro for setting
default value of some CPack variables. Function is meant for internal use
in CPack.cmake only.
Old macro is deprecated but kept for backwards compatibility - was
intended for internal use only as it can't be used for CPack after
CPack.cmake script is included.
Patch removes local workarounds that were required by old macro,
fixes default setting of variables that by default inherit value from
another variable that already went through old default setting macro
(e.g. value of CPACK_PACKAGE_INSTALL_REGISTRY_KEY caused error for
wrong escapes if CPACK_PACKAGE_INSTALL_DIRECTORY contained escaped
back slashes) and provides a test for correct escaping of characters.
2015-09-09 22:21:07 +02:00