diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 13:00:29 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 22:20:35 (GMT) |
commit | ed8858edb7c5100e1928c5a94f85485f0e322aa7 (patch) | |
tree | c0dee147388fa9dc2c0c57d666d0ada9ee041a85 /Tests/RunCMake/CPack/RPM/Helpers.cmake | |
parent | 8575affa4c72e1c0d07f964d2f28eb6ddbadb291 (diff) | |
download | CMake-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/RPM/Helpers.cmake')
-rw-r--r-- | Tests/RunCMake/CPack/RPM/Helpers.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/RPM/Helpers.cmake b/Tests/RunCMake/CPack/RPM/Helpers.cmake index ba77a4a..9ed03e2 100644 --- a/Tests/RunCMake/CPack/RPM/Helpers.cmake +++ b/Tests/RunCMake/CPack/RPM/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}.*.rpm" PARENT_SCOPE) + else() + set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.rpm" PARENT_SCOPE) + endif() +endfunction() + function(getPackageInfo FILE RESULT_VAR) execute_process(COMMAND ${RPM_EXECUTABLE} -pqi ${FILE} OUTPUT_VARIABLE info_content |