-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
59 lines (47 loc) · 1.97 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
# 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(aruco_mavconn)
# 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)
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(detect_board_mavconn detect_board_mavconn.cpp mavconn_msg.cpp)
add_executable(test_mavlink test_mavlink.cpp)
# Link your application with OpenCV libraries
target_link_libraries(detect_board_mavconn LINK_PRIVATE ${OpenCV_LIBS} ${libmavconn_LIBRARIES})
target_link_libraries(test_mavlink LINK_PRIVATE ${libmavconn_LIBRARIES})