diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2017-11-18 23:04:54 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2017-11-19 13:55:00 (GMT) |
commit | 176281e131f244bfc987a696951a87ea9b909840 (patch) | |
tree | d6e26ca3afb0375188d71b7aeb0336b7b1f47978 /Tests/RunCMake/CPack/ArchiveCommon | |
parent | cf0c25995d6fd213727f578b35139a822fbaee77 (diff) | |
download | CMake-176281e131f244bfc987a696951a87ea9b909840.zip CMake-176281e131f244bfc987a696951a87ea9b909840.tar.gz CMake-176281e131f244bfc987a696951a87ea9b909840.tar.bz2 |
CPack test: correctly handle CPACK_PACKAGING_INSTALL_PREFIX
Every CPack generator sets default CPACK_PACKAGING_INSTALL_PREFIX
variable value differently so test framework should support
that correctly - previous version expected RPM/Deb /usr default and
removed it for Archive packagers as the default there is /.
Diffstat (limited to 'Tests/RunCMake/CPack/ArchiveCommon')
-rw-r--r-- | Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake index 99d3155..948c6ab 100644 --- a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake +++ b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake @@ -45,13 +45,22 @@ function(toExpectedContentList FILE_NO CONTENT_VAR) unset(prefix_) endif() - if(NOT DEFINED TEST_MAIN_INSTALL_PREFIX_PATH) - set(TEST_MAIN_INSTALL_PREFIX_PATH "/usr") + # add install prefix to expected paths + if(DEFINED EXPECTED_FILE_${FILE_NO}_PACKAGING_PREFIX) + set(EXPECTED_FILE_PACKAGING_PREFIX + "${EXPECTED_FILE_${FILE_NO}_PACKAGING_PREFIX}") + elseif(NOT DEFINED EXPECTED_FILE_PACKAGING_PREFIX) + # default CPack Archive packaging install prefix + set(EXPECTED_FILE_PACKAGING_PREFIX "/") endif() + set(prepared_ "${EXPECTED_FILE_PACKAGING_PREFIX}") + foreach(part_ IN LISTS ${CONTENT_VAR}) + list(APPEND prepared_ "${EXPECTED_FILE_PACKAGING_PREFIX}${part_}") + endforeach() unset(filtered_) - foreach(part_ IN LISTS ${CONTENT_VAR}) - string(REGEX REPLACE "^${TEST_MAIN_INSTALL_PREFIX_PATH}(/|$)" "" part_ "${part_}") + foreach(part_ IN LISTS prepared_) + string(REGEX REPLACE "^/" "" part_ "${part_}") if(part_) list(APPEND filtered_ "${prefix_}${part_}") |