summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake
diff options
context:
space:
mode:
authorPetr Orlov <zfmeze@gmail.com>2016-08-31 15:05:15 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-19 14:22:50 (GMT)
commit1c63aa4d43f101a0d58b5b88d3119c72cadf5517 (patch)
tree0c347a5de4650e490bb47183e3d39563b1c42113 /Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake
parent4682b42bdb5a9b7ca9f6ef5f65c019eec4f92a62 (diff)
downloadCMake-1c63aa4d43f101a0d58b5b88d3119c72cadf5517.zip
CMake-1c63aa4d43f101a0d58b5b88d3119c72cadf5517.tar.gz
CMake-1c63aa4d43f101a0d58b5b88d3119c72cadf5517.tar.bz2
CPack: Add option to generate a checksum file next to each package file
Add variable CPACK_PACKAGE_CHECKSUM to activate it.
Diffstat (limited to 'Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake')
-rw-r--r--Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake
new file mode 100644
index 0000000..e9e65d6
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake
@@ -0,0 +1,14 @@
+if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid")
+ string(TOLOWER ${RunCMake_SUBTEST_SUFFIX} EXTENSION)
+ file(GLOB PACKAGE RELATIVE ${bin_dir} "*.tar.gz")
+ file(GLOB CSUMFILE RELATIVE ${bin_dir} "*.${EXTENSION}")
+ file(STRINGS ${CSUMFILE} CHSUM_VALUE)
+ file(${RunCMake_SUBTEST_SUFFIX} ${PACKAGE} expected_value )
+ set(expected_value "${expected_value} ${PACKAGE}")
+
+ if(NOT expected_value STREQUAL CHSUM_VALUE)
+ message(FATAL_ERROR "Generated checksum is not valid! Expected [${expected_value}] Got [${CHSUM_VALUE}]")
+ endif()
+else()
+ message(${error})
+endif()