Commit Graph

171 Commits

Author SHA1 Message Date
Nikita Nemkin
2d9ae9de96 CPack: Allow source-relative CPACK_PROJECT_CONFIG_FILE
Resolve relative CPACK_PROJECT_CONFIG_FILE explicitly at config
generation time. Otherwise, it will be resolved at runtime
relative to the CPack execution directory (which could be anything).

Additionally, issue a warning if reading PACK_PROJECT_CONFIG_FILE
fails at runtime.

Fixes: #15522
2025-03-12 20:37:01 +05:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Nikita Nemkin
9890cfc4ec Help: More syntax highlighting for literal blocks
Covers almost all blocks containing actual code, except:

* Parsed-literal blocks can't be highlighted, including many command
  summaries and substitution-heavy docs like find_... commands.
  This is a Sphinx limitation.

* Code with errors, like CMP0049, DEPLOYMENT_ADDITIONAL_FILES,
  DEPLOYMENT_REMOTE_DIRECTORY, @PACKAGE_INIT@ substitution in the
  tutorial, bracket arguments/comments in cmake-language.7 and
  cmake-developer.7.

* FindQt4 module, which needs reformatting.
2025-01-29 16:48:53 -05:00
Peter Kokot
dc7aabf4d0 Help: Document CMAKE_OBJDUMP variable 2025-01-24 10:43:18 -05:00
Brad King
4bd3519e89 CPack: Avoid mentioning internal CMake module in documentation 2025-01-24 10:43:00 -05:00
Brad King
d588e81ffb CPack/WIX: Generate perMachine installers by default
Add policy CMP0172 to set `CPACK_WIX_INSTALL_SCOPE` to `perMachine` by
default.  Follow up commit 60661f6770 (CPack/WiX: Make InstallScope
configurable, 2023-11-07, v3.29.0-rc1~413^2) and commit 614100dbf6
(CPack/WiX: Restore default (missing) InstallScope from 3.28 and lower,
2024-06-05, v3.30.0-rc1~7^2~1).

Issue: #20962
Issue: #26029
2024-07-18 14:16:54 -04:00
Craig Scott
dca468e1de
Help: Improve and clarify wording for CPACK_<TOOL>_EXECUTABLE
Fixes: #24253
2024-05-31 15:00:14 +10:00
Craig Scott
339ae33e55
CPack: Change CPACK_PRODUCTBUILD_DOMAINS default to true (CMP0161)
Fixes: #23351
2024-01-28 21:09:12 +11:00
Craig Scott
4e7f2397e4
CPack: Clear temporary variable after it is no longer needed 2024-01-28 21:09:12 +11:00
Jannik Alber
1d6db66179 CPack: Add Inno Setup generator 2023-04-28 09:33:28 -04:00
Alex Turbov
029210730a
Help: Use role :program:
When mention execitable names use Sphinx semantic role `:program`
instead of ``executable`` or **executable**.
2022-11-06 04:28:21 +04:00
Mojca Miklavec
b276d9d8f1 CPack/NSIS: Document BOM mark for UTF-8 encoded LICENSE file
Previously this requirement was only mentioned in the 3.20 release
notes.
2022-10-24 12:58:10 -04:00
Matteo Martelli
0c638ab597 CPack: re-use paths of tools discovered by CMakeFindBinUtils
`CMakeFindBinUtils.cmake` sets `CMAKE_<TOOL>` variables that in
cross-compilation environments point to the toolchain specific
executables: e.g. `CMAKE_OBJCOPY` might point to
`<path_to_toolchain>/arm-poky-linux-gnueabi-objcopy`.
Pass this information to CPack.
2022-09-06 09:49:54 -04:00
Alex Turbov
d25b232dee Help: Replace mentions of `-G option with :option:-G` role 2022-08-04 19:34:45 +04:00
Craig Scott
c150f89f4d CPack: Remove the deprecated PackageMaker generator
This CPack generator has been deprecated since commit 7bf187499f
(CPack: Deprecate PackageMaker generator, 2020-01-31).

