Move 'enable test' to CMakeListsGlobal.cmake
[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 # set cached variables
34 include (${CMAKE_CURRENT_LIST_DIR}/cmake/lib_config.cmake)
35
36 # include compiler flags
37 include (${CMAKE_CURRENT_LIST_DIR}/cmake/cc_flags.cmake)
38
39 ########################################
40 #### get repository tag and version ####
41 ########################################
42
43 include (${CMAKE_CURRENT_LIST_DIR}/cmake/get_version.cmake)
44 IF(EXISTS "${CMAKE_BINARY_DIR}/version.cmake")
45   include (${CMAKE_BINARY_DIR}/version.cmake)
46 ENDIF()