From 5e3008df89f76f2e45d7f9084f8bb5e9337032ab Mon Sep 17 00:00:00 2001 From: Peter Cullen Date: Mon, 15 Apr 2024 15:21:04 +0000 Subject: [PATCH] Check ZEEK_VERSION_LOCAL for dashes Insist that ZEEK_VERSION_LOCAL not contain dashes in order to preserve overall structure of version strings. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index abd40f0579..91e663fab0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,6 +580,10 @@ string(REGEX REPLACE "[^a-zA-Z0-9_\$]" "_" VERSION_C_IDENT "${VERSION_C_IDENT}") set(ZEEK_VERSION_FULL_LOCAL "${ZEEK_VERSION_FULL}") if (NOT ZEEK_VERSION_LOCAL STREQUAL "") +# STRING(FIND ZEEK_VERSION_LOCAL "-" POS) + if (ZEEK_VERSION_LOCAL MATCHES "-") + message(FATAL_ERROR "ZEEK_VERSION_LOCAL can not contain dashes: ${ZEEK_VERSION_LOCAL}") + endif () set(ZEEK_VERSION_FULL_LOCAL "${ZEEK_VERSION_FULL_LOCAL}-${ZEEK_VERSION_LOCAL}") set(VERSION_C_IDENT "${VERSION_C_IDENT}_${ZEEK_VERSION_LOCAL}") endif ()