Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ add_subdirectory(geofence)
add_subdirectory(gimbal)
add_subdirectory(gimbal_device_tester)

# Requires nlohmann_json, so we're skipping it if not found
# Require nlohmann_json, so we're skipping these if not found
find_package(nlohmann_json QUIET)
if(nlohmann_json_FOUND)
add_subdirectory(gimbal_manager)
add_subdirectory(gimbal_device)
else()
message(STATUS "nlohmann_json not found, skipping gimbal_manager example")
message(STATUS "nlohmann_json not found, skipping gimbal_manager and gimbal_device examples")
endif()
add_subdirectory(goto_location)
add_subdirectory(hold)
Expand Down
24 changes: 24 additions & 0 deletions cpp/examples/gimbal_device/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.10.2)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(gimbal_device)

add_executable(gimbal_device
gimbal_device.cpp
)

find_package(MAVSDK REQUIRED)
find_package(nlohmann_json REQUIRED)

target_link_libraries(gimbal_device
MAVSDK::mavsdk
nlohmann_json::nlohmann_json
)

if(NOT MSVC)
add_compile_options(gimbal_device PRIVATE -Wall -Wextra)
else()
add_compile_options(gimbal_device PRIVATE -W2)
endif()
Loading
Loading