Commit Graph

89 Commits

Author SHA1 Message Date
Pino Toscano
b07812c6de Tests: fix RunCMake.CPack_DEB.EXTRA on Debian non-Linux OSes
The generated path with the packages uses $CPACK_TOPLEVEL_TAG, which
by default is $CPACK_SYSTEM_NAME, thus the OS name.

To make the expected stderr match also non-Linux OSes, accept any
non-slash characters in place of "Linux", so it works also on other
Debian OSes (e.g. Debian/Hurd).
2021-09-18 21:49:46 +02:00
Alex Turbov
593ff734b0 CPack/DEB: dbgsym package not generated for non-component packaging
Fix: #19735
2021-07-13 08:36:12 -04:00
Brad King
3a6cb03b6c Merge topic 'cpackdeb-md5sums-order'
a0d3494afa Tests: update MD5SUMS test to have several files
9028195a22 CPackDeb: sort package files before generating deb file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6287
2021-07-01 11:26:28 -04:00
Alexey Rogachevskiy
a0d3494afa Tests: update MD5SUMS test to have several files
The test is now updated to check the order of files
in the md5sums.
2021-06-30 09:05:28 -04:00
Alex Sweet
9b53eca317 CPack/RPM: Fix weak dep support
RPM 4.11.3 for el7 contains backported support for the RPM weak dep tags.
It only supports querying those tags, but rpmbuild can not make use of them.
Since CPack relies on rpmbuild --querytags to check for support, this
commit switches to rpm --suggests to check for support of weak
dependencies.

Fixes: #22350
2021-06-29 11:14:54 -04:00
Brad King
60380bd77c Tests: Fix RunCMake.CPack_RPM.DEBUGINFO test case
Since commit c826745f5a (CPack/DEB: Do not crash when asked for debug
symbols when there are none, 2020-10-29, v3.20.0-rc1~461^2) the test
fails because CPackRPM warns about no sources in which to find debug
symbols.  Add expected output for this case.
2021-06-10 14:44:02 -04:00
Brad King
d4056f24a1 Tests: Improve RunCMake.CPack*.SOURCE_PACKAGE test error formatting
Format message content for `message(FATAL_ERROR)`.

Apply the change from commit c54c284de7 (Tests: Improve RunCMake.CPack*
test error formatting, 2021-04-22) to the `SOURCE_PACKAGE` script too.
Also fix a typo from commit f5d79dec53 (Tests: Cleanup CPack message when
files are expected and none are found, 2021-01-15, v3.20.0-rc1~89^2~22).
2021-06-09 08:15:30 -04:00
Nils Gladitz
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES
The new variable allows projects to define custom key=value pairs of
variables to be set in CPack cmake_install.cmake script invocations.
This allows install(SCRIPT|CODE) to be parameterized at runtime.
2021-05-24 08:21:49 +10: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::thread::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
Domen Vrankar
34c8a23044 CPackRPM: add scriplets tags only if scripts exist
Scriplet tags should not be added to generated
spec files if scripts weren't provided as those
tags are otherwise present in generated rpm file
even if the script wasn't provided thereby
generating unneeded dependency on shell.

Fixes: #21345
2021-04-01 22:28:24 +02:00
Brad King
ac79fd8a0e Merge topic 'cpackrpm-debuginfo-single-package-install-erase-scripts'
31c184ad69 CPackRPM: handle scripts in debuginfo single package mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5953
2021-04-01 10:25:28 -04:00
Domen Vrankar
31c184ad69 CPackRPM: handle scripts in debuginfo single package mode
Enabling CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE while
using rpm install or erase scripts resulted in
resulted missing scripts for non default components.

Fixes: #21974
2021-03-30 23:24:16 +02:00
Domen Vrankar
d0adb2386a CPackRPM: correctly handle empty dir in single package mode
Enabling CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE while
having an empty directory in non main component
resulted in packaging error that the directory
does not exist.

Fixes: #21951
2021-03-29 01:26:58 +02:00
William R. Dieter
7de61526a0 Tests: Update CPack DEBUGINFO tests for IntelLLVM
By default icx and icpx do not add build IDs when linking, so enable
the build ID to make the test pass.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:07:01 -05:00
Tin Huynh
4de28ba4e6 Tests: Update tests for NVHPC compiler
Treat it just like PGI.
2021-01-27 09:53:02 -05: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
Asit Dhal
8f33674491 cpack(DEB): Issue warning if custom script for control file is missing
Fixes: #17794
2021-01-15 16:41:37 +01:00
Andrew Fuller
c826745f5a CPack/DEB: Do not crash when asked for debug symbols when there are none
Fixes: #21356
2020-11-16 14:03:07 -05: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
b33283a282 Tests: Cover using RTF for DMG SLAs 2020-07-03 08:30:42 -04:00
Brad King
b9737ead1f Tests: Add case for CPack DMG multi-language SLAs
Add a test for the feature added by commit f88533cc06 (CPackDMG: Add
support for multilingual SLAs, 2015-10-19, v3.5.0-rc1~232^2).

