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/TGZ | |
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/TGZ')
-rw-r--r-- | Tests/RunCMake/CPack/TGZ/Helpers.cmake | 14 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/Tests/RunCMake/CPack/TGZ/Helpers.cmake b/Tests/RunCMake/CPack/TGZ/Helpers.cmake index 8715258..4a194c6 100644 --- a/Tests/RunCMake/CPack/TGZ/Helpers.cmake +++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake @@ -35,9 +35,15 @@ endfunction() function(toExpectedContentList FILE_NO CONTENT_VAR) findExpectedFile("${FILE_NO}" "file_") - get_filename_component(prefix_ "${file_}" NAME) - # NAME_WE removes everything after the dot and dot is in version so use this instead - string(REPLACE ".tar.gz" "" prefix_ "${prefix_}") + # component and monolithic packages differ for some reason by either having + # package filename prefix in path or not + if(PACKAGING_TYPE STREQUAL "MONOLITHIC") + get_filename_component(prefix_ "${file_}" NAME) + # NAME_WE removes everything after the dot and dot is in version so replace instead + string(REPLACE ".tar.gz" "/" prefix_ "${prefix_}") + else() + unset(prefix_) + endif() if(NOT DEFINED TEST_MAIN_INSTALL_PREFIX_PATH) set(TEST_MAIN_INSTALL_PREFIX_PATH "/usr") @@ -45,7 +51,7 @@ function(toExpectedContentList FILE_NO CONTENT_VAR) unset(filtered_) foreach(part_ IN LISTS ${CONTENT_VAR}) - string(REPLACE "${TEST_MAIN_INSTALL_PREFIX_PATH}" "" part_ "${part_}") + string(REGEX REPLACE "^${TEST_MAIN_INSTALL_PREFIX_PATH}(/|$)" "" part_ "${part_}") if(part_) list(APPEND filtered_ "${prefix_}${part_}") diff --git a/Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake b/Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake new file mode 100644 index 0000000..81a5035 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake @@ -0,0 +1 @@ +set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") |