-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
112 lines (96 loc) · 2.7 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
cmake_minimum_required(VERSION 2.8.3)
project(mrasl_guidance)
include(CheckCXXCompilerFlag)
#set(CMAKE_BUILD_TYPE Debug)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
find_package(catkin REQUIRED COMPONENTS
roscpp
cv_bridge
std_msgs
sensor_msgs
image_transport
geometry_msgs
dynamic_reconfigure
camera_info_manager
tf2
tf2_ros
message_generation
)
find_package(OpenCV REQUIRED)
generate_dynamic_reconfigure_options(
cfg/guidance.cfg
)
add_service_files(
FILES
toggle_camera.srv
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp
cv_bridge
std_msgs
sensor_msgs
image_transport
geometry_msgs
dynamic_reconfigure
camera_info_manager
tf2
tf2_ros
message_generation
)
include_directories(
${catkin_INCLUDE_DIRS}
)
MESSAGE("System is: " ${CMAKE_SYSTEM_PROCESSOR})
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
MESSAGE("-- 32bit detected")
link_directories(${PROJECT_SOURCE_DIR}/lib/x86)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE("-- 64bit detected")
link_directories(${PROJECT_SOURCE_DIR}/lib/x64)
endif ()
else()
MESSAGE("-- Non-linux platform detected but sorry we do not support :D")
endif ()
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" )
MESSAGE("-- " ${CMAKE_SYSTEM_PROCESSOR} " detected")
link_directories(${PROJECT_SOURCE_DIR}/lib/XU3)
else ()
endif ()
include_directories(
${PROJECT_SOURCE_DIR}/include
)
add_executable( guidance
${PROJECT_SOURCE_DIR}/src/guidance_node.cpp
${PROJECT_SOURCE_DIR}/src/guidance_manager.cpp
${PROJECT_SOURCE_DIR}/src/guidance_configuration.cpp
${PROJECT_SOURCE_DIR}/src/dji/utils.cpp
)
add_dependencies(guidance
${PROJECT_NAME}_gencfg
${${PROJECT_NAME}_EXPORTED_TARGETS}
)
target_link_libraries( guidance
DJI_guidance
usb-1.0
${catkin_LIBRARIES}
${OpenCV_LIBS}
)
add_library(guidance_nodelet ${PROJECT_SOURCE_DIR}/src/guidance_nodelet.cpp)
add_dependencies(guidance_nodelet ${PROJECT_NAME}_gencfg ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries( guidance_nodelet
DJI_guidance
usb-1.0
${catkin_LIBRARIES}
${OpenCV_LIBS}
)
install(FILES nodelet_plugins.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} )