-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (42 loc) · 1.44 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
cmake_minimum_required(VERSION 3.10.2)
project(mavlink-access)
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
set(SOURCES
"${SRC_DIR}/main.cpp"
"${SRC_DIR}/mavlink_connection.hpp"
"${SRC_DIR}/mavlink_connection.cpp"
)
add_executable(${PROJECT_NAME} ${SOURCES})
find_package(MAVSDK REQUIRED)
add_library(imgui STATIC
${LIB_DIR}/imgui/imgui.cpp
${LIB_DIR}/imgui/imgui_draw.cpp
${LIB_DIR}/imgui/imgui_demo.cpp
${LIB_DIR}/imgui/imgui_tables.cpp
${LIB_DIR}/imgui/imgui_widgets.cpp
)
target_include_directories(imgui PUBLIC ${LIB_DIR}/imgui)
add_library(imgui_backend STATIC
${LIB_DIR}/imgui/backends/imgui_impl_glfw.cpp
${LIB_DIR}/imgui/backends/imgui_impl_opengl3.cpp
)
target_include_directories(imgui_backend PUBLIC
${LIB_DIR}/imgui
${LIB_DIR}/imgui/backends
)
find_package(OpenGL REQUIRED)
find_package(glfw3 REQUIRED)
target_link_libraries(imgui_backend imgui glfw OpenGL::GL)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(${PROJECT_NAME} PRIVATE MAVSDK::mavsdk imgui_backend)
if(NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra)
else()
target_compile_options(${PROJECT_NAME} PRIVATE /W2)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Configuring Debug build")
add_compile_options(-g)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
endif()