diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2015-09-09 21:57:58 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2015-09-09 21:57:58 (GMT) |
commit | 4de7c8126b43d93f781afaf0b990cc8814105017 (patch) | |
tree | 1627a3b1d24c931e31d68ff9d89700bcbd0cd72e /Tests/RunCMake/CPack | |
parent | f281c6214ba932e5a5c9d8bae67313fc8bfa8ec9 (diff) | |
download | CMake-4de7c8126b43d93f781afaf0b990cc8814105017.zip CMake-4de7c8126b43d93f781afaf0b990cc8814105017.tar.gz CMake-4de7c8126b43d93f781afaf0b990cc8814105017.tar.bz2 |
CPack/Deb: enable per component setting of dependencies
Diffstat (limited to 'Tests/RunCMake/CPack')
-rw-r--r-- | Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake | 33 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake | 16 |
2 files changed, 37 insertions, 12 deletions
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake index 44c862d..ba39f2e 100644 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake +++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake @@ -1,4 +1,4 @@ -function(checkDepends_ FILE REGEX) +function(checkDependencies_ FILE REGEX) set(whitespaces_ "[\t\n\r ]*") getPackageInfo("${FILE}" "FILE_INFO_") @@ -7,9 +7,28 @@ function(checkDepends_ FILE REGEX) endif() endfunction() -checkDepends_("${FOUND_FILE_1}" ".*Depends${whitespaces_}:${whitespaces_}depend-application, depend-application-b.*") -# use wildcard as we are using dependency auto detection -checkDepends_("${FOUND_FILE_2}" ".*Depends${whitespaces_}:${whitespaces_}.*depend-application, depend-application-b.*") -checkDepends_("${FOUND_FILE_3}" ".*Depends${whitespaces_}:${whitespaces_}depend-headers.*") -checkDepends_("${FOUND_FILE_4}" ".*Depends${whitespaces_}:${whitespaces_}depend-default, depend-default-b.*") -checkDepends_("${FOUND_FILE_5}" ".*Depends${whitespaces_}:${whitespaces_}depend-default, depend-default-b.*") +foreach(dependency_type_ DEPENDS CONFLICTS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) + string(TOLOWER "${dependency_type_}" lower_dependency_type_) + string(SUBSTRING ${lower_dependency_type_} 1 -1 lower_dependency_type_tail_) + string(SUBSTRING ${dependency_type_} 0 1 dependency_type_head_) + set(dependency_type_name_ "${dependency_type_head_}${lower_dependency_type_tail_}") + + checkDependencies_("${FOUND_FILE_1}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*") + checkDependencies_("${FOUND_FILE_2}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}.*${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*") + checkDependencies_("${FOUND_FILE_3}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-headers.*") + checkDependencies_("${FOUND_FILE_4}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*") + checkDependencies_("${FOUND_FILE_5}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*") +endforeach() + +checkDependencies_("${FOUND_FILE_1}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") +checkDependencies_("${FOUND_FILE_2}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") +checkDependencies_("${FOUND_FILE_3}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") +checkDependencies_("${FOUND_FILE_4}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib.*") +checkDependencies_("${FOUND_FILE_5}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib_auto.*, provided-lib_auto-b.*") + +# PREDEPENDS +checkDependencies_("${FOUND_FILE_1}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-application, predepends-application-b.*") +checkDependencies_("${FOUND_FILE_2}" ".*Pre-Depends${whitespaces_}:${whitespaces_}.*predepends-application, predepends-application-b.*") +checkDependencies_("${FOUND_FILE_3}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-headers.*") +checkDependencies_("${FOUND_FILE_4}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*") +checkDependencies_("${FOUND_FILE_5}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*") diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake index 9e09428..96a9f14 100644 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake +++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake @@ -7,9 +7,15 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) # to determine their dependencies and we can not be certain if there will be any set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) -set(CPACK_DEBIAN_PACKAGE_DEPENDS "depend-default, depend-default-b") -set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_DEPENDS "depend-application, depend-application-b") -set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_DEPENDS "depend-application, depend-application-b") -set(CPACK_DEBIAN_HEADERS_PACKAGE_DEPENDS "depend-headers") +foreach(dependency_type_ DEPENDS CONFLICTS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) + string(TOLOWER "${dependency_type_}" lower_dependency_type_) -# TODO add other dependency tests once CPackDeb supports them + 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") |