summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-28 14:45:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-28 14:45:53 (GMT)
commitc40e242be39d50c4fc235a6a088efb99ff1916dd (patch)
tree8e11210305515c6262e782f0a4a765e64558baec /Tests
parent806c40a38fc6e1996738173ecfa23a26f7502dbf (diff)
parent53991e62daf819a91b7c89f4d4899d0f94c7fd12 (diff)
downloadCMake-c40e242be39d50c4fc235a6a088efb99ff1916dd.zip
CMake-c40e242be39d50c4fc235a6a088efb99ff1916dd.tar.gz
CMake-c40e242be39d50c4fc235a6a088efb99ff1916dd.tar.bz2
Merge topic 'cpack-auto-suffixes'
53991e62da CPack/RPM: Append .rpm to CPACK_RPM_FILE_NAME if missing f2a6d423da CPack/DEB: Append .deb to CPACK_DEBIAN_FILE_NAME if missing 907d4db558 Help: Format allowed CPACK_{DEB,RPM}_FILE_NAME values as definition list Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8880
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake8
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake5
4 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 6cdb241..0832578 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -973,6 +973,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
endif()
set(cpack_tests
+ DEB.AUTO_SUFFIXES
DEB.CUSTOM_NAMES
DEB.DEBUGINFO
DEB.DEFAULT_PERMISSIONS
@@ -991,6 +992,7 @@ set(cpack_tests
DEB.DEB_DESCRIPTION
DEB.PROJECT_META
+ RPM.AUTO_SUFFIXES
RPM.CUSTOM_BINARY_SPEC_FILE
RPM.CUSTOM_NAMES
RPM.DEBUGINFO
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 5086a3b..258f6a6 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ find_program(DEBUGEDIT debugedit)
# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM.CUSTOM_BINARY_SPEC_FILE" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ;DragNDrop" true "COMPONENT")
+run_cpack_test(AUTO_SUFFIXES "RPM.AUTO_SUFFIXES;DEB.AUTO_SUFFIXES" false "MONOLITHIC")
run_cpack_test(DEBUGINFO "DEB.DEBUGINFO" true "COMPONENT")
if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
run_cpack_test(DEBUGINFO "RPM.DEBUGINFO" true "COMPONENT")
diff --git a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
new file mode 100644
index 0000000..1ca48d8
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
@@ -0,0 +1,8 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE)
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
+
+if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
+ string(TOLOWER "${GENERATOR_TYPE}" file_extension_)
+ set(EXPECTED_FILE_1 "autosuffixpackage.${file_extension_}")
+endif()
diff --git a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
new file mode 100644
index 0000000..84c9bec
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
@@ -0,0 +1,5 @@
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+# if the filename doesn't have the expected deb/rpm suffix, test that it is appended automatically
+set(CPACK_DEBIAN_FILE_NAME "autosuffixpackage")
+set(CPACK_RPM_FILE_NAME "autosuffixpackage")