aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 22 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ffd50c9..ff55a80 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,16 +10,26 @@
## -------------------------------------------------------------------------- */
cmake_minimum_required (VERSION 3.5.6)
project(ck C)
+# version
+set(ck_MAJOR_VERSION 0)
+set(ck_MINOR_VERSION 4)
+# compiler
set(CMAKE_C_COMPILER clang)
-option(CK_ASAN "Build with asan")
# compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
+
+# options
+option(CK_ASAN "Build with asan")
+option(CK_RELEASE "Release build")
if(CK_ASAN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
-endif(CK_ASAN)
+endif()
+
+if (NOT CK_RELEASE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
+endif()
# Set project directories
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
@@ -27,6 +37,12 @@ set(RES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/res)
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
set(UNIT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/unit)
+# configure the info header
+configure_file(
+ "${SRC_DIR}/ckinfo.h.in"
+ "${SRC_DIR}/ckinfo.h"
+ )
+
# Set source code locations
set(ckBin_src ${SRC_DIR}/ck.c)
set(ckUnitTest_src ${UNIT_TEST_DIR}/ck-test.c)
@@ -39,7 +55,7 @@ set(ckLib_src
${SRC_DIR}/dbhelper.c
${SRC_DIR}/ckutil.c
${SRC_DIR}/cklist.c
-)
+ )
set(ckLib_hdr
${SRC_DIR}/actionparser.h
@@ -50,7 +66,8 @@ set(ckLib_hdr
${SRC_DIR}/dbhelper.h
${SRC_DIR}/ckutil.h
${SRC_DIR}/cklist.h
-)
+ ${SRC_DIR}/ckinfo.h
+ )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RES_DIR}/cmake)