diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 35aedd67ef1..bff5653d5e4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -96,7 +96,6 @@ jobs: run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - -DQGC_BUILD_TESTING=${{ matrix.BuildType == 'Debug' && 'ON' || 'OFF' }} -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index f38f40ceefe..d6cfac2be1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22.1) +cmake_minimum_required(VERSION 3.24) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake @@ -202,7 +202,7 @@ find_package(Qt6 ) if(LINUX) - find_package(Qt6::WaylandClient ${QT_MINIMUM_VERSION}) + find_package(Qt6 ${QT_MINIMUM_VERSION} COMPONENTS WaylandClient) endif() if(NOT Qt6LinguistTools_DIR) @@ -223,8 +223,6 @@ qt_policy( SET QTP0005 NEW ) -# QT_TARGETS_FOLDER - ####################################################### # QGroundControl Options ####################################################### diff --git a/cmake/CustomOptions.cmake b/cmake/CustomOptions.cmake index 8fc1a492fc4..f4408efbdd9 100644 --- a/cmake/CustomOptions.cmake +++ b/cmake/CustomOptions.cmake @@ -9,6 +9,7 @@ set(QGC_ORG_NAME "QGroundControl.org" CACHE STRING "Org Name") set(QGC_ORG_DOMAIN "org.qgroundcontrol" CACHE STRING "Domain") option(QGC_STABLE_BUILD "Stable Build" OFF) +option(QGC_DOWNLOAD_DEPENDENCIES "Download Dependencies if Possible" ON) option(QGC_ENABLE_BLUETOOTH "Enable Bluetooth Links" ON) # Qt6Bluetooth_FOUND option(QGC_ZEROCONF_ENABLED "Enable ZeroConf Compatibility" OFF) diff --git a/cmake/find-modules/FindGStreamer.cmake b/cmake/find-modules/FindGStreamer.cmake index a06e496285a..3f000ac404e 100644 --- a/cmake/find-modules/FindGStreamer.cmake +++ b/cmake/find-modules/FindGStreamer.cmake @@ -69,6 +69,7 @@ elseif(IOS) set(GSTREAMER_PREFIX_IOS "~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework") else() FetchContent_Declare(gstreamer + DOWNLOAD_EXTRACT_TIMESTAMP true URL "https://gstreamer.freedesktop.org/data/pkg/ios/${QGC_GST_TARGET_VERSION}/gstreamer-1.0-devel-${QGC_GST_TARGET_VERSION}-ios-universal.pkg" ) FetchContent_MakeAvailable(gstreamer) diff --git a/cmake/find-modules/FindGeographicLib.cmake b/cmake/find-modules/_FindGeographicLib.cmake similarity index 100% rename from cmake/find-modules/FindGeographicLib.cmake rename to cmake/find-modules/_FindGeographicLib.cmake diff --git a/src/AnalyzeView/CMakeLists.txt b/src/AnalyzeView/CMakeLists.txt index e1e73b3aaa9..8cfad64137a 100644 --- a/src/AnalyzeView/CMakeLists.txt +++ b/src/AnalyzeView/CMakeLists.txt @@ -1,6 +1,8 @@ find_package(Qt6 REQUIRED COMPONENTS Core Charts Gui Qml QmlIntegration) qt_add_library(AnalyzeView STATIC + ExifParser.cc + ExifParser.h GeoTagController.cc GeoTagController.h GeoTagWorker.cc @@ -23,6 +25,8 @@ qt_add_library(AnalyzeView STATIC MAVLinkSystem.h PX4LogParser.cc PX4LogParser.h + ULogParser.cc + ULogParser.h ) target_link_libraries(AnalyzeView @@ -49,98 +53,6 @@ target_precompile_headers(AnalyzeView ) -#===========================================================================# - -include(FetchContent) -FetchContent_Declare(ulogparser - GIT_REPOSITORY https://github.com/PX4/ulog_cpp.git - GIT_TAG main - GIT_SHALLOW TRUE -) -FetchContent_MakeAvailable(ulogparser) -if(TARGET ulog_cpp::ulog_cpp) - target_link_libraries(AnalyzeView PRIVATE ulog_cpp::ulog_cpp) - target_sources(AnalyzeView PRIVATE ULogParser.cc ULogParser.h) -endif() - -#===========================================================================# - -set(MINIMUM_EXIV2_VERSION 0.28.2) - -if(NOT QGC_BUILD_DEPENDENCIES) - find_package(LibExiv2 ${MINIMUM_EXIV2_VERSION}) - if(LibExiv2_FOUND AND TARGET LibExiv2::LibExiv2) - target_link_libraries(AnalyzeView PRIVATE LibExiv2::LibExiv2) - else() - find_package(exiv2 ${MINIMUM_EXIV2_VERSION} CONFIG NAMES exiv2) - if(exiv2_FOUND) - target_link_libraries(AnalyzeView PRIVATE Exiv2::exiv2lib) - endif() - endif() -endif() - -if(NOT exiv2_FOUND AND NOT LibExiv2_FOUND) - message(STATUS "Building Exiv2") - - include(FetchContent) - - # TODO: XMP Compatibility - # FetchContent_Declare(EXPAT - # GIT_REPOSITORY https://github.com/libexpat/libexpat.git - # GIT_TAG R_2_6_3 - # GIT_SHALLOW TRUE - # GIT_PROGRESS TRUE - # SOURCE_SUBDIR expat - # ) - # set(EXPAT_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE) - # set(EXPAT_BUILD_TESTS OFF CACHE INTERNAL "" FORCE) - # set(EXPAT_BUILD_TOOLS OFF CACHE INTERNAL "" FORCE) - # FetchContent_MakeAvailable(EXPAT) - - # find_package(Iconv) - # if(ICONV_FOUND) - # target_link_libraries(AnalyzeView PRIVATE Iconv::Iconv) - # endif() - - FetchContent_Declare(EXIV2 - GIT_REPOSITORY https://github.com/Exiv2/exiv2.git - GIT_TAG v0.28.3 - GIT_SHALLOW TRUE - ) - set(EXIV2_ENABLE_XMP OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_EXTERNAL_XMP OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_PNG OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_NLS OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_LENSDATA OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_DYNAMIC_RUNTIME OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_WEBREADY OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_CURL OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_BMFF OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_BROTLI OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_VIDEO OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_INIH OFF CACHE INTERNAL "" FORCE) - set(EXIV2_ENABLE_FILESYSTEM_ACCESS ON CACHE INTERNAL "" FORCE) - set(EXIV2_BUILD_SAMPLES OFF CACHE INTERNAL "" FORCE) - set(EXIV2_BUILD_EXIV2_COMMAND OFF CACHE INTERNAL "" FORCE) - set(EXIV2_BUILD_UNIT_TESTS OFF CACHE INTERNAL "" FORCE) - set(EXIV2_BUILD_FUZZ_TESTS OFF CACHE INTERNAL "" FORCE) - set(EXIV2_BUILD_DOC OFF CACHE INTERNAL "" FORCE) - set(BUILD_WITH_CCACHE ON CACHE INTERNAL "" FORCE) - FetchContent_MakeAvailable(EXIV2) - - target_link_libraries(AnalyzeView PRIVATE Exiv2::exiv2lib) - target_include_directories(AnalyzeView - PRIVATE - ${CMAKE_BINARY_DIR} - ${exiv2_SOURCE_DIR}/include - ${exiv2_SOURCE_DIR}/include/exiv2 - ) -endif() - -target_sources(AnalyzeView PRIVATE ExifParser.cc ExifParser.h) - -#===========================================================================# - # qt_add_qml_module(AnalyzeView # URI QGroundControl.AnalyzeView # VERSION 1.0 @@ -179,3 +91,112 @@ target_sources(AnalyzeView PRIVATE ExifParser.cc ExifParser.h) # DEPENDENCIES # QtCore # ) + +#===========================================================================# + +message(STATUS "Building ULogParser") +FetchContent_Declare(ulogparser + GIT_REPOSITORY https://github.com/PX4/ulog_cpp.git + GIT_TAG main + GIT_SHALLOW TRUE +) +FetchContent_MakeAvailable(ulogparser) +if(TARGET ulog_cpp::ulog_cpp) + target_link_libraries(AnalyzeView PRIVATE ulog_cpp::ulog_cpp) +endif() + +#===========================================================================# + +set(MINIMUM_EXIV2_VERSION 0.28.0) +set(TARGET_EXIV2_VERSION 0.28.3) + +set(MINIMUM_EXPAT_VERSION 2.2.6) +set(TARGET_EXPAT_VERSION 2.6.4) + +# if(QGC_DOWNLOAD_DEPENDENCIES) +# set(EXIV2_URL) +# if(MSVC) +# set(EXIV2_URL "https://github.com/Exiv2/exiv2/releases/download/v${TARGET_EXIV2_VERSION}/exiv2-${TARGET_EXIV2_VERSION}-2019msvc64.zip") +# elseif(LINUX) +# set(EXIV2_URL "https://github.com/Exiv2/exiv2/releases/download/v${TARGET_EXIV2_VERSION}/exiv2-${TARGET_EXIV2_VERSION}-Linux64.tar.gz") +# elseif(MACOS) +# set(EXIV2_URL "https://github.com/Exiv2/exiv2/releases/download/v${TARGET_EXIV2_VERSION}/exiv2-${TARGET_EXIV2_VERSION}-Darwin.tar.gz") +# endif() + +# if(EXIV2_URL) +# FetchContent_Declare(exiv2 +# DOWNLOAD_EXTRACT_TIMESTAMP true +# URL ${EXIV2_URL} +# ) +# FetchContent_MakeAvailable(exiv2) + +# # exiv2_SOURCE_DIR +# # target_link_libraries(AnalyzeView PRIVATE Exiv2::exiv2lib) +# return() +# endif() +# endif() + +if(NOT QGC_BUILD_DEPENDENCIES) + find_package(exiv2 ${MINIMUM_EXIV2_VERSION}) + if(TARGET Exiv2::exiv2lib) + target_link_libraries(AnalyzeView PRIVATE Exiv2::exiv2lib) + return() + endif() +endif() + +find_package(EXPAT ${MINIMUM_EXPAT_VERSION}) +if(NOT TARGET EXPAT::EXPAT) + message(STATUS "Building Expat") + FetchContent_Declare(expat + GIT_REPOSITORY https://github.com/libexpat/libexpat.git + GIT_TAG R_2_6_4 + GIT_SHALLOW TRUE + SOURCE_SUBDIR expat + ) + set(EXPAT_BUILD_DOCS OFF CACHE INTERNAL "" FORCE) + set(EXPAT_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE) + set(EXPAT_BUILD_FUZZERS OFF CACHE INTERNAL "" FORCE) + set(EXPAT_BUILD_PKGCONFIG OFF CACHE INTERNAL "" FORCE) + set(EXPAT_BUILD_TESTS OFF CACHE INTERNAL "" FORCE) + set(EXPAT_BUILD_TOOLS OFF CACHE INTERNAL "" FORCE) + set(EXPAT_ENABLE_INSTALL OFF CACHE INTERNAL "" FORCE) + set(EXPAT_SHARED_LIBS OFF CACHE INTERNAL "" FORCE) + FetchContent_MakeAvailable(expat) +endif() + +message(STATUS "Building Exiv2") +FetchContent_Declare(exiv2 + GIT_REPOSITORY https://github.com/Exiv2/exiv2.git + GIT_TAG "v${TARGET_EXIV2_VERSION}" + GIT_SHALLOW TRUE +) +if(TARGET EXPAT::EXPAT) + set(EXIV2_ENABLE_XMP ON CACHE INTERNAL "" FORCE) +else() + set(EXIV2_ENABLE_XMP OFF CACHE INTERNAL "" FORCE) +endif() +set(EXIV2_ENABLE_EXTERNAL_XMP OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_PNG OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_NLS OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_LENSDATA OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_DYNAMIC_RUNTIME OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_WEBREADY OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_CURL OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_BMFF OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_BROTLI OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_VIDEO OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_INIH OFF CACHE INTERNAL "" FORCE) +set(EXIV2_ENABLE_FILESYSTEM_ACCESS ON CACHE INTERNAL "" FORCE) +set(EXIV2_BUILD_SAMPLES OFF CACHE INTERNAL "" FORCE) +set(EXIV2_BUILD_EXIV2_COMMAND OFF CACHE INTERNAL "" FORCE) +set(EXIV2_BUILD_UNIT_TESTS OFF CACHE INTERNAL "" FORCE) +set(EXIV2_BUILD_FUZZ_TESTS OFF CACHE INTERNAL "" FORCE) +set(EXIV2_BUILD_DOC OFF CACHE INTERNAL "" FORCE) +set(BUILD_WITH_CCACHE ON CACHE INTERNAL "" FORCE) +FetchContent_MakeAvailable(exiv2) + +if(TARGET Exiv2::exiv2lib) + target_link_libraries(AnalyzeView PRIVATE Exiv2::exiv2lib) + target_include_directories(AnalyzeView PRIVATE ${CMAKE_BINARY_DIR}) + return() +endif() diff --git a/src/Comms/CMakeLists.txt b/src/Comms/CMakeLists.txt index d647405df33..9085acc6ed5 100644 --- a/src/Comms/CMakeLists.txt +++ b/src/Comms/CMakeLists.txt @@ -99,15 +99,15 @@ endif() ############# ZEROConf if(QGC_ZEROCONF_ENABLED) - set(BUILD_DOC OFF CACHE INTERNAL "") - set(BUILD_EXAMPLES OFF CACHE INTERNAL "") - set(BUILD_TESTS OFF CACHE INTERNAL "") - - include(FetchContent) + message(STATUS "Building QMDNSEngine") FetchContent_Declare(qmdnsengine GIT_REPOSITORY https://github.com/nitroshare/qmdnsengine.git - GIT_TAG 4e54bc86c8ed2d4fa2e7449d4ba6a6a2742d9eb1 + GIT_TAG master + GIT_SHALLOW TRUE ) + set(BUILD_DOC OFF CACHE INTERNAL "") + set(BUILD_EXAMPLES OFF CACHE INTERNAL "") + set(BUILD_TESTS OFF CACHE INTERNAL "") FetchContent_MakeAvailable(qmdnsengine) target_link_libraries(Comms PUBLIC qmdnsengine) diff --git a/src/FirmwarePlugin/APM/CMakeLists.txt b/src/FirmwarePlugin/APM/CMakeLists.txt index 63f63aab0ec..5f04a8a980f 100644 --- a/src/FirmwarePlugin/APM/CMakeLists.txt +++ b/src/FirmwarePlugin/APM/CMakeLists.txt @@ -42,6 +42,14 @@ target_link_libraries(APMFirmwarePlugin target_include_directories(APMFirmwarePlugin PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +message(STATUS "Fetching ArduPilot Parameters") +FetchContent_Declare(ArduPilotParams + GIT_REPOSITORY https://github.com/ArduPilot/ParameterRepository.git + GIT_TAG main + GIT_SHALLOW TRUE +) +FetchContent_MakeAvailable(ArduPilotParams) + # file(GLOB QML_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.qml) # # file(GLOB QML_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/res/*/*.*) # qt_add_qml_module(APMFirmwarePlugin diff --git a/src/GPS/CMakeLists.txt b/src/GPS/CMakeLists.txt index a95e2ccda6e..273e19c3275 100644 --- a/src/GPS/CMakeLists.txt +++ b/src/GPS/CMakeLists.txt @@ -6,7 +6,7 @@ if(QGC_NO_SERIAL_LINK) return() endif() -include(FetchContent) +message(STATUS "Building GPS Drivers") FetchContent_Declare(PX4-GPSDrivers GIT_REPOSITORY https://github.com/PX4/PX4-GPSDrivers.git GIT_TAG main diff --git a/src/Geo/CMakeLists.txt b/src/Geo/CMakeLists.txt index ceb843681ab..a3d8ba8a0e3 100644 --- a/src/Geo/CMakeLists.txt +++ b/src/Geo/CMakeLists.txt @@ -15,40 +15,38 @@ target_link_libraries(Geo target_include_directories(Geo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +#===========================================================================# + set(MINIMUM_GEOGRAPHICLIB_VERSION 2.3) +set(TARGET_GEOGRAPHICLIB_VERSION 2.5) if(NOT QGC_BUILD_DEPENDENCIES) + if(LINUX) + list(APPEND CMAKE_MODULE_PATH "/usr/share/cmake/geographiclib") + endif() find_package(GeographicLib ${MINIMUM_GEOGRAPHICLIB_VERSION} COMPONENTS STATIC) - if(GeographicLib_FOUND) - message(STATUS "Found GeographicLib") + if(TARGET GeographicLib::GeographicLib) + target_link_libraries(Geo PRIVATE GeographicLib::GeographicLib) + return() + elseif(GeographicLib_FOUND) target_link_libraries(Geo PRIVATE ${GeographicLib_LIBRARIES}) target_include_directories(Geo PRIVATE ${GeographicLib_INCLUDE_DIRS}) target_link_directories(Geo PRIVATE ${GeographicLib_LIBRARY_DIRS}) - cmake_print_variables(GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS GeographicLib_LIBRARY_DIRS) return() - else() - find_package(PkgConfig) - if(PkgConfig_FOUND) - pkg_check_modules(GeographicLib IMPORTED_TARGET GeographicLib>=${MINIMUM_GEOGRAPHICLIB_VERSION}) - if(GeographicLib_FOUND) - message(STATUS "Found GeographicLib ${GeographicLib_VERSION}") - target_link_libraries(Geo PRIVATE PkgConfig::GeographicLib) - return() - endif() - endif() endif() endif() message(STATUS "Building GeographicLib") -include(FetchContent) FetchContent_Declare(GeographicLib GIT_REPOSITORY https://github.com/geographiclib/geographiclib.git - GIT_TAG r2.5 + GIT_TAG "r${TARGET_GEOGRAPHICLIB_VERSION}" GIT_SHALLOW TRUE ) set(BUILD_BOTH_LIBS OFF CACHE INTERNAL "" FORCE) set(BUILD_DOCUMENTATION OFF CACHE INTERNAL "" FORCE) set(BUILD_MANPAGES OFF CACHE INTERNAL "" FORCE) +set(PACKAGE_DEBUG_LIBS OFF CACHE INTERNAL "" FORCE) +set(APPLE_MULTIPLE_ARCHITECTURES OFF CACHE INTERNAL "" FORCE) set(INCDIR "" CACHE INTERNAL "" FORCE) set(BINDIR "" CACHE INTERNAL "" FORCE) set(SBINDIR "" CACHE INTERNAL "" FORCE) @@ -60,4 +58,8 @@ set(PKGDIR "" CACHE INTERNAL "" FORCE) set(DOCDIR "" CACHE INTERNAL "" FORCE) set(EXAMPLEDIR "" CACHE INTERNAL "" FORCE) FetchContent_MakeAvailable(GeographicLib) -target_link_libraries(Geo PRIVATE GeographicLib::GeographicLib) + +if(TARGET GeographicLib::GeographicLib) + target_link_libraries(Geo PRIVATE GeographicLib::GeographicLib) + return() +endif() diff --git a/src/Joystick/CMakeLists.txt b/src/Joystick/CMakeLists.txt index 2234011860e..9c5a163f920 100644 --- a/src/Joystick/CMakeLists.txt +++ b/src/Joystick/CMakeLists.txt @@ -42,6 +42,14 @@ target_sources(Joystick target_compile_definitions(Joystick PRIVATE QGC_SDL_JOYSTICK SDL_MAIN_HANDLED) +# qt_add_qml_module(Joystick +# URI QGroundControl.JoystickManager +# VERSION 1.0 +# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} +# ) + +#===========================================================================# + FetchContent_Declare(SDL_GameControllerDB GIT_REPOSITORY https://github.com/mdqinc/SDL_GameControllerDB.git GIT_TAG master @@ -59,39 +67,24 @@ qt_add_resources(Joystick "gamecontrollerdb.txt" FILES ${sdl_gamecontrollerdb_SOURCE_DIR}/gamecontrollerdb.txt ) -# qt_add_qml_module(Joystick -# URI QGroundControl.JoystickManager -# VERSION 1.0 -# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} -# ) +#===========================================================================# set(MINIMUM_SDL2_VERSION 2.24.0) +set(TARGET_SDL2_VERSION 2.30.11) + if(NOT QGC_BUILD_DEPENDENCIES) find_package(SDL2 ${MINIMUM_SDL2_VERSION}) if(TARGET SDL2::SDL2) - message(STATUS "Found JoystickSDL ${SDL2_VERSION_STRING}") - target_link_libraries(Joystick PRIVATE SDL2::Core) + target_link_libraries(Joystick PRIVATE SDL2::SDL2) return() - else() - find_package(PkgConfig) - if(PkgConfig_FOUND) - pkg_check_modules(SDL2 IMPORTED_TARGET sdl2>=${MINIMUM_SDL2_VERSION}) - if(TARGET PkgConfig::SDL2) - message(STATUS "Found JoystickSDL ${SDL2_VERSION}") - target_link_libraries(Joystick PRIVATE PkgConfig::SDL2) - return() - endif() - endif() endif() endif() -message(STATUS "Building JoystickSDL") -include(FetchContent) +message(STATUS "Building SDL") FetchContent_Declare(SDL GIT_REPOSITORY https://github.com/libsdl-org/SDL.git - GIT_TAG release-2.30.10 + GIT_TAG "release-${TARGET_SDL2_VERSION}" GIT_SHALLOW TRUE - GIT_PROGRESS TRUE ) set(SDL2_DISABLE_INSTALL ON CACHE INTERNAL "" FORCE) set(SDL2_DISABLE_UNINSTALL ON CACHE INTERNAL "" FORCE) @@ -127,7 +120,11 @@ set(SDL_VIRTUAL_JOYSTICK ON CACHE INTERNAL "" FORCE) if(WIN32) set(SDL_DIRECTX OFF CACHE INTERNAL "" FORCE) + set(SDL_XINPUT ON CACHE INTERNAL "" FORCE) endif() FetchContent_MakeAvailable(SDL) -target_link_libraries(Joystick PRIVATE SDL2::SDL2-static) +if(TARGET SDL2::SDL2-static) + target_link_libraries(Joystick PRIVATE SDL2::SDL2-static) + return() +endif() diff --git a/src/MAVLink/CMakeLists.txt b/src/MAVLink/CMakeLists.txt index 64435de9627..1e1fbcd9957 100644 --- a/src/MAVLink/CMakeLists.txt +++ b/src/MAVLink/CMakeLists.txt @@ -33,8 +33,6 @@ target_include_directories(MAVLink PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) ############# MAVLink -include(FetchContent) - # TODO: # FetchContent_Declare(mavlink # GIT_REPOSITORY https://github.com/mavlink/mavlink.git @@ -45,6 +43,7 @@ include(FetchContent) # set(MAVLINK_VERSION 2.0) # FetchContent_MakeAvailable(mavlink) +message(STATUS "Building MAVLink") FetchContent_Declare(mavlink GIT_REPOSITORY ${QGC_MAVLINK_GIT_REPO} GIT_TAG ${QGC_MAVLINK_GIT_TAG} diff --git a/src/MAVLink/LibEvents/CMakeLists.txt b/src/MAVLink/LibEvents/CMakeLists.txt index 199a8d99ec4..347715012dc 100644 --- a/src/MAVLink/LibEvents/CMakeLists.txt +++ b/src/MAVLink/LibEvents/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(Qt6 REQUIRED COMPONENTS Core) -include(FetchContent) +message(STATUS "Building libevents") FetchContent_Declare(libevents GIT_REPOSITORY https://github.com/mavlink/libevents.git GIT_TAG main diff --git a/src/UTMSP/CMakeLists.txt b/src/UTMSP/CMakeLists.txt index c4649f4f949..1957daba673 100644 --- a/src/UTMSP/CMakeLists.txt +++ b/src/UTMSP/CMakeLists.txt @@ -7,8 +7,6 @@ if(QGC_UTM_ADAPTER) message(STATUS "UTMSP is Initialized") # if(NOT TARGET nlohmann_json) - # message(STATUS "UTMSP: Fetching nlohmann/json") - # include(FetchContent) # FetchContent_Declare(json # GIT_REPOSITORY https://github.com/nlohmann/json.git # GIT_TAG v3.11.3 diff --git a/src/Utilities/CMakeLists.txt b/src/Utilities/CMakeLists.txt index b79b88015be..679e721c924 100644 --- a/src/Utilities/CMakeLists.txt +++ b/src/Utilities/CMakeLists.txt @@ -60,29 +60,33 @@ if(QGC_ENABLE_BLUETOOTH) target_link_libraries(Utilities PRIVATE Qt6::Bluetooth) endif() +#===========================================================================# + set(MINIMUM_SHAPELIB_VERSION 1.6.0) +set(TARGET_SHAPELIB_VERSION 1.6.1) if(NOT QGC_BUILD_DEPENDENCIES) find_package(Shapelib ${MINIMUM_SHAPELIB_VERSION}) - if(Shapelib_FOUND) - message(STATUS "Found Shapelib ${Shapelib_VERSION}") + if(TARGET SHAPELIB::shp) target_link_libraries(Utilities PRIVATE SHAPELIB::shp) + return() endif() endif() -if(NOT Shapelib_FOUND) - message(STATUS "Building Shapelib") - include(FetchContent) - FetchContent_Declare(shapelib - GIT_REPOSITORY https://github.com/OSGeo/shapelib.git - GIT_TAG master - GIT_SHALLOW TRUE - ) - set(BUILD_SHAPELIB_CONTRIB OFF CACHE INTERNAL "") - set(BUILD_APPS OFF CACHE INTERNAL "") - set(saved_BUILD_TESTING ${BUILD_TESTING}) - set(BUILD_TESTING OFF CACHE INTERNAL "Disable testing for Shapelib") - FetchContent_MakeAvailable(shapelib) - set(BUILD_TESTING ${saved_BUILD_TESTING} CACHE INTERNAL "Restore BUILD_TESTING") +message(STATUS "Building Shapelib") +FetchContent_Declare(shapelib + GIT_REPOSITORY https://github.com/OSGeo/shapelib.git + GIT_TAG "v${TARGET_SHAPELIB_VERSION}" + GIT_SHALLOW TRUE +) +set(BUILD_SHAPELIB_CONTRIB OFF CACHE INTERNAL "" FORCE) +set(BUILD_APPS OFF CACHE INTERNAL "" FORCE) +set(saved_BUILD_TESTING ${BUILD_TESTING}) +set(BUILD_TESTING OFF CACHE INTERNAL "Disable Testing for Shapelib" FORCE) +FetchContent_MakeAvailable(shapelib) +set(BUILD_TESTING ${saved_BUILD_TESTING} CACHE INTERNAL "Restore BUILD_TESTING from Shapelib" FORCE) + +if(TARGET shp) target_link_libraries(Utilities PRIVATE shp) + return() endif() diff --git a/src/Utilities/Compression/CMakeLists.txt b/src/Utilities/Compression/CMakeLists.txt index b035d83f725..b4f8fac09b0 100644 --- a/src/Utilities/Compression/CMakeLists.txt +++ b/src/Utilities/Compression/CMakeLists.txt @@ -19,56 +19,46 @@ target_link_libraries(Compression target_include_directories(Compression PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -include(FetchContent) +#===========================================================================# -############### ZLIB - -set(MINIMUM_ZLIB_VERSION 1.3) +set(MINIMUM_ZLIB_VERSION 1.2.13) +set(TARGET_ZLIB_VERSION 1.3.1) if(NOT QGC_BUILD_DEPENDENCIES) set(ZLIB_USE_STATIC_LIBS ON) find_package(ZLIB ${MINIMUM_ZLIB_VERSION}) if(TARGET ZLIB::ZLIB) - message(STATUS "Found ZLIB ${ZLIB_VERSION_STRING}") target_link_libraries(Compression PRIVATE ZLIB::ZLIB) - else() - find_package(PkgConfig) - if(PkgConfig_FOUND) - pkg_check_modules(ZLIB IMPORTED_TARGET ZLIB>=${MINIMUM_ZLIB_VERSION}) - if(TARGET PkgConfig::ZLIB) - message(STATUS "Found ZLIB ${ZLIB_VERSION}") - target_link_libraries(Joystick PRIVATE PkgConfig::ZLIB) - endif() - endif() endif() endif() -if(NOT TARGET ZLIB::ZLIB AND NOT TARGET PkgConfig::ZLIB) - set(ZLIB_BUILD_EXAMPLES OFF CACHE INTERNAL "") - set(SKIP_INSTALL_FILES ON CACHE INTERNAL "") - set(SKIP_INSTALL_LIBRARIES ON CACHE INTERNAL "") - set(SKIP_INSTALL_HEADERS ON CACHE INTERNAL "") - set(SKIP_INSTALL_ALL ON CACHE INTERNAL "") - +if(NOT TARGET ZLIB::ZLIB) + message(STATUS "Building ZLIB") FetchContent_Declare(zlib GIT_REPOSITORY https://github.com/madler/zlib.git - GIT_TAG v1.3.1 + GIT_TAG "v${TARGET_ZLIB_VERSION}" GIT_SHALLOW TRUE ) - + set(ZLIB_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE) + set(SKIP_INSTALL_FILES ON CACHE INTERNAL "" FORCE) + set(SKIP_INSTALL_LIBRARIES ON CACHE INTERNAL "" FORCE) + set(SKIP_INSTALL_HEADERS ON CACHE INTERNAL "" FORCE) + set(SKIP_INSTALL_ALL ON CACHE INTERNAL "" FORCE) FetchContent_MakeAvailable(zlib) - target_link_libraries(Compression PRIVATE zlibstatic) + if(TARGET zlibstatic) + target_link_libraries(Compression PRIVATE zlibstatic) + endif() endif() -############### XZ +#===========================================================================# +message(STATUS "Building XZ") FetchContent_Declare(xz-embedded GIT_REPOSITORY https://github.com/tukaani-project/xz-embedded.git - GIT_TAG v2024-04-05 + GIT_TAG v2024-12-30 GIT_SHALLOW TRUE ) - FetchContent_MakeAvailable(xz-embedded) qt_add_library(xz STATIC diff --git a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt index 817fc78349f..a0560146264 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt +++ b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt @@ -108,9 +108,9 @@ endif() if(GStreamer_VERSION VERSION_GREATER_EQUAL 1.22) FetchContent_Declare(gstreamer_good_plugins + DOWNLOAD_EXTRACT_TIMESTAMP true # URL https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/${GST_PLUGINS_VERSION}/gstreamer-${GST_PLUGINS_VERSION}.zip?path=subprojects/gst-plugins-good/ext/qt6 URL https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${GST_PLUGINS_VERSION}.tar.xz - DOWNLOAD_EXTRACT_TIMESTAMP true ) FetchContent_MakeAvailable(gstreamer_good_plugins) set(QGC_GST_QT6_PLUGIN_PATH "${gstreamer_good_plugins_SOURCE_DIR}/ext/qt6") diff --git a/tools/setup/install-dependencies-debian.sh b/tools/setup/install-dependencies-debian.sh index 116798d51da..4909c3fff34 100755 --- a/tools/setup/install-dependencies-debian.sh +++ b/tools/setup/install-dependencies-debian.sh @@ -100,7 +100,8 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libssh-dev \ libxml2-utils \ libz-dev \ - zlib1g-dev + zlib1g-dev \ + libfmt-dev # Speech DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ @@ -114,6 +115,14 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ speech-dispatcher-espeak-ng \ speech-dispatcher-flite +# Joystick +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ + libsdl2-dev + +# Shapelib +DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ + libshp-dev + # DNS # DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install libavahi-compat-libdnssd-dev @@ -155,8 +164,6 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ liborc-0.4-dev \ libpng-dev \ libpulse-dev \ - libsdl2-dev \ - libshp-dev \ libsoup2.4-dev \ libssl-dev \ libtheora-dev \