From 0bad57e76533a7bf9b93e880f080e6159f219547 Mon Sep 17 00:00:00 2001 From: Holden Date: Tue, 23 Jul 2024 19:58:54 -0400 Subject: [PATCH] CMake: Fix GimbalController Linking --- src/CMakeLists.txt | 2 ++ src/Gimbal/CMakeLists.txt | 22 ++++++++++++++++++++++ src/Gimbal/GimbalController.cc | 1 + src/Gimbal/GimbalController.h | 12 +++++++----- src/Joystick/CMakeLists.txt | 1 + src/Settings/CMakeLists.txt | 2 ++ src/Vehicle/CMakeLists.txt | 1 + 7 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 src/Gimbal/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d0b610bbb34..a8c194e6308 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,6 +33,7 @@ add_subdirectory(FirmwarePlugin) # add_subdirectory(FlightMap) add_subdirectory(FollowMe) add_subdirectory(Geo) +add_subdirectory(Gimbal) add_subdirectory(GPS) add_subdirectory(Joystick) add_subdirectory(MAVLink) @@ -76,6 +77,7 @@ target_link_libraries(QGC # FlightMap # FlightDisplay FollowMe + Gimbal GPS Joystick MAVLink diff --git a/src/Gimbal/CMakeLists.txt b/src/Gimbal/CMakeLists.txt new file mode 100644 index 00000000000..4c258639e32 --- /dev/null +++ b/src/Gimbal/CMakeLists.txt @@ -0,0 +1,22 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Positioning) + +qt_add_library(Gimbal STATIC + GimbalController.cc + GimbalController.h +) + +target_link_libraries(Gimbal + PRIVATE + Comms + QGC + Settings + Utilities + Vehicle + PUBLIC + Qt6::Core + FactSystem + MAVLink + QmlControls +) + +target_include_directories(Gimbal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/Gimbal/GimbalController.cc b/src/Gimbal/GimbalController.cc index a2ceafc699f..6d444fdda1a 100644 --- a/src/Gimbal/GimbalController.cc +++ b/src/Gimbal/GimbalController.cc @@ -13,6 +13,7 @@ #include "SettingsManager.h" #include "QGCLoggingCategory.h" #include "ParameterManager.h" +#include "MAVLinkProtocol.h" #include diff --git a/src/Gimbal/GimbalController.h b/src/Gimbal/GimbalController.h index 4c9963e1592..f10d458e87e 100644 --- a/src/Gimbal/GimbalController.h +++ b/src/Gimbal/GimbalController.h @@ -9,15 +9,17 @@ #pragma once -#include -#include -#include "Vehicle.h" -#include "QmlObjectListModel.h" -#include "MAVLinkProtocol.h" +#include + +#include +#include +#include Q_DECLARE_LOGGING_CATEGORY(GimbalLog) class MavlinkProtocol; +class Vehicle; +class MAVLinkProtocol; class Gimbal : public FactGroup { diff --git a/src/Joystick/CMakeLists.txt b/src/Joystick/CMakeLists.txt index cb8ed6f39db..a3d2d4d1c9c 100644 --- a/src/Joystick/CMakeLists.txt +++ b/src/Joystick/CMakeLists.txt @@ -56,6 +56,7 @@ target_link_libraries(Joystick PRIVATE Qt6::Qml FirmwarePlugin + Gimbal Settings Utilities Vehicle diff --git a/src/Settings/CMakeLists.txt b/src/Settings/CMakeLists.txt index 98d2e233bc0..9db4d8cf668 100644 --- a/src/Settings/CMakeLists.txt +++ b/src/Settings/CMakeLists.txt @@ -23,6 +23,8 @@ qt_add_library(Settings STATIC FlightModeSettings.h FlyViewSettings.cc FlyViewSettings.h + GimbalControllerSettings.cc + GimbalControllerSettings.h OfflineMapsSettings.cc OfflineMapsSettings.h PlanViewSettings.cc diff --git a/src/Vehicle/CMakeLists.txt b/src/Vehicle/CMakeLists.txt index 9a69270a39a..486e1c1392c 100644 --- a/src/Vehicle/CMakeLists.txt +++ b/src/Vehicle/CMakeLists.txt @@ -53,6 +53,7 @@ target_link_libraries(Vehicle Qt6::Positioning Comms FactSystem + Gimbal LibEventsWrapper MAVLink MissionManager