zeek/testing/CMakeLists.txt
Benjamin Bannier 15604811cb Fix installation of symlink with DESTDIR
We install test data which we also make available under an alternative
path for backwards compatibility. The installation of this symlink did
not take `DESTDIR` installs like used by Zeek's packaging into account
which caused installations from packages to behave different from
installs from source.

This patch fixes the symlink to respect a possible `DESTDIR`.

Closes #3266.
2025-08-21 10:56:28 +02:00

21 lines
761 B
CMake

install(
DIRECTORY scripts/
DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/scripts
USE_SOURCE_PERMISSIONS FILES_MATCHING
PATTERN "diff-*")
install(FILES btest/random.seed DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/data)
if (INSTALL_BTEST_PCAPS)
install(DIRECTORY btest/Traces/ DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/data/pcaps)
endif ()
# The remainder is for backwards-compatability with existing Spicy zkg packages.
install(
CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
${ZEEK_CONFIG_BTEST_TOOLS_DIR}/data \
\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/zeek/tests \
)")
install(DIRECTORY scripts/spicy/ DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/data/Scripts
USE_SOURCE_PERMISSIONS)