Issue: #20889
2020-07-02 16:39:57 -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
Alex Turbov
a6e1b20bab CPack External: Introduce CPACK_EXTERNAL_BUILT_PACKAGES
The `CPACK_EXTERNAL_PACKAGE_SCRIPT` script may set this list variable to the
full paths of generated package files. CPack copy these files from the stage
directory back to the top build directory and possibly produce checksum files
if the `CPACK_PACKAGE_CHECKSUM` is set.
2020-06-05 08:56:32 -04:00
Brad King
a1af643291 Merge topic 'fix-cpack-deb-generating-empty-paragraph'
6ba842163c CPack-deb: don't add a line with a dot to pkg desc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4806
2020-05-28 06:50:40 -04:00
Jonathan Verner
6ba842163c CPack-deb: don't add a line with a dot to pkg desc
Currently, if the package description ends with a newline
(typically if it is read from a file) cpack -deb adds a single line
with a dot at the end which leads to a violation of the
`extended-description-contains-empty-paragraph` debian policy.

This commit fixes the above behaviour.

Fixes: #20763
2020-05-27 14:44:28 -04:00
Ben Boeckel
b3bacf0152 cmCPackArchiveGenerator: support multithreaded compression 2020-04-03 07:35:35 -04:00
Sarang Joshi
c0534c4a68 CPackRPM: Add PRE_/POST_TRANS scripts
Add variables for PRE_TRANS and POST_TRANS scripts.

Fixes: #18917
2020-02-24 14:31:38 -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
Craig Scott
808888aa47 Merge topic 'cpack-custom-dmg-names'
6d6f4b9316 CPack/DragNDrop: Support CPACK_DMG_<component>_FILE_NAME
b53230fbee Tests: Add DragNDrop as a testable CPack generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4227
2020-01-17 08:33:01 -05:00
Andrew Fuller
6d6f4b9316 CPack/DragNDrop: Support CPACK_DMG_<component>_FILE_NAME 2020-01-16 08:04:35 -08: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
Kyle Edwards
5a8a9f7229 Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
2019-12-13 10:51:46 -05:00
Kyle Edwards
651b5d157a Merge topic 'cpack-use-CPACK_PACKAGE_HOMEPAGE_URL'
3476dbe6d7 CPack: CMAKE_PROJECT_HOMEPAGE_URL -> CPACK_PACKAGE_HOMEPAGE_URL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4024
2019-12-11 10:59:29 -05:00
Alex Turbov
3476dbe6d7 CPack: CMAKE_PROJECT_HOMEPAGE_URL -> CPACK_PACKAGE_HOMEPAGE_URL
At CPack running time the `CMAKE_PROJECT_HOMEPAGE_URL` variable
is not set.

Internal CPack modules (e.g. CPackDEB, CPackRPM, CPackFreeBSD)
should use `CPACK_PACKAGE_HOMEPAGE_URL` instead, which is available
after inclusion of `CPack.cmake` into `CMakeLists.txt`.

Closes: #19607
2019-12-09 17:06:10 -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
Alex Turbov
33c7ea513d CPackDeb: Use CPACK_PACKAGE_DESCRIPTION_FILE
Also, handle per-component description nicely.
2019-09-22 00:31:24 +02: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
Kyle Edwards
4568d046c4 Properties: Add CMAKE_ROLE global property
This property allows scripts to determine whether they're in project
mode, script mode, find-package mode, CTest, or CPack.
2019-01-17 09:44:29 -05:00
Kyle Edwards
b4444d6054 Tests: Split CPack DEB and RPM tests into smaller tests
The DEB and RPM tests are quite large, which can result in CTest
clients timing out on these tests even though they're working properly.
The RPM test in particular causes a lot of timeouts on the CMake
dashboard machines. This change splits these tests into smaller tests
so that they don't time out.
2019-01-10 13:56:35 -05:00
Nils Gladitz
4a3ae1710e CPack/External: Fix status messages of staging scripts
Set progress callback on cmake instance used by CPack.  The progress
callback is used to output STATUS messages which are otherwise missing
when issued from e.g. CPack External staging scripts.

Fixes: #18567
2018-12-07 07:33:30 -05:00
Craig Scott
20d5e77a27 CPack: Rename Ext generator to External
Ext and External were used inconsistently in the code and the
docs. This change converts all uses of Ext to External, including
within variable names used by the generator.
2018-11-05 07:56:03 -05:00
Andrew Fuller
d8a3939aef CPack/Deb: Add ability to split out debug symbols into .ddeb package 2018-09-21 20:19:31 +00:00
David Faure
7a7e94d6f7 CPack (DEB/RPM): add test for per-component description/summmary. 2018-08-30 22:08:11 +02:00
Nils Gladitz
4a0f664aaf CPackExt: Add CPACK_EXT_ENABLE_STAGING and CPACK_EXT_PACKAGE_SCRIPT
CPACK_EXT_ENABLE_STAGING enables optional staging
and CPACK_EXT_PACKAGE_SCRIPT allows to specify an optional
script file that can package staged files via an
external packaging tool.

Issue: #18236
2018-08-14 08:37:03 +02:00
Andrew Fuller
548ac51d8e CPack/Deb: Support SOURCE_DATE_EPOCH when packaging files 2018-07-25 13:39:07 -07:00
Kyle Edwards
2ef966bc77 Testing: Add test for CPack External generator
This test case ensures that the CPack External generator produces
the proper .json file, and also ensures that the version negotation
with CPACK_EXT_REQUESTED_VERSIONS works properly.
2018-07-02 09:51:02 -04:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00