Allow ffdat metric to consider rx_throughput field
[oonf.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
2
3 ###########################
4 #### API configuration ####
5 ###########################
6
7 # set cached variables
8 #include (./cmake/lib_config.cmake)
9
10 # include compiler flags
11 #include (./cmake/cc_flags.cmake)
12
13 # include global variables
14 include (./CMakeListsGlobal.cmake)
15
16 ########################################################
17 #### Set a default build type if none was specified ####
18 ########################################################
19
20 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
21   message(STATUS "Setting build type to 'Debug' as none was specified.")
22   set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
23   # Set the possible values of build type for cmake-gui
24   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
25     "MinSizeRel" "RelWithDebInfo")
26 endif()
27
28 ########################################
29 #### get repository tag and version ####
30 ########################################
31
32 #include (cmake/get_version.cmake)
33 #IF(EXISTS "${PROJECT_BINARY_DIR}/version.cmake")
34 #  include (${PROJECT_BINARY_DIR}/version.cmake)
35 #ENDIF()
36
37 ########################
38 #### Doxygen target ####
39 ########################
40
41 find_package(Doxygen)
42 if(DOXYGEN_FOUND)
43     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/files/framework.doxyfile.in
44         ${CMAKE_CURRENT_BINARY_DIR}/framework.doxyfile @ONLY)
45     add_custom_target(doc
46         ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/framework.doxyfile
47         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
48         COMMENT "Generating API documentation with Doxygen" VERBATIM
49     )
50 endif(DOXYGEN_FOUND)
51
52 #############################
53 #### add tarball targets ####
54 #############################
55
56 ADD_CUSTOM_TARGET(tar    COMMAND ${CMAKE_COMMAND}
57                                  -D SOURCE:STRING=${CMAKE_SOURCE_DIR}
58                                  -D BINARY:STRING=${PROJECT_BINARY_DIR}
59                                  -D VERSION:STRING=${VERSION}
60                                  -D FORMAT:STRING=tar
61                                  -D TARBALL:STRING=${TARBALL}
62                                  -D TARPREFIX:STRING=${TARPREFIX}
63                                  -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate_archive.cmake)
64 ADD_CUSTOM_TARGET(targz  COMMAND ${CMAKE_COMMAND}
65                                  -D SOURCE:STRING=${CMAKE_SOURCE_DIR}
66                                  -D BINARY:STRING=${PROJECT_BINARY_DIR}
67                                  -D VERSION:STRING=${VERSION}
68                                  -D FORMAT:STRING=tar.gz
69                                  -D TARBALL:STRING=${TARBALL}
70                                  -D TARPREFIX:STRING=${TARPREFIX}
71                                  -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate_archive.cmake)
72 ADD_CUSTOM_TARGET(tarbz2 COMMAND ${CMAKE_COMMAND}
73                                  -D SOURCE:STRING=${CMAKE_SOURCE_DIR}
74                                  -D BINARY:STRING=${PROJECT_BINARY_DIR}
75                                  -D VERSION:STRING=${VERSION}
76                                  -D FORMAT:STRING=tar.bz2
77                                  -D TARBALL:STRING=${TARBALL}
78                                  -D TARPREFIX:STRING=${TARPREFIX}
79                                  -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate_archive.cmake)
80 ADD_CUSTOM_TARGET(zip    COMMAND ${CMAKE_COMMAND}
81                                  -D SOURCE:STRING=${CMAKE_SOURCE_DIR}
82                                  -D BINARY:STRING=${PROJECT_BINARY_DIR}
83                                  -D VERSION:STRING=${VERSION}
84                                  -D FORMAT:STRING=zip
85                                  -D TARBALL:STRING=${TARBALL}
86                                  -D TARPREFIX:STRING=${TARPREFIX}
87                                  -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate_archive.cmake)
88
89 #########################
90 #### Compile targets ####
91 #########################
92
93 # include build helper
94 include (cmake/declare_library.cmake)
95
96 # define static and dynamic target
97 add_custom_target(static)
98 add_custom_target(dynamic)
99 add_custom_target(build_tests)
100
101 # start compiling core and plugins
102 add_subdirectory(src)
103 add_subdirectory(apps)