-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (51 loc) · 2.35 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
PROJECT(spinnaker_ros_interface)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
MESSAGE(STATUS "Compilers found: ${CMAKE_CXX_COMPILER_LIST}")
MESSAGE(STATUS "Using compiler: ${CMAKE_CXX_COMPILER}")
MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "Build Mode: ${CMAKE_BUILD_MODE}")
MESSAGE(STATUS "Arch: ${CMAKE_SYSTEM_PROCESSOR}")
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
SET(CMAKE_CXX_FLAGS "-std=c++11 -march=native -g -Wno-ignored-qualifiers -Wno-extra")
IF(${CMAKE_BUILD_TYPE} MATCHES "Release")
MESSAGE(STATUS "Additional Flags for Release mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -O3 -DNDEBUG")
ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
MESSAGE(STATUS "Additional Flags for Debug mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
SET(BUILD_SPECIFIC_LIBRARIES "")
ENDIF()
MESSAGE(STATUS "CXX Flags: ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "Build-Specific Libraries: ${BUILD_SPECIFIC_LIBRARIES}")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/submodules" ${PROJECT_SOURCE_DIR}/cmake)
FIND_PACKAGE(SPINNAKER REQUIRED)
FIND_PACKAGE(roscpp REQUIRED)
FIND_PACKAGE(roslib REQUIRED)
FIND_PACKAGE(image_transport REQUIRED)
# print spinnaker libraries and include dirs to debug
MESSAGE(STATUS "SPINNAKER_LIBS: ${SPINNAKER_LIBS}")
MESSAGE(STATUS "SPINNAKER_INCLUDE_DIRS: ${SPINNAKER_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/config_reader/include)
INCLUDE_DIRECTORIES(${SPINNAKER_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${roscpp_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${roslib_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${image_transport_INCLUDE_DIRS})
ADD_SUBDIRECTORY(src/shared)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/shared)
SET(libs glog gflags amrl_shared_lib lua5.1
${BUILD_SPECIFIC_LIBRARIES}
${SPINNAKER_LIBS}
${roscpp_LIBRARIES}
${roslib_LIBRARIES}
${image_transport_LIBRARIES})
ADD_EXECUTABLE(spinnaker_ros_interface src/spinnaker_ros_interface_main.cc)
TARGET_LINK_LIBRARIES(spinnaker_ros_interface ${libs})
ADD_EXECUTABLE(ImageFormatControl src/ImageFormatControl.cpp)
TARGET_LINK_LIBRARIES(ImageFormatControl ${libs})