-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
35 lines (26 loc) · 1.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 2.8)
project("cmavnode" C CXX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug, Release."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# Include find files
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(Boost_USE_STATIC_LIBS ON)
find_package( Boost 1.40 COMPONENTS program_options thread system REQUIRED )
find_package( Threads REQUIRED)
find_package( Readline REQUIRED)
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${READLINE_INCLUDE_DIR})
# glob source files
file(GLOB cmavnode_SRC
"src/*.cpp"
)
#actual executable
add_executable(cmavnode ${cmavnode_SRC})
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG " -ggdb")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wno-address-of-packed-member -DMAVLINK_USE_MESSAGE_INFO")
TARGET_LINK_LIBRARIES(cmavnode ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${READLINE_LIBRARY})
install(TARGETS cmavnode DESTINATION bin)