diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-12-11 15:59:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-12-11 15:59:29 (GMT) |
commit | 651b5d157ae43c07e743af94ebf71b624734c4d5 (patch) | |
tree | c7d559821e58f8064c34e5be571ce5153918d1e5 /Tests | |
parent | 2a26a6de012ff12c343456abc2236e60e95e15c5 (diff) | |
parent | 3476dbe6d76aee7409796e3dfd1da6a0c15e7b21 (diff) | |
download | CMake-651b5d157ae43c07e743af94ebf71b624734c4d5.zip CMake-651b5d157ae43c07e743af94ebf71b624734c4d5.tar.gz CMake-651b5d157ae43c07e743af94ebf71b624734c4d5.tar.bz2 |
Merge topic 'cpack-use-CPACK_PACKAGE_HOMEPAGE_URL'
3476dbe6d7 CPack: CMAKE_PROJECT_HOMEPAGE_URL -> CPACK_PACKAGE_HOMEPAGE_URL
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4024
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake | 30 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake | 11 |
5 files changed, 53 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 1b3577f..1e0cb86 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -556,6 +556,7 @@ set(cpack_tests DEB.MD5SUMS DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY DEB.DEB_DESCRIPTION + DEB.PROJECT_META RPM.CUSTOM_BINARY_SPEC_FILE RPM.CUSTOM_NAMES @@ -576,6 +577,7 @@ set(cpack_tests RPM.SUGGESTS RPM.SYMLINKS RPM.USER_FILELIST + RPM.PROJECT_META 7Z TBZ2 diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index b154c79..76d16e1 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -43,3 +43,4 @@ run_cpack_test_subtests( false "MONOLITHIC;COMPONENT" ) +run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake new file mode 100644 index 0000000..448ed2b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake @@ -0,0 +1,9 @@ +if(GENERATOR_TYPE STREQUAL DEB) + set(EXPECTED_FILE_1 "project_meta-1.2.3*.deb") +elseif(GENERATOR_TYPE STREQUAL RPM) + set(EXPECTED_FILE_1 "project_meta-1.2.3*.rpm") +else() + message(FATAL_ERROR "Unexpected CPack generator") +endif() +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake new file mode 100644 index 0000000..b3accb5 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake @@ -0,0 +1,30 @@ +function(checkPackageURL FILE TAG EXPECTED_URL) + getPackageInfo("${FILE}" "_file_info") + string(REPLACE "\n" ";" _file_info "${_file_info}") + + set(_seen_url FALSE) + foreach(_line IN LISTS _file_info) + if(_line MATCHES "${TAG}: (.*)") + set(_seen_url TRUE) + if(NOT CMAKE_MATCH_1 STREQUAL EXPECTED_URL) + message(FATAL_ERROR "Unexpected `Homepage` URL: `${CMAKE_MATCH_1}` != `${EXPECTED_URL}`") + endif() + break() + endif() + endforeach() + if(NOT _seen_url) + message(FATAL_ERROR "The packge `${FILE}` do not have URL as expected") + endif() +endfunction() + +if(GENERATOR_TYPE STREQUAL DEB) + set(_tag " Homepage") # NOTE The leading space +elseif(GENERATOR_TYPE STREQUAL RPM) + set(_tag "URL.*") +else() + message(FATAL_ERROR "Unexpected CPack generator") +endif() + +checkPackageURL("${FOUND_FILE_1}" "${_tag}" "https://meta.test.info") + +# kate: indent-width 2; diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake new file mode 100644 index 0000000..9c5266a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake @@ -0,0 +1,11 @@ +project( + MetaInfoTest + VERSION 1.2.3 + DESCRIPTION "This is going to be a summary" + HOMEPAGE_URL "https://meta.test.info" +) +install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL test) +endif() |