Skip to content

Commit

Permalink
CMake: Add LGPL Option
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Sep 6, 2024
1 parent 08f3e87 commit 3734b7f
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 93 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ find_package(Qt6
REQUIRED
COMPONENTS
Bluetooth
Charts
Concurrent
Core
Core5Compat
Expand All @@ -182,7 +181,9 @@ find_package(Qt6
Widgets
Xml
OPTIONAL_COMPONENTS
Charts
LinguistTools
Quick3D
SerialPort
HINTS
${QT_LIBRARY_HINTS}
Expand Down Expand Up @@ -211,8 +212,6 @@ if(QGC_BUILD_TESTING)
add_compile_definitions(UNITTEST_BUILD) # TODO: QGC_UNITTEST_BUILD
endif()

# option(QGC_DISABLE_MAVLINK_INSPECTOR "Disable Mavlink Inspector" OFF) # This removes QtCharts which is GPL licensed

cmake_dependent_option(QGC_DEBUG_QML "Build QGroundControl with QML debugging/profiling support." OFF "CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
if(QGC_DEBUG_QML)
message(STATUS "To enable the QML debugger/profiler, run with: '-qmljsdebugger=port:1234'")
Expand All @@ -221,8 +220,9 @@ endif()

cmake_dependent_option(QGC_NO_SERIAL_LINK "Build QGroundControl without Serial Support Support." OFF "NOT IOS" ON)

if(QGC_DISABLE_APM_MAVLINK)
add_compile_definitions(NO_ARDUPILOT_DIALECT)
if(QGC_LGPL_COMPATIBLE)
set(QGC_DISABLE_VIEWER3D ON CACHE INTERNAL "" FORCE)
set(QGC_DISABLE_MAVLINK_INSPECTOR ON CACHE INTERNAL "" FORCE)
endif()

#######################################################
Expand Down
2 changes: 2 additions & 0 deletions cmake/CustomOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ option(QGC_DISABLE_APM_PLUGIN_FACTORY "Disable APM Plugin Factory" OFF)
# PX4
option(QGC_DISABLE_PX4_PLUGIN "Disable PX4 Plugin" OFF)
option(QGC_DISABLE_PX4_PLUGIN_FACTORY "Disable PX4 Plugin Factory" OFF)

option(QGC_LGPL_COMPATIBLE "Disable Dependencies that are LGPL Incompatible" OFF)
2 changes: 1 addition & 1 deletion libs/mavlink/include/mavlink/v2.0
Submodule v2.0 updated 67 files
+3 −3 ASLUAV/ASLUAV.h
+1 −1 ASLUAV/mavlink.h
+1 −1 ASLUAV/version.h
+2 −2 AVSSUAS/AVSSUAS.h
+1 −1 AVSSUAS/mavlink.h
+1 −1 AVSSUAS/version.h
+4 −4 all/all.h
+1 −1 all/mavlink.h
+1 −1 all/version.h
+3 −3 ardupilotmega/ardupilotmega.h
+1 −1 ardupilotmega/mavlink.h
+1 −1 ardupilotmega/version.h
+7 −20 common/common.h
+1 −1 common/mavlink.h
+6 −6 common/mavlink_msg_adsb_vehicle.h
+13 −41 common/mavlink_msg_camera_information.h
+6 −6 common/mavlink_msg_global_position_int.h
+13 −41 common/mavlink_msg_video_stream_information.h
+8 −10 common/testsuite.h
+1 −1 common/version.h
+1 −1 csAirLink/csAirLink.h
+1 −1 csAirLink/mavlink.h
+1 −1 csAirLink/version.h
+2 −2 cubepilot/cubepilot.h
+1 −1 cubepilot/mavlink.h
+1 −1 cubepilot/version.h
+6 −92 development/development.h
+1 −1 development/mavlink.h
+6 −6 development/mavlink_msg_battery_status_v2.h
+0 −456 development/mavlink_msg_fuel_status.h
+0 −568 development/mavlink_msg_gnss_integrity.h
+0 −138 development/testsuite.h
+1 −1 development/version.h
+1 −1 icarous/icarous.h
+1 −1 icarous/mavlink.h
+1 −1 icarous/version.h
+3 −3 matrixpilot/matrixpilot.h
+1 −1 matrixpilot/mavlink.h
+1 −1 matrixpilot/version.h
+2 −2 message_definitions/all.xml
+11 −30 message_definitions/common.xml
+2 −152 message_definitions/development.xml
+1 −1 message_definitions/matrixpilot.xml
+1 −1 minimal/mavlink.h
+1 −1 minimal/minimal.h
+1 −1 minimal/version.h
+1 −1 paparazzi/mavlink.h
+2 −2 paparazzi/paparazzi.h
+1 −1 paparazzi/version.h
+1 −1 python_array_test/mavlink.h
+2 −2 python_array_test/python_array_test.h
+1 −1 python_array_test/version.h
+1 −1 standard/mavlink.h
+1 −1 standard/standard.h
+1 −1 standard/version.h
+1 −1 storm32/mavlink.h
+3 −3 storm32/storm32.h
+1 −1 storm32/version.h
+1 −1 test/mavlink.h
+1 −1 test/test.h
+1 −1 test/version.h
+1 −1 uAvionix/mavlink.h
+2 −2 uAvionix/uAvionix.h
+1 −1 uAvionix/version.h
+1 −1 ualberta/mavlink.h
+2 −2 ualberta/ualberta.h
+1 −1 ualberta/version.h
79 changes: 46 additions & 33 deletions src/AnalyzeView/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(Qt6 REQUIRED COMPONENTS Core Charts Gui Qml QmlIntegration)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml QmlIntegration)

qt_add_library(AnalyzeView STATIC
ExifParser.cc
Expand All @@ -11,12 +11,8 @@ qt_add_library(AnalyzeView STATIC
LogDownloadController.h
LogEntry.cc
LogEntry.h
MAVLinkChartController.cc
MAVLinkChartController.h
MAVLinkConsoleController.cc
MAVLinkConsoleController.h
MAVLinkInspectorController.cc
MAVLinkInspectorController.h
MAVLinkMessage.cc
MAVLinkMessage.h
MAVLinkMessageField.cc
Expand All @@ -39,7 +35,6 @@ FetchContent_MakeAvailable(ulogparser)

target_link_libraries(AnalyzeView
PRIVATE
Qt6::Charts
Qt6::Gui
Qt6::Qml
ulog_cpp::ulog_cpp
Expand Down Expand Up @@ -79,37 +74,55 @@ target_include_directories(AnalyzeView
# URI QGroundControl.AnalyzeView
# VERSION 1.0
# QML_FILES
# AnalyzePage.qml
# AnalyzeView.qml
# GeoTagPage.qml
# LogDownloadPage.qml
# MAVLinkConsolePage.qml
# MAVLinkInspectorPage.qml
# VibrationPage.qml
# AnalyzePage.qml
# AnalyzeView.qml
# GeoTagPage.qml
# LogDownloadPage.qml
# MAVLinkConsolePage.qml
# MAVLinkInspectorPage.qml
# VibrationPage.qml
# RESOURCES
# FloatingWindow.svg
# GeoTagIcon.svg
# LogDownloadIcon.svg
# MAVLinkConsoleIcon.svg
# MAVLinkInspector.svg
# VibrationPageIcon.png
# FloatingWindow.svg
# GeoTagIcon.svg
# LogDownloadIcon.svg
# MAVLinkConsoleIcon.svg
# MAVLinkInspector.svg
# VibrationPageIcon.png
# OUTPUT_TARGETS AnalyzeView_targets
# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
# IMPORTS
# QtQuick
# QtQuick.Controls
# QtQuick.Dialogs
# QtQuick.Layouts
# QtQuick.Window
# QtCharts
# Qt.labs.qmlmodels
# QGroundControl
# QGroundControl.Palette
# QGroundControl.Controls
# QGroundControl.Controllers
# QGroundControl.FactSystem
# QGroundControl.FactControls
# QGroundControl.ScreenTools
# QtQuick
# QtQuick.Controls
# QtQuick.Dialogs
# QtQuick.Layouts
# QtQuick.Window
# QtCharts
# Qt.labs.qmlmodels
# QGroundControl
# QGroundControl.Palette
# QGroundControl.Controls
# QGroundControl.Controllers
# QGroundControl.FactSystem
# QGroundControl.FactControls
# QGroundControl.ScreenTools
# DEPENDENCIES
# QtCore
# )

find_package(Qt6 REQUIRED OPTIONAL_COMPONENTS Charts)
cmake_dependent_option(QGC_DISABLE_MAVLINK_INSPECTOR "Disable Mavlink Inspector" OFF "Qt6Charts_FOUND" ON) # This removes QtCharts which is GPL licensed
if(NOT QGC_DISABLE_MAVLINK_INSPECTOR)
target_sources(AnalyzeView
PRIVATE
MAVLinkChartController.cc
MAVLinkChartController.h
MAVLinkInspectorController.cc
MAVLinkInspectorController.h
)
target_link_libraries(AnalyzeView
PRIVATE
Qt6::Charts
)
else()
target_compile_definitions(AnalyzeView PUBLIC QGC_DISABLE_MAVLINK_INSPECTOR)
endif()
12 changes: 9 additions & 3 deletions src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#include "APMFlightModesComponent.h"
#include "APMRadioComponent.h"
#include "APMSafetyComponent.h"
#ifndef DISABLE_APMTUNINGCOMPONENT
#include "APMTuningComponent.h"
#endif
#include "APMSensorsComponent.h"
#include "APMPowerComponent.h"
#include "APMMotorComponent.h"
Expand Down Expand Up @@ -121,9 +123,11 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_components.append(QVariant::fromValue((VehicleComponent*)_heliComponent));
}

_tuningComponent = new APMTuningComponent(_vehicle, this);
_tuningComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_tuningComponent));
#ifndef DISABLE_APMTUNINGCOMPONENT
_tuningComponent = new APMTuningComponent(_vehicle, this);
_tuningComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_tuningComponent));
#endif

if(_vehicle->parameterManager()->parameterExists(-1, "MNT1_TYPE")) {
_cameraComponent = new APMCameraComponent(_vehicle, this);
Expand Down Expand Up @@ -181,8 +185,10 @@ QString APMAutoPilotPlugin::prerequisiteSetup(VehicleComponent* component) const
requiresAirframeCheck = true;
} else if (qobject_cast<const APMSafetyComponent*>(component)) {
requiresAirframeCheck = true;
#ifndef DISABLE_APMTUNINGCOMPONENT
} else if (qobject_cast<const APMTuningComponent*>(component)) {
requiresAirframeCheck = true;
#endif
} else if (qobject_cast<const APMSensorsComponent*>(component)) {
requiresAirframeCheck = true;
}
Expand Down
12 changes: 10 additions & 2 deletions src/AutoPilotPlugins/APM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,18 @@ qt_add_library(APMAutoPilotPlugin STATIC
APMSubFrameComponent.h
APMSubMotorComponentController.cc
APMSubMotorComponentController.h
APMTuningComponent.cc
APMTuningComponent.h
)

if(NOT QGC_LGPL_COMPATIBLE)
target_sources(APMAutoPilotPlugin
PRIVATE
APMTuningComponent.cc
APMTuningComponent.h
)
else()
target_compile_definitions(PRIVATE DISABLE_APMTUNINGCOMPONENT)
endif()

target_link_libraries(APMAutoPilotPlugin
PRIVATE
APMFirmwarePlugin
Expand Down
12 changes: 10 additions & 2 deletions src/AutoPilotPlugins/PX4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ qt_add_library(PX4AutoPilotPlugin STATIC
PX4RadioComponent.h
PX4SimpleFlightModesController.cc
PX4SimpleFlightModesController.h
PX4TuningComponent.cc
PX4TuningComponent.h
SafetyComponent.cc
SafetyComponent.h
SensorsComponent.cc
Expand All @@ -37,6 +35,16 @@ qt_add_library(PX4AutoPilotPlugin STATIC
SensorsComponentController.h
)

if(NOT QGC_LGPL_COMPATIBLE)
target_sources(PX4AutoPilotPlugin
PRIVATE
PX4TuningComponent.cc
PX4TuningComponent.h
)
else()
target_compile_definitions(PRIVATE DISABLE_PX4TUNINGCOMPONENT)
endif()

target_link_libraries(PX4AutoPilotPlugin
PRIVATE
Comms
Expand Down
10 changes: 7 additions & 3 deletions src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#include "QGCApplication.h"
#include "FlightModesComponent.h"
#include "PX4RadioComponent.h"
#ifndef DISABLE_PX4TUNINGCOMPONENT
#include "PX4TuningComponent.h"
#endif
#include "PowerComponent.h"
#include "SafetyComponent.h"
#include "SensorsComponent.h"
Expand Down Expand Up @@ -104,9 +106,11 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void)
_safetyComponent->setupTriggerSignals();
_components.append(QVariant::fromValue(static_cast<VehicleComponent*>(_safetyComponent)));

_tuningComponent = new PX4TuningComponent(_vehicle, this, this);
_tuningComponent->setupTriggerSignals();
_components.append(QVariant::fromValue(static_cast<VehicleComponent*>(_tuningComponent)));
#ifndef DISABLE_PX4TUNINGCOMPONENT
_tuningComponent = new PX4TuningComponent(_vehicle, this, this);
_tuningComponent->setupTriggerSignals();
_components.append(QVariant::fromValue(static_cast<VehicleComponent*>(_tuningComponent)));
#endif

if(_vehicle->parameterManager()->parameterExists(_vehicle->id(), "SYS_VEHICLE_RESP")) {
_flightBehavior = new PX4FlightBehavior(_vehicle, this, this);
Expand Down
2 changes: 1 addition & 1 deletion src/GPS/Drivers
8 changes: 4 additions & 4 deletions src/QGCApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
#include "CustomActionManager.h"
#include "AudioOutput.h"
#include "JsonHelper.h"
// #ifdef QGC_VIEWER3D
#ifndef QGC_DISABLE_VIEWER3D
#include "Viewer3DManager.h"
// #endif
#endif
#include "GimbalController.h"
#ifndef NO_SERIAL_LINK
#include "FirmwareUpgradeController.h"
Expand Down Expand Up @@ -339,9 +339,9 @@ void QGCApplication::init()
qmlRegisterSingletonType<ScreenToolsController> ("QGroundControl.ScreenToolsController", 1, 0, "ScreenToolsController", screenToolsControllerSingletonFactory);


// #ifdef QGC_VIEWER3D
#ifndef QGC_DISABLE_VIEWER3D
Viewer3DManager::registerQmlTypes();
// #endif
#endif

qmlRegisterUncreatableType<Autotune> ("QGroundControl.Vehicle", 1, 0, "Autotune", "Reference only");
qmlRegisterUncreatableType<RemoteIDManager> ("QGroundControl.Vehicle", 1, 0, "RemoteIDManager", "Reference only");
Expand Down
78 changes: 39 additions & 39 deletions src/Viewer3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ find_package(Qt6 REQUIRED COMPONENTS Core)

qt_add_library(Viewer3D STATIC)

find_package(Qt6 COMPONENTS Quick3D)
cmake_dependent_option(QGC_VIEWER3D "Enable Viewer3D" ON "Qt6Quick3D_FOUND" OFF)
if(QGC_VIEWER3D)
find_package(Qt6 COMPONENTS OPTIONAL_COMPONENTS Quick3D)
cmake_dependent_option(QGC_DISABLE_VIEWER3D "Disable Viewer3D" OFF "Qt6Quick3D_FOUND" ON) # This removes QtQuick3D which is GPL licensed
if(NOT QGC_DISABLE_VIEWER3D)
message(STATUS "Viewer3D is Initialized")

find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Positioning Qml Quick3D Xml)
Expand Down Expand Up @@ -51,42 +51,42 @@ if(QGC_VIEWER3D)
)

target_include_directories(Viewer3D PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
else()
target_compile_definitions(Viewer3D PUBLIC QGC_DISABLE_VIEWER3D)
endif()

target_compile_definitions(Viewer3D PUBLIC QGC_VIEWER3D)

# file(GLOB_RECURSE QML_SOURCES RELATIVE Viewer3DQml Viewer3DQml/*.qml)
# file(GLOB_RECURSE QML_RESOURCES RELATIVE Viewer3DQml Viewer3DQml/*.mesh)
# qt_add_qml_module(Viewer3D
# URI QGroundControl.Viewer3D
# VERSION 1.0
# QML_FILES ${QML_SOURCES}
# OUTPUT_TARGETS Viewer3D_targets
# RESOURCES
# Images/city_3d_map_icon.svg
# SampleOsmMap/map_sim_small.osm
# Shaders/earthMaterial.frag
# Shaders/earthMaterial.vert
# ${QML_RESOURCES}
# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
# IMPORTS
# QtQuick
# QtQuick.Controls
# QtQuick.Dialogs
# QtQuick.Layouts
# QtQuick3D
# QtPositioning
# file(GLOB_RECURSE QML_SOURCES RELATIVE Viewer3DQml Viewer3DQml/*.qml)
# file(GLOB_RECURSE QML_RESOURCES RELATIVE Viewer3DQml Viewer3DQml/*.mesh)
# qt_add_qml_module(Viewer3D
# URI QGroundControl.Viewer3D
# VERSION 1.0
# QML_FILES ${QML_SOURCES}
# OUTPUT_TARGETS Viewer3D_targets
# RESOURCES
# Images/city_3d_map_icon.svg
# SampleOsmMap/map_sim_small.osm
# Shaders/earthMaterial.frag
# Shaders/earthMaterial.vert
# ${QML_RESOURCES}
# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
# IMPORTS
# QtQuick
# QtQuick.Controls
# QtQuick.Dialogs
# QtQuick.Layouts
# QtQuick3D
# QtPositioning

# QGroundControl
# QGroundControl.Controls
# QGroundControl.Controllers
# QGroundControl.FactSystem
# QGroundControl.FlightDisplay
# QGroundControl.FlightMap
# QGroundControl.Palette
# QGroundControl.ScreenTools
# QGroundControl.Vehicle
# QGroundControl
# QGroundControl.Controls
# QGroundControl.Controllers
# QGroundControl.FactSystem
# QGroundControl.FlightDisplay
# QGroundControl.FlightMap
# QGroundControl.Palette
# QGroundControl.ScreenTools
# QGroundControl.Vehicle

# QGroundControl.Viewer3D
# Viewer3D.Models3D
# )
endif()
# QGroundControl.Viewer3D
# Viewer3D.Models3D
# )

0 comments on commit 3734b7f

Please sign in to comment.