From 223e3dcd48704442fbcdcb3503214179aabe4b86 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 26 Oct 2018 09:02:46 -0400 Subject: [PATCH] cmake testing updates --- CMakeLists.txt | 28 +++++++++++++++---------- qgroundcontrol.qrc | 22 +++++++++---------- src/Audio/CMakeLists.txt | 4 ++++ src/CMakeLists.txt | 4 ---- src/FirmwarePlugin/APM/APMResources.qrc | 2 +- src/FirmwarePlugin/CMakeLists.txt | 18 +++++++--------- 6 files changed, 41 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa13afedf..a160c5222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,21 +180,27 @@ include_directories( add_subdirectory(libs) add_subdirectory(src) +set(QGC_RESOURCES + #HackAndroidFileDialog.qrc + HackFileDialog.qrc + qgcresources.qrc + qgroundcontrol.qrc + ) + +if(BUILD_TESTING) + list(APPEND QGC_RESOURCES + UnitTest.qrc + ) +endif() + if(ANDROID) - add_library(QGroundControl SHARED) + add_library(QGroundControl SHARED ${QGC_RESOURCES}) else() - add_executable(QGroundControl - #HackAndroidFileDialog.qrc - HackFileDialog.qrc - qgcresources.qrc - qgroundcontrol.qrc -) + add_executable(QGroundControl ${QGC_RESOURCES} + ) endif() -target_link_libraries(QGroundControl - PUBLIC - qgc -) +target_link_libraries(QGroundControl PUBLIC qgc) if(NOT QT_MKSPEC MATCHES "winrt") target_link_libraries(QGroundControl diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index cf4f3bf54..b1c28a175 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -87,12 +87,12 @@ src/QmlControls/PageView.qml src/QmlControls/ParameterEditor.qml src/QmlControls/ParameterEditorDialog.qml - src/QmlControls/PIDTuning.qml + src/QmlControls/PIDTuning.qml src/PlanView/PlanToolBar.qml - src/QmlControls/PreFlightCheckButton.qml - src/QmlControls/PreFlightCheckGroup.qml - src/QmlControls/PreFlightCheckList.qml - src/QmlControls/PreFlightCheckModel.qml + src/QmlControls/PreFlightCheckButton.qml + src/QmlControls/PreFlightCheckGroup.qml + src/QmlControls/PreFlightCheckList.qml + src/QmlControls/PreFlightCheckModel.qml src/QmlControls/QGCButton.qml src/QmlControls/QGCCheckBox.qml src/QmlControls/QGCColoredImage.qml @@ -156,12 +156,12 @@ src/FlightDisplay/GuidedActionsController.qml src/FlightDisplay/GuidedAltitudeSlider.qml src/FlightDisplay/MultiVehicleList.qml - src/FlightDisplay/PreFlightBatteryCheck.qml - src/FlightDisplay/BuiltInPreFlightCheckModel.qml - src/FlightDisplay/PreFlightGPSCheck.qml - src/FlightDisplay/PreFlightRCCheck.qml - src/FlightDisplay/PreFlightSensorsHealthCheck.qml - src/FlightDisplay/PreFlightSoundCheck.qml + src/FlightDisplay/PreFlightBatteryCheck.qml + src/FlightDisplay/BuiltInPreFlightCheckModel.qml + src/FlightDisplay/PreFlightGPSCheck.qml + src/FlightDisplay/PreFlightRCCheck.qml + src/FlightDisplay/PreFlightSensorsHealthCheck.qml + src/FlightDisplay/PreFlightSoundCheck.qml src/FlightDisplay/qmldir src/FlightMap/MapItems/CameraTriggerIndicator.qml src/FlightMap/Widgets/CenterMapDropButton.qml diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index a6d659963..973b1c9b4 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -23,3 +23,7 @@ target_link_libraries(Audio target_include_directories(Audio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +if(BUILD_TESTING) + add_qgc_test(AudioOutputTest) +endif() + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 755024446..19c808bbd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,7 +31,6 @@ if(BUILD_TESTING) add_subdirectory(qgcunittest) - add_qgc_test(AudioOutputTest) add_qgc_test(CameraCalcTest) add_qgc_test(CameraSectionTest) add_qgc_test(CorridorScanComplexItemTest) @@ -62,9 +61,6 @@ if(BUILD_TESTING) add_qgc_test(TCPLinkTest) add_qgc_test(TransectStyleComplexItemTest) - list(APPEND QGC_RESOURCES - UnitTest.qrc - ) endif() add_library(qgc diff --git a/src/FirmwarePlugin/APM/APMResources.qrc b/src/FirmwarePlugin/APM/APMResources.qrc index 19da1d9da..b5e6a40e6 100644 --- a/src/FirmwarePlugin/APM/APMResources.qrc +++ b/src/FirmwarePlugin/APM/APMResources.qrc @@ -50,7 +50,7 @@ APMParameterFactMetaData.Copter.3.6.xml APMParameterFactMetaData.Rover.3.0.xml APMParameterFactMetaData.Rover.3.2.xml - APMParameterFactMetaData.Rover.3.4.xml + APMParameterFactMetaData.Rover.3.4.xml APMParameterFactMetaData.Sub.3.4.xml APMParameterFactMetaData.Sub.3.5.xml APMParameterFactMetaData.Sub.3.6dev.xml diff --git a/src/FirmwarePlugin/CMakeLists.txt b/src/FirmwarePlugin/CMakeLists.txt index d77269871..15d11e2cc 100644 --- a/src/FirmwarePlugin/CMakeLists.txt +++ b/src/FirmwarePlugin/CMakeLists.txt @@ -1,5 +1,9 @@ add_library(FirmwarePlugin + CameraMetaData.cc + FirmwarePlugin.cc + FirmwarePluginManager.cc + APM/APMFirmwarePlugin.cc APM/APMFirmwarePluginFactory.cc APM/APMParameterMetaData.cc @@ -7,28 +11,22 @@ add_library(FirmwarePlugin APM/ArduPlaneFirmwarePlugin.cc APM/ArduRoverFirmwarePlugin.cc APM/ArduSubFirmwarePlugin.cc - - CameraMetaData.cc - FirmwarePlugin.cc - FirmwarePluginManager.cc + APM/APMResources.qrc PX4/PX4FirmwarePlugin.cc PX4/PX4FirmwarePluginFactory.cc PX4/PX4ParameterMetaData.cc - - # Resources - APM/APMResources.qrc PX4/PX4Resources.qrc ) target_link_libraries(FirmwarePlugin - PUBLIC + PRIVATE qgc ) target_include_directories(FirmwarePlugin - PUBLIC + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - APM + APM ) -- 2.22.0