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/DEPENDENCIES | |
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/DEPENDENCIES')
-rw-r--r-- | Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake | 87 |
2 files changed, 45 insertions, 52 deletions
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) |