-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
72 lines (57 loc) · 2.6 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
# cmake needs this line
cmake_minimum_required(VERSION 3.1)
# Enable C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# Define project name
project(t265_mavconn)
set(APRILTAG_INC /usr/local/include/apriltag)
set(APRILTAG_LIB /usr/local/lib/libapriltag.so)
find_path(APRILTAG_INC NAMES apriltag.h PATH_SUFFIXES apriltag)
find_library(APRILTAG_LIB apriltag)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(apriltag DEFAULT_MSG APRILTAG_INC APRILTAG_LIB)
add_library(apriltag INTERFACE)
target_include_directories(apriltag INTERFACE ${APRILTAG_INC})
target_link_libraries(apriltag INTERFACE ${APRILTAG_LIB})
# Find OpenCV, you may need to set OpenCV_DIR variable
# to the absolute path to the directory containing OpenCVConfig.cmake file
# via the command line or GUI
set(OpenCV_DIR /usr/local/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
## System dependencies are found with CMake's conventions
find_package(console_bridge REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
set(libmavconn_DIR /usr/local/share/libmavconn/cmake)
find_package(libmavconn REQUIRED)
message(STATUS "libmavconn library status:")
message(STATUS " config: ${libmavconn_DIR}")
message(STATUS " version: ${libmavconn_VERSION}")
message(STATUS " libraries: ${libmavconn_LIBRARIES}")
message(STATUS " include path: ${libmavconn_INCLUDE_DIRS}")
# add package modules path, not needed in dependend packages
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
include(EnableCXX11)
include(MavrosMavlink)
###########
## Build ##
###########
set(OBJS
${CMAKE_CURRENT_SOURCE_DIR}/libs/obj.o
)
# Declare the executable target built from your sources
add_executable(t265_mavconn t265_mavconn.cpp mavconn_msg.cpp)
add_executable(t265_mav_tag t265_mav_tag.cpp mavconn_msg.cpp pose_apriltag.cpp)
# Link your application with OpenCV libraries
target_link_libraries(t265_mavconn LINK_PRIVATE realsense2 ${OpenCV_LIBS} ${libmavconn_LIBRARIES})
target_link_libraries(t265_mav_tag LINK_PRIVATE realsense2 ${OpenCV_LIBS} ${libmavconn_LIBRARIES} apriltag)
#target_link_libraries(t265_mav_tag LINK_PRIVATE realsense2 ${OpenCV_LIBS} ${libmavconn_LIBRARIES} apriltag -lpthread)