From 7286c9fc5b55df0499c7a8f28b5e61ec57e788cc Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 27 Sep 2018 00:51:25 +0300 Subject: Add licence and version info --- CMakeLists.txt | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3