summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-06-08 21:20:44 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-06-08 21:20:44 +0200
commit55ecf068b36c065363f3e6db37d314ae78d9f54d (patch)
tree3e14ea253644cfeac3a84b98cc738023961ae249 /CMakeLists.txt
parentd3ebb84ce46b613a96e948c20101b76785311fd5 (diff)
Generate a valid version tuple if build was triggered from an unpacked `make dist` archive.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
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)