Fixes: #23344
2022-05-05 08:36:44 +10:00
Brad King
b760828d3f CPack/DMG: Do not use CPACK_RESOURCE_FILE_LICENSE for SLA by default
Since macOS 12.0 deprecated the tools needed to attach a SLA to a
`.dmg`, we should no longer do this by default.  Add a policy to
change the default to off.

Fixes: #22978
2022-04-14 10:14:58 -04:00
Russell Greene
525faec4e9 CPack: Add parallel zstd compression 2022-02-23 08:39:32 -05:00
Brad King
29f63129be CPack: Format CPACK_THREADS compression methods as a definition list
Prepare to add more entries beyond `xz`.
2022-02-22 15:31:37 -05:00
Brad King
9e38bfa915 CPack/DMG: Add explicit option to use CPACK_RESOURCE_FILE_LICENSE for SLA
Since macOS 12.0, the ``hdiutil udifrez`` and ``hdiutil udifderez``
commands to embed and extract resources in a disk image are deprecated.
The CPack DragNDrop Generator uses these to attach the SLA specified by
the `CPACK_RESOURCE_FILE_LICENSE` option.  Since that option is shared
by multiple CPack generators, we cannot deprecate it.  Instead, add an
explicit option to control the behavior.  This will give projects a way
to package on future macOS versions that remove the commands.

In order to provide a long-term transition away from attaching SLAs to
disk images, update `cpack` to default this behavior to OFF.  To retain
compatibility for CMake projects, teach the CPack module to default the
option to ON.  Later a policy can be added to change the default.

Issue: #22978
2022-01-18 15:39:51 -05:00
Brad King
4ef974e6cb CPack: Remove undocumented deprecated OSXX11 generator
This CPack generator was never documented, and has been deprecated since
commit 2ed00e8ef8 (CPack: Deprecate OSXX11 generator, 2020-01-31,
v3.17.0-rc1~45^2).

Issue: #20235
2021-11-05 12:39:22 -04:00
Nils Gladitz
c5c130e675 cmArchiveWrite: Consolidate multiple ways to set thread count
Merge use of SetFilterOption() into more abstract thread count
in cmArchiveWrite constructor.

libarchive defaulting of threads for threads == 0 seems to be
configuration dependent. Preemptively default thread count via
std:🧵:hardware_concurrency().

Also allow negative values for the thread count in which case
the detected hardware concurrency is also used but the given
absolute thread count is used as an upper limit.
2021-04-22 15:40:13 -04:00
Nils Gladitz
5380d858ff liblzma: Enable multi threaded stream encoding support 2021-04-22 15:40:06 -04:00
Rodolfo Lima
bdf30bdad8 CPack: add CPACK_THREADS variable to control compression threads
This allows setting how many threads the compressor will use.
Currently only implemented for XZ when using system's lzma library.

Fixes: #21715
2021-01-26 16:23:37 +01:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Craig Scott
b77dfa441f Help: Clarify variables specifying scripts to execute during packaging
Relates: #19077
2020-11-03 20:11:38 +11:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Brad King
ed9b60e89e Merge topic 'cpack2'
ca9bd43f2d Help: Duplicate essential information on install paths in CPack.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4987
2020-07-09 06:51:01 -04:00
Brad King
10a5ba8dd8 Merge topic 'doc-CPack-source-package'
f8b7acaf90 Help: Fix CPack module docs on config file for source package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4985
2020-07-09 06:46:41 -04:00
Joachim Wuttke (h)
ca9bd43f2d Help: Duplicate essential information on install paths in CPack. 2020-07-08 14:59:01 +02:00
Joachim Wuttke (h)
f8b7acaf90 Help: Fix CPack module docs on config file for source package 2020-07-08 08:36:00 -04:00
Alex Turbov
915409af49 CPack: Introduce pre- and post- build actions
CPack learned the `CPACK_PRE_BUILD_SCRIPTS`, `CPACK_POST_BUILD_SCRIPTS`,
and `CPACK_PACKAGE_FILES` variables.

The first two are lists of scripts to perform
- after pre-install files into a staging directory and before
  producing the resulting packages
- after produsing the packages

The post-build script(s) also get the list of actually produced
packages in the `CPACK_PACKAGE_FILES`.

Issue: #19077
2020-06-15 11:06:41 -04:00
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