mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-08 07:10:12 -05:00
b06870e5ff
Different CPack generators could produce checksum files with the same name which were overwritten by each other since only package name without extensions was used for checksum file name generation. This patch adds package extension to checksum files to prevent collisions. Fixes: #16840
12 lines
521 B
CMake
12 lines
521 B
CMake
if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid")
|
|
string(TOLOWER ${RunCMake_SUBTEST_SUFFIX} CHECKSUM_EXTENSION)
|
|
file(GLOB PACKAGE RELATIVE ${bin_dir} "*.tar.gz")
|
|
file(STRINGS ${PACKAGE}.${CHECKSUM_EXTENSION} 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()
|
|
endif()
|