1 | PROJECT(FlairSensorActuator)
|
---|
2 | cmake_minimum_required(VERSION 2.8)
|
---|
3 | include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
|
---|
4 |
|
---|
5 | find_package(LibXml2 REQUIRED)
|
---|
6 |
|
---|
7 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
---|
8 | OUTPUT_VARIABLE GCC_VERSION)
|
---|
9 |
|
---|
10 | if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
|
---|
11 | if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
---|
12 | ADD_DEFINITIONS("-std=c++11")
|
---|
13 | else()
|
---|
14 | ADD_DEFINITIONS("-std=c++0x")
|
---|
15 | endif()
|
---|
16 | else()
|
---|
17 | message(STATUS "GCC version < 4.3, c+11 is not supported!")
|
---|
18 | endif()
|
---|
19 |
|
---|
20 | INCLUDE_DIRECTORIES(
|
---|
21 | ${LIBXML2_INCLUDE_DIR}
|
---|
22 | ${CMAKE_CURRENT_SOURCE_DIR}/src
|
---|
23 | ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
|
---|
24 | ${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src
|
---|
25 | ${CMAKE_SYSROOT}/usr/include/opencv
|
---|
26 | ${CMAKE_SYSROOT}/usr/include/vrpn
|
---|
27 | # $ENV{IGEP_ROOT}/uav_dev/include
|
---|
28 | )
|
---|
29 |
|
---|
30 | FILE(GLOB SENSOR_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
---|
31 |
|
---|
32 | SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
---|
33 |
|
---|
34 | ADD_LIBRARY(${PROJECT_NAME}
|
---|
35 | ${SENSOR_SRC}
|
---|
36 | )
|
---|
37 |
|
---|
38 | INSTALL(TARGETS ${PROJECT_NAME}
|
---|
39 | LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
|
---|
40 | ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
|
---|
41 | )
|
---|
42 |
|
---|
43 | FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
|
---|
44 | INSTALL(FILES ${files} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME})
|
---|
45 |
|
---|
46 | add_custom_target(
|
---|
47 | compile_info
|
---|
48 | COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
|
---|
49 | )
|
---|
50 |
|
---|
51 | add_dependencies(${PROJECT_NAME} compile_info)
|
---|