diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 15:33:13 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 22:20:35 (GMT) |
commit | d040d1647d2192ab97db9b041599c9e224c93553 (patch) | |
tree | d9ef9808a5652b252186888075f9a97e6c3b3ddb /Tests/RunCMake/CPack/tests | |
parent | 2cc479bdac84843d0284573cf801ee526e798c54 (diff) | |
download | CMake-d040d1647d2192ab97db9b041599c9e224c93553.zip CMake-d040d1647d2192ab97db9b041599c9e224c93553.tar.gz CMake-d040d1647d2192ab97db9b041599c9e224c93553.tar.bz2 |
Tests: CPack test set packaging type
CPack tests can now define one or more
packaging types and that test will be
executed once per generator per packaging
type. This also enables us to set default
values per packaging type for each generator
which makes tests shorter.
Diffstat (limited to 'Tests/RunCMake/CPack/tests')
17 files changed, 72 insertions, 124 deletions
diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake deleted file mode 100644 index 12970cb..0000000 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -set(EXPECTED_FILE_1_COMPONENT "test") - -set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/empty") - -if(GENERATOR_TYPE STREQUAL "TGZ") - set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty/$") -endif() diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake deleted file mode 100644 index 1f35b80..0000000 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake +++ /dev/null @@ -1,14 +0,0 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") -elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif() - -set(CPACK_COMPONENTS_ALL test) -install(DIRECTORY DESTINATION empty - COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake index 3185e9f..0c2b37b 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake @@ -1,16 +1,12 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + set(generator_type_suffix_ "IAN") # not entirely compatible... + endif() - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") - set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - - set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") - set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") - set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_FILE_NAME "${GENERATOR_TYPE}-DEFAULT") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") + string(TOLOWER "${GENERATOR_TYPE}" file_extension_) + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_3_FILE_NAME "pkg_3_abc.${file_extension_}") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index 70b3cb3..0642d83 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -6,8 +6,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") endif() -set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CMAKE_BUILD_TYPE Debug) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake index 1c7ff5e..7923148 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake @@ -68,11 +68,11 @@ elseif(GENERATOR_TYPE STREQUAL "RPM") checkDependencies_("${FOUND_FILE_4}" "requires" "depend-default;depend-default-b") checkDependencies_("${FOUND_FILE_5}" "requires" "depend-default;depend-default-b") - checkDependencies_("${FOUND_FILE_1}" "conflicts" "conflict-application;conflict-application-b") - checkDependencies_("${FOUND_FILE_2}" "conflicts" "conflict-application;conflict-application-b") - checkDependencies_("${FOUND_FILE_3}" "conflicts" "conflict-headers") - checkDependencies_("${FOUND_FILE_4}" "conflicts" "conflict-default;conflict-default-b") - checkDependencies_("${FOUND_FILE_5}" "conflicts" "conflict-default;conflict-default-b") + checkDependencies_("${FOUND_FILE_1}" "conflicts" "conflicts-application;conflicts-application-b") + checkDependencies_("${FOUND_FILE_2}" "conflicts" "conflicts-application;conflicts-application-b") + checkDependencies_("${FOUND_FILE_3}" "conflicts" "conflicts-headers") + checkDependencies_("${FOUND_FILE_4}" "conflicts" "conflicts-default;conflicts-default-b") + checkDependencies_("${FOUND_FILE_5}" "conflicts" "conflicts-default;conflicts-default-b") checkDependencies_("${FOUND_FILE_1}" "provides" "provided-default;provided-default-b") checkDependencies_("${FOUND_FILE_2}" "provides" "provided-default;provided-default-b") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake index cabbba8..fbd786e 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake @@ -1,50 +1,43 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") - #intentionaly commented out to test old file naming - #set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - - # false by default - set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) - # FIXME can not be tested as libraries first have to be part of a package in order - # to determine their dependencies and we can not be certain if there will be any - set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) - - foreach(dependency_type_ DEPENDS CONFLICTS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) - string(TOLOWER "${dependency_type_}" lower_dependency_type_) - - set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b") - set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") - set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") - set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers") - endforeach() - - set(CPACK_DEBIAN_PACKAGE_PROVIDES "provided-default, provided-default-b") - set(CPACK_DEBIAN_LIBS_PACKAGE_PROVIDES "provided-lib") - set(CPACK_DEBIAN_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - - # FIXME auto autoprov is not tested at the moment as Ubuntu 15.04 rpmbuild - # does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755 - set(CPACK_RPM_PACKAGE_AUTOREQ "no") - set(CPACK_RPM_PACKAGE_AUTOPROV "no") - set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes") - set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes") - - set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b") - set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b") - set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b") - set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers") - - set(CPACK_RPM_PACKAGE_CONFLICTS "conflict-default, conflict-default-b") - set(CPACK_RPM_APPLICATIONS_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") - set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") - set(CPACK_RPM_HEADERS_PACKAGE_CONFLICTS "conflict-headers") - - set(CPACK_RPM_PACKAGE_PROVIDES "provided-default, provided-default-b") - set(CPACK_RPM_LIBS_PACKAGE_PROVIDES "provided-lib") - set(CPACK_RPM_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + # false by default + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) + # FIXME can not be tested as libraries first have to be part of a package in order + # to determine their dependencies and we can not be certain if there will be any + set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) + + foreach(dependency_type_ DEPENDS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) + string(TOLOWER "${dependency_type_}" lower_dependency_type_) + + set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b") + set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") + set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") + set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers") + endforeach() + + set(generator_type_suffix_ "IAN") # not entirely compatible... + else() # RPM + # FIXME auto autoprov is not tested at the moment as Ubuntu 15.04 rpmbuild + # does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755 + set(CPACK_RPM_PACKAGE_AUTOREQ "no") + set(CPACK_RPM_PACKAGE_AUTOPROV "no") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes") + set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes") + + set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b") + set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b") + set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers") + endif() + + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_CONFLICTS "conflicts-default, conflicts-default-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_APPLICATIONS_PACKAGE_CONFLICTS "conflicts-application, conflicts-application-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflicts-application, conflicts-application-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_HEADERS_PACKAGE_CONFLICTS "conflicts-headers") + + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_PROVIDES "provided-default, provided-default-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_LIBS_PACKAGE_PROVIDES "provided-lib") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") endif() set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake index 858a496..650687c 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake @@ -1,3 +1,7 @@ set(EXPECTED_FILES_COUNT "1") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/empty") + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(EXPECTED_FILE_1_COMPONENT "test") +endif() diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake index 049c4a4..cd2c9fd 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake @@ -1,7 +1,3 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") -endif() - if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") if(GENERATOR_TYPE STREQUAL "DEB") set(generator_type_suffix_ "IAN") # not entirely compatible... @@ -12,3 +8,7 @@ endif() install(DIRECTORY DESTINATION empty COMPONENT test) + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL test) +endif() diff --git a/Tests/RunCMake/CPack/tests/EXTRA/test.cmake b/Tests/RunCMake/CPack/tests/EXTRA/test.cmake index 754561d..efa6dac 100644 --- a/Tests/RunCMake/CPack/tests/EXTRA/test.cmake +++ b/Tests/RunCMake/CPack/tests/EXTRA/test.cmake @@ -32,7 +32,4 @@ endforeach() set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") -set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake index fa0bc35..90351ba 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake @@ -1,5 +1,3 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake index 2fc9e23..15c496b 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake @@ -1,5 +1,3 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake index e16f8e1..fb1b8de 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -1,6 +1,4 @@ if(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake index f6656c6..f235d47 100644 --- a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake @@ -1,5 +1,4 @@ if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") endif() diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake index f2c4451..791c586 100644 --- a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake @@ -1,5 +1,3 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - install(FILES CMakeLists.txt DESTINATION foo COMPONENT applications) install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) install(FILES CMakeLists.txt DESTINATION bas COMPONENT libs) diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake index 4441c8e..83ed0f2 100644 --- a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake +++ b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake @@ -1,5 +1 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") -endif() - install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake index 31e729b..4698fb3 100644 --- a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake @@ -2,5 +2,3 @@ install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) set(CPACK_PACKAGE_RELOCATABLE TRUE) set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") - -set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake index 3fca2e2..8719c0b 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake @@ -1,18 +1,16 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + set(generator_type_suffix_ "IAN") # not entirely compatible... + set(group_ "SECTION") + else() + set(group_ "GROUP") + endif() - set(CPACK_DEBIAN_PACKAGE_SECTION "default") - set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") - set(CPACK_DEBIAN_PKG_2_PACKAGE_SECTION "second_group") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_FILE_NAME "${GENERATOR_TYPE}-DEFAULT") - set(CPACK_RPM_PACKAGE_GROUP "default") - set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") - set(CPACK_RPM_PKG_2_PACKAGE_GROUP "second_group") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_${group_} "default") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_${group_} "second_group") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) |