From 55ecf068b36c065363f3e6db37d314ae78d9f54d Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 8 Jun 2021 21:20:44 +0200 Subject: Generate a valid version tuple if build was triggered from an unpacked `make dist` archive. Signed-off-by: Toni Uhlig --- CMakeLists.txt | 7 +++++++ scripts/make-dist.sh | 1 + 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a50730aa9..595da7574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,13 @@ execute_process( WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_VERSION ERROR_QUIET) string(STRIP "${GIT_VERSION}" GIT_VERSION) +if(GIT_VERSION STREQUAL "") + if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "") + set(GIT_VERSION "1.5-pre") + else() + set(GIT_VERSION "1.5-release") + endif() +endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") set(NDPID_C_FLAGS -DJSMN_STATIC=1 -DJSMN_STRICT=1) diff --git a/scripts/make-dist.sh b/scripts/make-dist.sh index b978aeb65..c58524e81 100755 --- a/scripts/make-dist.sh +++ b/scripts/make-dist.sh @@ -13,6 +13,7 @@ flock -x -n 42 || { cd "$(dirname "${0}")/.." if [ ! -d ./.git ]; then printf '%s\n' "This script can only by run from a nDPId git repository." >&2 + exit 1; fi git submodule update --init ./libnDPI -- cgit v1.2.3