summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2023-10-14 21:21:34 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-27 15:26:37 (GMT)
commit53991e62daf819a91b7c89f4d4899d0f94c7fd12 (patch)
tree273a48b4e8f0a5a34e54c582fb101e3cb7529b35 /Tests/RunCMake/CPack
parentf2a6d423da1400108327bff5a27647b6d1d90392 (diff)
downloadCMake-53991e62daf819a91b7c89f4d4899d0f94c7fd12.zip
CMake-53991e62daf819a91b7c89f4d4899d0f94c7fd12.tar.gz
CMake-53991e62daf819a91b7c89f4d4899d0f94c7fd12.tar.bz2
CPack/RPM: Append .rpm to CPACK_RPM_FILE_NAME if missing
Previously we issued an error when the `.rpm` suffix is missing. Instead, append the suffix automatically. This matches the behavior of `CPACK_ARCHIVE_FILE_NAME`, to which the archive format suffix is automatically appended. With this change, developers can simply do set(CPACK_RPM_comp_FILE_NAME "${CPACK_ARCHIVE_comp_FILE_NAME}")
Diffstat (limited to 'Tests/RunCMake/CPack')
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake3
3 files changed, 4 insertions, 3 deletions
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 90c0cce..8ad01e5 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -9,7 +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 "DEB.AUTO_SUFFIXES" false "MONOLITHIC")
+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
index a531c04..1ca48d8 100644
--- a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
@@ -2,7 +2,7 @@ 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")
+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
index 5c29b2d..84c9bec 100644
--- a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
@@ -1,4 +1,5 @@
install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
-# if the filename doesn't have the expected deb suffix, test that it is appended automatically
+# 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")