summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/DEB
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2016-11-27 13:00:29 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-11-27 22:20:35 (GMT)
commited8858edb7c5100e1928c5a94f85485f0e322aa7 (patch)
treec0dee147388fa9dc2c0c57d666d0ada9ee041a85 /Tests/RunCMake/CPack/DEB
parent8575affa4c72e1c0d07f964d2f28eb6ddbadb291 (diff)
downloadCMake-ed8858edb7c5100e1928c5a94f85485f0e322aa7.zip
CMake-ed8858edb7c5100e1928c5a94f85485f0e322aa7.tar.gz
CMake-ed8858edb7c5100e1928c5a94f85485f0e322aa7.tar.bz2
Tests: CPack test unify expected file naming
Each generator generates its own file format with different extensions but they all create those file names by a certain pattern and all of them require the same pieces for that pattern to work. Now we can only provide pieces once and and each generator will use those pieces to generate an expected file name.
Diffstat (limited to 'Tests/RunCMake/CPack/DEB')
-rw-r--r--Tests/RunCMake/CPack/DEB/Helpers.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake
index 9b1be22..e5cda08 100644
--- a/Tests/RunCMake/CPack/DEB/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake
@@ -9,6 +9,26 @@ function(getPackageContent FILE RESULT_VAR)
set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE)
endfunction()
+function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR)
+ if(COMPONENT)
+ set(COMPONENT "-${COMPONENT}")
+ endif()
+
+ if(DEFINED EXPECTED_FILE_${FILE_NO}_FILENAME_GENERATOR_SPECIFIC_FORMAT)
+ set(GENERATOR_SPECIFIC_FORMAT "${EXPECTED_FILE_${FILE_NO}_FILENAME_GENERATOR_SPECIFIC_FORMAT}")
+ elseif(DEFINED EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT)
+ set(GENERATOR_SPECIFIC_FORMAT "${EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT}")
+ else()
+ set(GENERATOR_SPECIFIC_FORMAT FALSE)
+ endif()
+
+ if(GENERATOR_SPECIFIC_FORMAT)
+ set(${RESULT_VAR} "${NAME}${COMPONENT}_${VERSION}-${REVISION}_*.deb" PARENT_SCOPE)
+ else()
+ set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.deb" PARENT_SCOPE)
+ endif()
+endfunction()
+
function(getMissingShlibsErrorExtra FILE RESULT_VAR)
execute_process(COMMAND ${DPKG_EXECUTABLE} -x "${FILE}" data_${PREFIX}
ERROR_VARIABLE err_)