Generate a valid version tuple if build was triggered from an unpacked make dist archive.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2021-06-08 21:20:44 +02:00
parent d3ebb84ce4
commit 55ecf068b3
2 changed files with 8 additions and 0 deletions

View File

@@ -36,6 +36,13 @@ execute_process(
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_VERSION ERROR_QUIET) OUTPUT_VARIABLE GIT_VERSION ERROR_QUIET)
string(STRIP "${GIT_VERSION}" GIT_VERSION) 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(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set(NDPID_C_FLAGS -DJSMN_STATIC=1 -DJSMN_STRICT=1) set(NDPID_C_FLAGS -DJSMN_STATIC=1 -DJSMN_STRICT=1)

View File

@@ -13,6 +13,7 @@ flock -x -n 42 || {
cd "$(dirname "${0}")/.." cd "$(dirname "${0}")/.."
if [ ! -d ./.git ]; then if [ ! -d ./.git ]; then
printf '%s\n' "This script can only by run from a nDPId git repository." >&2 printf '%s\n' "This script can only by run from a nDPId git repository." >&2
exit 1;
fi fi
git submodule update --init ./libnDPI git submodule update --init ./libnDPI