9aca1dc3679f0f46ce1ea754bfc269572cf30fa7
[oonf.git] / CMakeLists.txt
1 project(OONF_APP C)
2 cmake_minimum_required(VERSION 2.8)
3
4 include(./CMake.config)
5 include(./CMake.os)
6
7 # create all data inside the build directory
8 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
9 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
10 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
11
12 # set release specific compiler options
13 set(CMAKE_C_FLAGS_DEBUG "-g")
14 set(CMAKE_C_FLAGS_RELEASE "-O2 -g0 -DNDEBUG")
15 set(CMAKE_C_FLAGS_MINSIZEREL "-Os -g0 -DNDEBUG")
16
17 # add generic compiler options
18 ADD_DEFINITIONS(-Werror)
19 include(./CMake.flags)
20
21 # add a target to generate API documentation with Doxygen
22 find_package(Doxygen)
23 if(DOXYGEN_FOUND)
24     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/framework.doxyfile.in
25         ${CMAKE_CURRENT_BINARY_DIR}/framework.doxyfile @ONLY)
26     add_custom_target(doc
27         ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/framework.doxyfile
28         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
29         COMMENT "Generating API documentation with Doxygen" VERBATIM
30     )
31 endif(DOXYGEN_FOUND)
32
33 # set include directories
34 include_directories(src)
35 include_directories(src/core)
36
37 # start compiling core and plugins
38 add_subdirectory(src)
39 add_subdirectory(lib)