Change VERSION variable in CMake config to ZEEK_VERSION_FULL

This commit is contained in:
Tim Wojtulewicz 2023-08-03 14:51:25 -07:00
parent cb649795c0
commit 67c8e5192a
4 changed files with 7 additions and 7 deletions

View file

@ -531,7 +531,7 @@ file(
"setenv ZEEK_SPICY_LIBRARY_PATH \"${cmake_source_dir}/scripts/spicy\"\n" "setenv ZEEK_SPICY_LIBRARY_PATH \"${cmake_source_dir}/scripts/spicy\"\n"
"setenv SPICY_BUILD_DIRECTORY \"${cmake_binary_dir}/auxil/spicy\"\n") "setenv SPICY_BUILD_DIRECTORY \"${cmake_binary_dir}/auxil/spicy\"\n")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1) file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" ZEEK_VERSION_FULL LIMIT_COUNT 1)
execute_process( execute_process(
COMMAND grep "^constexpr int PLUGIN_API_VERSION" COMMAND grep "^constexpr int PLUGIN_API_VERSION"
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin/Plugin.h INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin/Plugin.h
@ -541,7 +541,7 @@ execute_process(
string(REGEX MATCH "^constexpr int PLUGIN_API_VERSION = ([0-9]+);" API_VERSION "${API_VERSION}") string(REGEX MATCH "^constexpr int PLUGIN_API_VERSION = ([0-9]+);" API_VERSION "${API_VERSION}")
set(API_VERSION "${CMAKE_MATCH_1}") set(API_VERSION "${CMAKE_MATCH_1}")
string(REGEX REPLACE "[.-]" " " version_numbers ${VERSION}) string(REGEX REPLACE "[.-]" " " version_numbers ${ZEEK_VERSION_FULL})
separate_arguments(version_numbers) separate_arguments(version_numbers)
list(GET version_numbers 0 VERSION_MAJOR) list(GET version_numbers 0 VERSION_MAJOR)
list(GET version_numbers 1 VERSION_MINOR) list(GET version_numbers 1 VERSION_MINOR)
@ -550,7 +550,7 @@ set(VERSION_MAJ_MIN "${VERSION_MAJOR}.${VERSION_MINOR}")
math(EXPR ZEEK_VERSION_NUMBER math(EXPR ZEEK_VERSION_NUMBER
"${VERSION_MAJOR} * 10000 + ${VERSION_MINOR} * 100 + ${VERSION_PATCH}") "${VERSION_MAJOR} * 10000 + ${VERSION_MINOR} * 100 + ${VERSION_PATCH}")
set(VERSION_C_IDENT "${VERSION}_plugin_${API_VERSION}") set(VERSION_C_IDENT "${ZEEK_VERSION_FULL}_plugin_${API_VERSION}")
string(REGEX REPLACE "-[0-9]*$" "_git" VERSION_C_IDENT "${VERSION_C_IDENT}") string(REGEX REPLACE "-[0-9]*$" "_git" VERSION_C_IDENT "${VERSION_C_IDENT}")
string(REGEX REPLACE "[^a-zA-Z0-9_\$]" "_" VERSION_C_IDENT "${VERSION_C_IDENT}") string(REGEX REPLACE "[^a-zA-Z0-9_\$]" "_" VERSION_C_IDENT "${VERSION_C_IDENT}")
@ -1288,7 +1288,7 @@ endif ()
# has already configured packaging # has already configured packaging
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
include(ConfigurePackaging) include(ConfigurePackaging)
ConfigurePackaging(${VERSION}) ConfigurePackaging(${ZEEK_VERSION_FULL})
endif () endif ()
# Refers back to the "distribution prefix". This is the source tree when # Refers back to the "distribution prefix". This is the source tree when

View file

@ -14,7 +14,7 @@ prefix="@CMAKE_INSTALL_PREFIX@"
python_dir="@PY_MOD_INSTALL_DIR@" python_dir="@PY_MOD_INSTALL_DIR@"
script_dir="@ZEEK_SCRIPT_INSTALL_PATH@" script_dir="@ZEEK_SCRIPT_INSTALL_PATH@"
site_dir="@ZEEK_SCRIPT_INSTALL_PATH@/site" site_dir="@ZEEK_SCRIPT_INSTALL_PATH@/site"
version="@VERSION@" version="@ZEEK_VERSION_FULL@"
zeek_dist="@ZEEK_DIST@" zeek_dist="@ZEEK_DIST@"
zeekpath="@DEFAULT_ZEEKPATH@" zeekpath="@DEFAULT_ZEEKPATH@"

View file

@ -3,7 +3,7 @@
#pragma once #pragma once
/* Version number of package */ /* Version number of package */
#define VERSION "@VERSION@" #define VERSION "@ZEEK_VERSION_FULL@"
// Zeek version number. // Zeek version number.
// This is the result of (major * 10000 + minor * 100 + patch) // This is the result of (major * 10000 + minor * 100 + patch)

View file

@ -1,7 +1,7 @@
#include "zeek/zeek-version.h" #include "zeek/zeek-version.h"
char version[] = "@VERSION@"; char version[] = "@ZEEK_VERSION_FULL@";
// A C function that has the current version built into its name. // A C function that has the current version built into its name.
// One can link a shared library against this to ensure that it won't // One can link a shared library against this to ensure that it won't