summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/TGZ/Helpers.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-01-10 14:34:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-01-10 14:34:55 (GMT)
commitc43cf158d74460440dc5a3d0aec984c754f57958 (patch)
tree9d5b34bd3690500f2673eba10cf2525ed9e47e27 /Tests/RunCMake/CPack/TGZ/Helpers.cmake
parent2c8eb2696a8f3505d45ed5accfa94b3e5541e169 (diff)
parent36bc7e4c3f91c560df8051afedddea3f49474264 (diff)
downloadCMake-c43cf158d74460440dc5a3d0aec984c754f57958.zip
CMake-c43cf158d74460440dc5a3d0aec984c754f57958.tar.gz
CMake-c43cf158d74460440dc5a3d0aec984c754f57958.tar.bz2
Merge topic 'cpack-new-tests'
36bc7e4c store old locale to a temporary variable 05c14ea0 RunCMake.CPack_* add COMPONENT to minimal test 5b0a64eb CPack/Archive minimal tests for more formats
Diffstat (limited to 'Tests/RunCMake/CPack/TGZ/Helpers.cmake')
-rw-r--r--Tests/RunCMake/CPack/TGZ/Helpers.cmake63
1 files changed, 2 insertions, 61 deletions
diff --git a/Tests/RunCMake/CPack/TGZ/Helpers.cmake b/Tests/RunCMake/CPack/TGZ/Helpers.cmake
index 4a194c6..4357a59 100644
--- a/Tests/RunCMake/CPack/TGZ/Helpers.cmake
+++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake
@@ -1,62 +1,3 @@
-set(ALL_FILES_GLOB "*.tar.gz")
+set(cpack_archive_extension_ "tar.gz")
-function(getPackageContent FILE RESULT_VAR)
- execute_process(COMMAND ${CMAKE_COMMAND} -E tar -ztvf ${FILE}
- OUTPUT_VARIABLE package_content_
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE)
-endfunction()
-
-function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR)
- if(COMPONENT)
- set(COMPONENT "-${COMPONENT}")
- endif()
-
- set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.tar.gz" PARENT_SCOPE)
-endfunction()
-
-function(getPackageContentList FILE RESULT_VAR)
- execute_process(COMMAND ${CMAKE_COMMAND} -E tar -ztf ${FILE}
- OUTPUT_VARIABLE package_content_
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- string(REPLACE "\n" ";" package_content_ "${package_content_}")
- foreach(i_ IN LISTS package_content_)
- string(REGEX REPLACE "/$" "" result_ "${i_}")
- list(APPEND items_ "${result_}")
- endforeach()
-
- set(${RESULT_VAR} "${items_}" PARENT_SCOPE)
-endfunction()
-
-function(toExpectedContentList FILE_NO CONTENT_VAR)
- findExpectedFile("${FILE_NO}" "file_")
-
- # 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")
- endif()
-
- unset(filtered_)
- foreach(part_ IN LISTS ${CONTENT_VAR})
- string(REGEX REPLACE "^${TEST_MAIN_INSTALL_PREFIX_PATH}(/|$)" "" part_ "${part_}")
-
- if(part_)
- list(APPEND filtered_ "${prefix_}${part_}")
- endif()
- endforeach()
-
- set(${CONTENT_VAR} "${filtered_}" PARENT_SCOPE)
-endfunction()
+include("${CMAKE_CURRENT_LIST_DIR}/../ArchiveCommon/common_helpers.cmake")