Prevent division by zero through (malformed) RLQ value
[oonf.git] / CMakeListsGlobal.cmake
1 cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
2 if(POLICY CMP0048)
3   cmake_policy(SET CMP0048 NEW)
4 endif()
5
6 project (OONF C)
7
8 if (NOT OONF_NO_TESTING)
9     ENABLE_TESTING()
10 endif (NOT OONF_NO_TESTING)
11
12 #####################################
13 #### set path to source for apps ####
14 #####################################
15
16 SET(APP_DATA_C_IN ${CMAKE_CURRENT_LIST_DIR}/src/main/app_data.c.in)
17 SET(MAIN_C ${CMAKE_CURRENT_LIST_DIR}/src/main/main.c)
18 SET(VERSION_CMAKE_IN ${CMAKE_CURRENT_LIST_DIR}/cmake/files/version.cmake.in)
19 SET(VERSION_SOURCE_DIR ${CMAKE_SOURCE_DIR})
20 SET(VERSION_SOURCE_SUB_DIR ${CMAKE_CURRENT_LIST_DIR})
21
22 #################################
23 #### add include directories ####
24 #################################
25
26 include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
27 include_directories(${CMAKE_BINARY_DIR})
28
29 ###########################
30 #### API configuration ####
31 ###########################
32
33 # add define for length of base path
34 string(LENGTH "${CMAKE_SOURCE_DIR}/" BASELENGTH)
35 add_definitions(-DBASEPATH_LENGTH=${BASELENGTH})
36
37 # set cached variables
38 include (${CMAKE_CURRENT_LIST_DIR}/cmake/lib_config.cmake)
39
40 # include compiler flags
41 include (${CMAKE_CURRENT_LIST_DIR}/cmake/cc_flags.cmake)
42
43 # helper for test case creation
44 include (${CMAKE_CURRENT_LIST_DIR}/cmake/create_test.cmake)
45
46 ########################################
47 #### get repository tag and version ####
48 ########################################
49
50 include (${CMAKE_CURRENT_LIST_DIR}/cmake/get_version.cmake)
51 IF(EXISTS "${CMAKE_BINARY_DIR}/version.cmake")
52   include (${CMAKE_BINARY_DIR}/version.cmake)
53 ENDIF()