From 056d25a9c48d9f10cf810782a10cb54c23b31541 Mon Sep 17 00:00:00 2001 From: Holden Date: Fri, 18 Oct 2024 12:31:56 -0400 Subject: [PATCH] CMake: Improve Dependencies --- .github/actions/gstreamer/action.yml | 34 ++-- .github/workflows/linux.yml | 50 ++++++ CMakeLists.txt | 16 +- cmake/find-modules/FindAVFoundation.cmake | 14 ++ cmake/find-modules/FindBlueZ.cmake | 12 ++ cmake/find-modules/FindFFmpeg.cmake | 18 +- cmake/find-modules/FindFlite.cmake | 97 +++++++++++ cmake/find-modules/FindGStreamer.cmake | 134 ++++++++++----- .../FindGeographicLib.cmake | 0 cmake/find-modules/FindLibdrm.cmake | 134 +++++++++++++++ cmake/find-modules/FindLibudev.cmake | 10 ++ cmake/find-modules/FindMMRenderer.cmake | 29 ++++ cmake/find-modules/FindMMRendererCore.cmake | 12 ++ cmake/find-modules/FindPipeWire.cmake | 123 +++++++++++++ cmake/{ => find-modules}/FindSDL2.cmake | 0 cmake/find-modules/FindSpeechDispatcher.cmake | 17 ++ cmake/find-modules/FindWMF.cmake | 52 ++++++ cmake/find-modules/FindWrapPulseAudio.cmake | 37 ++++ cmake/find-modules/FindXRender.cmake | 14 ++ cmake/find-modules/Findgbm.cmake | 125 ++++++++++++++ src/Audio/CMakeLists.txt | 12 ++ src/Joystick/CMakeLists.txt | 4 +- .../VideoReceiver/GStreamer/GStreamer.cc | 4 +- .../GStreamer/gstqml6gl/CMakeLists.txt | 162 +++++++++--------- tools/setup/install-dependencies-debian.sh | 82 +++++---- 25 files changed, 1013 insertions(+), 179 deletions(-) create mode 100644 cmake/find-modules/FindAVFoundation.cmake create mode 100644 cmake/find-modules/FindBlueZ.cmake create mode 100644 cmake/find-modules/FindFlite.cmake rename cmake/{ => find-modules}/FindGeographicLib.cmake (100%) create mode 100644 cmake/find-modules/FindLibdrm.cmake create mode 100644 cmake/find-modules/FindLibudev.cmake create mode 100644 cmake/find-modules/FindMMRenderer.cmake create mode 100644 cmake/find-modules/FindMMRendererCore.cmake create mode 100644 cmake/find-modules/FindPipeWire.cmake rename cmake/{ => find-modules}/FindSDL2.cmake (100%) create mode 100644 cmake/find-modules/FindSpeechDispatcher.cmake create mode 100644 cmake/find-modules/FindWMF.cmake create mode 100644 cmake/find-modules/FindWrapPulseAudio.cmake create mode 100644 cmake/find-modules/FindXRender.cmake create mode 100644 cmake/find-modules/Findgbm.cmake diff --git a/.github/actions/gstreamer/action.yml b/.github/actions/gstreamer/action.yml index 6855f0c73e3..0eb486c6bef 100644 --- a/.github/actions/gstreamer/action.yml +++ b/.github/actions/gstreamer/action.yml @@ -34,30 +34,32 @@ runs: run: meson setup --prefix=${{ inputs.install_directory }} --buildtype=${{ inputs.build_type }} - --wrap_mode=forcefallback - -Dgst-full-libraries=base,video,gl + --wrap-mode=forcefallback + --strip + -Dauto_features=disabled + -Dgst-full-libraries=video,gl -Dgpl=enabled -Dlibav=enabled -Dorc=enabled - -Dbase=enabled - -Dvaapi=enabled -Dqt6=enabled + -Dvaapi=enabled + -Dbase=enabled + -Dgst-plugins-base:app=enabled -Dgst-plugins-base:gl=enabled + -Dgst-plugins-base:gl_api=opengl,gles2 -Dgst-plugins-base:gl_platform=glx,egl -Dgst-plugins-base:gl_winsys=x11,egl,wayland - -Dgst-plugins-base:gl_api=opengl,gles2 - -Dgst-plugins-base:x11=enabled -Dgst-plugins-base:playback=enabled -Dgst-plugins-base:tcp=enabled - -Dgst-plugins-base:app=enabled + -Dgst-plugins-base:x11=enabled -Dgood=enabled - -Dgst-plugins-good:qt6=enabled - -Dgst-plugins-good:qt-x11=enabled - -Dgst-plugins-good:qt-egl=enabled - -Dgst-plugins-good:qt-wayland=enabled - -Dgst-plugins-good:qt-method=auto -Dgst-plugins-good:isomp4=enabled -Dgst-plugins-good:matroska=enabled + -Dgst-plugins-good:qt-egl=enabled + -Dgst-plugins-good:qt-method=auto + -Dgst-plugins-good:qt-wayland=enabled + -Dgst-plugins-good:qt-x11=enabled + -Dgst-plugins-good:qt6=enabled -Dgst-plugins-good:rtp=enabled -Dgst-plugins-good:rtpmanager=enabled -Dgst-plugins-good:rtsp=enabled @@ -66,19 +68,17 @@ runs: -Dgst-plugins-bad:gl=enabled -Dgst-plugins-bad:mpegtsdemux=enabled -Dgst-plugins-bad:rtp=enabled - -Dgst-plugins-bad:videoparsers=enabled -Dgst-plugins-bad:sdp=enabled - -Dgst-plugins-bad:x11=enabled - -Dgst-plugins-bad:wayland=enabled -Dgst-plugins-bad:va=enabled + -Dgst-plugins-bad:videoparsers=enabled + -Dgst-plugins-bad:wayland=enabled + -Dgst-plugins-bad:x11=enabled -Dgst-plugins-bad:x265=enabled -Dugly=enabled -Dgst-plugins-ugly:x264=enabled builddir - # --strip=true # --default-library=static # --prefer_static=true - # -Dauto_features=disabled # -Dgst-full-target-type=static_library # -Dgstreamer:gstreamer-static-full=true shell: bash diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f10476ebb64..1e33d35f8b0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -108,6 +108,56 @@ jobs: uses: blinemedical/setup-gstreamer@v1 with: version: ${{ env.GST_VERSION }} + # gstreamerOptions: | + # --buildtype=release + # --wrap-mode=forcefallback + # --strip + # -Dauto_features=disabled + # -Dbase=enabled + # -Ddoc=disabled + # -Dexamples=disabled + # -Dges=disabled + # -Dgpl=enabled + # -Dgst-examples=disabled + # -Dgtk_doc=disabled + # -Dlibav=enabled + # -Dlibnice=disabled + # -Dnls=disabled + # -Dorc=enabled + # -Dpython=disabled + # -Dqt5=disabled + # -Drtsp_server=disabled + # -Dtests=disabled + # -Dgst-plugins-base:app=enabled + # -Dgst-plugins-base:gl=enabled + # -Dgst-plugins-base:gl_api=opengl,gles2 + # -Dgst-plugins-base:gl_platform=glx,egl + # -Dgst-plugins-base:gl_winsys=x11,egl,wayland + # -Dgst-plugins-base:playback=enabled + # -Dgst-plugins-base:tcp=enabled + # -Dgst-plugins-base:x11=enabled + # -Dgood=enabled + # -Dgst-plugins-good:isomp4=enabled + # -Dgst-plugins-good:matroska=enabled + # -Dgst-plugins-good:qt-egl=enabled + # -Dgst-plugins-good:qt-method=auto + # -Dgst-plugins-good:qt-wayland=enabled + # -Dgst-plugins-good:qt-x11=enabled + # -Dgst-plugins-good:rtp=enabled + # -Dgst-plugins-good:rtpmanager=enabled + # -Dgst-plugins-good:rtsp=enabled + # -Dgst-plugins-good:udp=enabled + # -Dbad=enabled + # -Dgst-plugins-bad:gl=enabled + # -Dgst-plugins-bad:mpegtsdemux=enabled + # -Dgst-plugins-bad:rtp=enabled + # -Dgst-plugins-bad:sdp=enabled + # -Dgst-plugins-bad:videoparsers=enabled + # -Dgst-plugins-bad:wayland=enabled + # -Dgst-plugins-bad:x11=enabled + # -Dgst-plugins-bad:x265=enabled + # -Dugly=enabled + # -Dgst-plugins-ugly:x264=enabled - uses: lukka/get-cmake@latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d14223e75e..3aaabc5be92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,10 +150,6 @@ if(ANDROID) message(STATUS "QT_ANDROID_KEYSTORE_ALIAS $ENV{QT_ANDROID_KEYSTORE_ALIAS}") # QT_ANDROID_KEYSTORE_STORE_PASS, QT_ANDROID_KEYSTORE_KEY_PASS endif() - - if(NOT Qt6LinguistTools_DIR) - set(Qt6LinguistTools_DIR ${QT_HOST_PATH}/lib/cmake/Qt6LinguistTools) - endif() endif() set(QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING ON) @@ -161,19 +157,19 @@ set(QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING ON) find_package(Qt6 REQUIRED COMPONENTS - Bluetooth - Charts Concurrent Core Core5Compat Location Multimedia Network + OpenGL Positioning + Qml + QmlIntegration Quick QuickControls2 QuickWidgets - OpenGL Sensors Sql Svg @@ -182,6 +178,8 @@ find_package(Qt6 Widgets Xml OPTIONAL_COMPONENTS + Bluetooth + Charts LinguistTools MultimediaQuickPrivate Quick3D @@ -191,6 +189,10 @@ find_package(Qt6 ${QT_LIBRARY_HINTS} ) +if(NOT Qt6LinguistTools_DIR) + set(Qt6LinguistTools_DIR ${QT_HOST_PATH}/lib/cmake/Qt6LinguistTools) +endif() + # Require 6.6.3 because otherwise libQt6QuickControls2Basic.so.6 & # libQt6QuickControls2BasicStyleImpl.so.6 are missing. qt_standard_project_setup(REQUIRES 6.6.3) diff --git a/cmake/find-modules/FindAVFoundation.cmake b/cmake/find-modules/FindAVFoundation.cmake new file mode 100644 index 00000000000..3dad5d67745 --- /dev/null +++ b/cmake/find-modules/FindAVFoundation.cmake @@ -0,0 +1,14 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +find_library(AVFoundation_LIBRARY NAMES AVFoundation) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(AVFoundation DEFAULT_MSG AVFoundation_LIBRARY) + +if(AVFoundation_FOUND AND NOT TARGET AVFoundation::AVFoundation) + add_library(AVFoundation::AVFoundation INTERFACE IMPORTED) + set_target_properties(AVFoundation::AVFoundation PROPERTIES + INTERFACE_LINK_LIBRARIES "${AVFoundation_LIBRARY}") +endif() + +mark_as_advanced(AVFoundation_LIBRARY) diff --git a/cmake/find-modules/FindBlueZ.cmake b/cmake/find-modules/FindBlueZ.cmake new file mode 100644 index 00000000000..b1d30122e66 --- /dev/null +++ b/cmake/find-modules/FindBlueZ.cmake @@ -0,0 +1,12 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +set(BlueZ_FOUND 0) + +find_package(PkgConfig QUIET) + +pkg_check_modules(BLUEZ bluez IMPORTED_TARGET) + +if(TARGET PkgConfig::BLUEZ) + set(BlueZ_FOUND 1) +endif() diff --git a/cmake/find-modules/FindFFmpeg.cmake b/cmake/find-modules/FindFFmpeg.cmake index ecf9b07cb16..1cd87badc25 100644 --- a/cmake/find-modules/FindFFmpeg.cmake +++ b/cmake/find-modules/FindFFmpeg.cmake @@ -253,7 +253,11 @@ endfunction() # and adds them to the target library. function(__ffmpeg_internal_set_dependencies _component) string(TOLOWER ${_component} lib) - set(PC_FILE ${${_component}_LIBRARY_DIR}/pkgconfig/lib${lib}.pc) + + # The pkgconfig directory is always in lib/pkgconfig/, even on Windows + # where libs and dlls are in bin/ + set(PC_FILE ${${_component}_LIBRARY_DIR}/../lib/pkgconfig/lib${lib}.pc) + if(EXISTS ${PC_FILE}) file(READ ${PC_FILE} pcfile) @@ -370,8 +374,20 @@ foreach (_component ${FFmpeg_FIND_COMPONENTS}) list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARY ${_component}_INCLUDE_DIR) endforeach () +set(FIND_FFMPEG_HELP_STRING +[=[FFMPEG_DIR CMake variable is not correct. + Make sure that the FFMPEG_DIR CMake variable is set to a path that + contains FFmpeg 'lib' and 'include' directories and that the FFmpeg + installation is built with the avformat, avcodec, swresample, + swscale, and avutil libraries. To resolve the issue, please delete + CMakeCache.txt and run configure again with the correct FFMPEG_DIR + CMake variable set. +]=]) + # Give a nice error message if some of the required vars are missing. find_package_handle_standard_args(FFmpeg REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS} HANDLE_COMPONENTS + REASON_FAILURE_MESSAGE + ${FIND_FFMPEG_HELP_STRING} ) diff --git a/cmake/find-modules/FindFlite.cmake b/cmake/find-modules/FindFlite.cmake new file mode 100644 index 00000000000..ef1f27211c6 --- /dev/null +++ b/cmake/find-modules/FindFlite.cmake @@ -0,0 +1,97 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET Flite::Flite) + set(Flite_FOUND 1) + return() +endif() + +find_path(Flite_INCLUDE_DIR + NAMES + flite/flite.h +) +find_library(Flite_LIBRARY + NAMES + flite +) + +if(NOT Flite_INCLUDE_DIR OR NOT Flite_LIBRARY) + set(Flite_FOUND 0) + return() +endif() + +include(CMakePushCheckState) +include(CheckCXXSourceCompiles) + +# Flite can be built with ALSA support, +# in which case we need to link ALSA as well +find_package(ALSA QUIET) + +cmake_push_check_state(RESET) + +set(CMAKE_REQUIRED_INCLUDES "${Flite_INCLUDE_DIR}") +set(CMAKE_REQUIRED_LIBRARIES "${Flite_LIBRARY}") + +if(ALSA_FOUND) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${ALSA_LIBRARIES}") +endif() + +check_cxx_source_compiles(" +#include + +static int fliteAudioCb(const cst_wave *w, int start, int size, + int last, cst_audio_streaming_info *asi) +{ + (void)w; + (void)start; + (void)size; + (void)last; + (void)asi; + return CST_AUDIO_STREAM_STOP; +} + +int main() +{ + cst_audio_streaming_info *asi = new_audio_streaming_info(); + asi->asc = fliteAudioCb; // This fails for old Flite + new_audio_streaming_info(); + return 0; +} +" HAVE_FLITE) + +cmake_pop_check_state() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Flite + FOUND_VAR + Flite_FOUND + REQUIRED_VARS + Flite_LIBRARY + Flite_INCLUDE_DIR + HAVE_FLITE +) + +if(Flite_FOUND) + add_library(Flite::Flite UNKNOWN IMPORTED) + set_target_properties(Flite::Flite PROPERTIES + IMPORTED_LOCATION "${Flite_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${Flite_INCLUDE_DIR}" + ) + if(ALSA_FOUND) + set_target_properties(Flite::Flite PROPERTIES + INTERFACE_LINK_LIBRARIES "${ALSA_LIBRARIES}" + ) + endif() +endif() + +mark_as_advanced(Flite_LIBRARY Flite_INCLUDE_DIR HAVE_FLITE) + + +if(HAVE_FLITE) + set(Flite_FOUND 1) +else() + message("Flite was found, but the version is too old (<2.0.0)") + set(Flite_FOUND 0) +endif() diff --git a/cmake/find-modules/FindGStreamer.cmake b/cmake/find-modules/FindGStreamer.cmake index c1102892bab..984ded80e05 100644 --- a/cmake/find-modules/FindGStreamer.cmake +++ b/cmake/find-modules/FindGStreamer.cmake @@ -214,12 +214,14 @@ function(find_gstreamer_component component) set(target GStreamer::${component}) if(NOT TARGET ${target}) - string(TOUPPER ${component} upper) - pkg_check_modules(PC_GSTREAMER_${upper} IMPORTED_TARGET ${pkgconfig_name}) - if(TARGET PkgConfig::PC_GSTREAMER_${upper}) - add_library(GStreamer::${component} INTERFACE IMPORTED) - target_link_libraries(GStreamer::${component} INTERFACE PkgConfig::PC_GSTREAMER_${upper}) - set_target_properties(GStreamer::${component} PROPERTIES VERSION ${PC_GSTREAMER_${upper}_VERSION}) + if(PkgConfig_FOUND) + string(TOUPPER ${component} upper) + pkg_check_modules(PC_GSTREAMER_${upper} IMPORTED_TARGET ${pkgconfig_name}) + if(TARGET PkgConfig::PC_GSTREAMER_${upper}) + add_library(GStreamer::${component} INTERFACE IMPORTED) + target_link_libraries(GStreamer::${component} INTERFACE PkgConfig::PC_GSTREAMER_${upper}) + set_target_properties(GStreamer::${component} PROPERTIES VERSION ${PC_GSTREAMER_${upper}_VERSION}) + endif() else() foreach(dependency IN LISTS ARGS_DEPENDENCIES) if (NOT TARGET ${dependency}) @@ -295,20 +297,73 @@ find_gstreamer_component(Gl ################################################################################ -set(GST_DEPENDENCIES) -find_package(GLESv2 QUIET) -list(APPEND GST_DEPENDENCIES GLESv2::GLESv2) -find_package(OpenGL QUIET OPTIONAL_COMPONENTS EGL GLX OpenGL) # GLES2 GLES3 -list(APPEND GST_DEPENDENCIES OpenGL::GL OpenGL::EGL OpenGL::GLX OpenGL::OpenGL) -find_package(X11_XCB QUIET) -list(APPEND GST_DEPENDENCIES X11::XCB) -find_package(EGL QUIET) -list(APPEND GST_DEPENDENCIES EGL::EGL) -pkg_check_modules(PC_libdrm IMPORTED_TARGET libdrm) -list(APPEND GST_DEPENDENCIES PkgConfig::PC_libdrm) -pkg_check_modules(PC_gudev IMPORTED_TARGET gudev-1.0) -list(APPEND GST_DEPENDENCIES PkgConfig::PC_gudev) -cmake_print_variables(GST_DEPENDENCIES) +# set(GST_DEPENDENCIES) +# list(APPEND GST_DEPENDENCIES GLIB2::GLIB2 GLIB2::GOBJECT GLIB2::GIO GObject::GObject) +# find_package(GLESv2 QUIET) +# list(APPEND GST_DEPENDENCIES GLESv2::GLESv2) +# find_package(OpenGL QUIET OPTIONAL_COMPONENTS EGL GLX OpenGL) # GLES2 GLES3 +# list(APPEND GST_DEPENDENCIES OpenGL::GL OpenGL::EGL OpenGL::GLX OpenGL::OpenGL) +# find_package(X11 QUIET) +# list(APPEND GST_DEPENDENCIES X11::X11) +# find_package(XRender QUIET) +# list(APPEND GST_DEPENDENCIES PkgConfig::XRender) +# find_package(XCB QUIET) +# list(APPEND GST_DEPENDENCIES XCB::XCB) +# find_package(X11_XCB QUIET) +# list(APPEND GST_DEPENDENCIES X11::XCB) +# find_package(XKB QUIET) +# list(APPEND GST_DEPENDENCIES XKB::XKB) +# find_package(XKB_COMMON_X11 QUIET) +# list(APPEND GST_DEPENDENCIES PkgConfig::XKB_COMMON_X11) +# find_package(EGL QUIET) +# list(APPEND GST_DEPENDENCIES EGL::EGL) +# find_package(Wayland QUIET) +# list(APPEND GST_DEPENDENCIES Wayland::Client Wayland::Cursor Wayland::Egl) +# find_package(Libdrm QUIET) +# list(APPEND GST_DEPENDENCIES Libdrm::Libdrm) +# find_package(gbm QUIET) +# list(APPEND GST_DEPENDENCIES gbm::gbm) +# find_package(FFmpeg QUIET) +# list(APPEND GST_DEPENDENCIES FFmpeg::FFmpeg) +# find_package(Fontconfig QUIET) +# list(APPEND GST_DEPENDENCIES Fontconfig::Fontconfig) +# find_package(Freetype QUIET) +# list(APPEND GST_DEPENDENCIES Freetype::Freetype) +# find_package(Iconv QUIET) +# list(APPEND GST_DEPENDENCIES Iconv::Iconv) +# find_package(Intl QUIET) +# list(APPEND GST_DEPENDENCIES Intl::Intl) +# find_package(JPEG QUIET) +# list(APPEND GST_DEPENDENCIES JPEG::JPEG) +# find_package(PNG QUIET) +# list(APPEND GST_DEPENDENCIES PNG::PNG) +# find_package(BZip2 QUIET) +# list(APPEND GST_DEPENDENCIES BZip2::BZip2) +# find_package(EXPAT QUIET) +# list(APPEND GST_DEPENDENCIES EXPAT::EXPAT) +# find_package(LibXml2 QUIET) +# list(APPEND GST_DEPENDENCIES LibXml2::LibXml2) +# find_package(LibLZMA QUIET) +# list(APPEND GST_DEPENDENCIES LibLZMA::LibLZMA) +# find_package(TIFF QUIET) +# list(APPEND GST_DEPENDENCIES TIFF::TIFF) +# find_package(ZLIB QUIET) +# list(APPEND GST_DEPENDENCIES ZLIB::ZLIB) +# find_package(Libudev) +# list(APPEND GST_DEPENDENCIES PkgConfig::Libudev) +# find_package(VAAPI QUIET) +# list(APPEND GST_DEPENDENCIES VAAPI::VAAPI) +# find_package(Vulkan QUIET) +# list(APPEND GST_DEPENDENCIES Vulkan::Vulkan) +# find_package(OpenCL) +# list(APPEND GST_DEPENDENCIES OpenCL::OpenCL) +# find_package(Threads) +# list(APPEND GST_DEPENDENCIES Threads::Threads) +# pkg_check_modules(PC_gudev IMPORTED_TARGET gudev-1.0) +# list(APPEND GST_DEPENDENCIES PkgConfig::PC_gudev) +# find_package(Qt6 QUIET COMPONENTS OPTIONAL_COMPONENTS Network OpenGL) # WaylandClient +# list(APPEND GST_DEPENDENCIES Qt6::Network Qt6::OpenGL) # Qt6::WaylandClient +# cmake_print_variables(GST_DEPENDENCIES) ################################################################################ @@ -433,12 +488,9 @@ if(GlX11 IN_LIST GStreamer_FIND_COMPONENTS) # find_package(X11 QUIET) # find_package(XCB QUIET) find_package(X11_XCB QUIET) - set(GlX11_DEPENDENCIES X11::XCB) - foreach(dependency IN LISTS GlX11_DEPENDENCIES) - if(TARGET ${dependency}) - target_link_libraries(GStreamer::GlX11 INTERFACE ${dependency}) - endif() - endforeach() + if(TARGET X11::XCB) + target_link_libraries(GStreamer::GlX11 INTERFACE X11::XCB) + endif() endif() endif() @@ -544,10 +596,6 @@ if(Va IN_LIST GStreamer_FIND_COMPONENTS) HEADER gst/va/gstva.h LIBRARY gstva-1.0 DEPENDENCIES GStreamer::Core GStreamer::Video) - - if(TARGET GSreamer::Va) - find_package(VAAPI QUIET) - endif() endif() ################################################################################ @@ -595,12 +643,12 @@ if(QGC_GST_STATIC_BUILD) target_compile_definitions(GStreamer::GStreamer INTERFACE QGC_GST_STATIC_BUILD) endif() -foreach(dependency IN LISTS GST_DEPENDENCIES) - if(TARGET ${dependency}) - cmake_print_variables(dependency) - target_link_libraries(GStreamer::GStreamer INTERFACE ${dependency}) - endif() -endforeach() +# foreach(dependency IN LISTS GST_DEPENDENCIES) +# if(TARGET ${dependency}) +# cmake_print_variables(dependency) +# target_link_libraries(GStreamer::GStreamer INTERFACE ${dependency}) +# endif() +# endforeach() target_include_directories(GStreamer::GStreamer INTERFACE @@ -616,6 +664,8 @@ target_link_directories(GStreamer::GStreamer INTERFACE ${GSTREAMER_LIB_PATH}) ################################################################################ +# TODO: https://gstreamer.freedesktop.org/documentation/qt6d3d11/index.html#qml6d3d11sink-page + add_library(GStreamer::Plugins INTERFACE IMPORTED) set(GSTREAMER_PLUGIN_PATH ${GSTREAMER_LIB_PATH}/gstreamer-1.0) @@ -639,8 +689,9 @@ set(GST_PLUGINS gstudp gstvideoparsersbad gstx264 - gstasf gstva + gstapp + gstvaapi # gstqml6 ) if(ANDROID) @@ -651,7 +702,7 @@ endif() foreach(plugin IN LISTS GST_PLUGINS) if(PkgConfig_FOUND) - pkg_check_modules(GST_PLUGIN_${plugin} IMPORTED_TARGET ${plugin}) + pkg_check_modules(GST_PLUGIN_${plugin} QUIET IMPORTED_TARGET ${plugin}) if(GST_PLUGIN_${plugin}_FOUND) target_link_libraries(GStreamer::Plugins INTERFACE PkgConfig::GST_PLUGIN_${plugin}) endif() @@ -665,15 +716,14 @@ foreach(plugin IN LISTS GST_PLUGINS) ${GSTREAMER_PLUGIN_PATH} ) if(GST_PLUGIN_${plugin}_LIBRARY) - cmake_print_variables(plugin) target_link_libraries(GStreamer::Plugins INTERFACE ${GST_PLUGIN_${plugin}_LIBRARY}) set(GST_PLUGIN_${plugin}_FOUND TRUE) endif() endif() - # if(GST_PLUGIN_${plugin}_FOUND) - # cmake_print_variables(plugin) - # endif() + if(GST_PLUGIN_${plugin}_FOUND) + cmake_print_variables(plugin) + endif() endforeach() if(NOT MACOS) diff --git a/cmake/FindGeographicLib.cmake b/cmake/find-modules/FindGeographicLib.cmake similarity index 100% rename from cmake/FindGeographicLib.cmake rename to cmake/find-modules/FindGeographicLib.cmake diff --git a/cmake/find-modules/FindLibdrm.cmake b/cmake/find-modules/FindLibdrm.cmake new file mode 100644 index 00000000000..a94e7fbcb60 --- /dev/null +++ b/cmake/find-modules/FindLibdrm.cmake @@ -0,0 +1,134 @@ +#.rst: +# FindLibdrm +# ------- +# +# Try to find libdrm on a Unix system. +# +# This will define the following variables: +# +# ``Libdrm_FOUND`` +# True if (the requested version of) libdrm is available +# ``Libdrm_VERSION`` +# The version of libdrm +# ``Libdrm_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``Libdrm::Libdrm`` +# target +# ``Libdrm_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``Libdrm_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``Libdrm_FOUND`` is TRUE, it will also define the following imported target: +# +# ``Libdrm::Libdrm`` +# The libdrm library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by FindLibdrm.cmake") +endif() +if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindLibdrm.cmake") +endif() + +if(NOT WIN32) + # Use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig QUIET) + pkg_check_modules(PKG_Libdrm QUIET libdrm) + + set(Libdrm_DEFINITIONS ${PKG_Libdrm_CFLAGS_OTHER}) + set(Libdrm_VERSION ${PKG_Libdrm_VERSION}) + + find_path(Libdrm_INCLUDE_DIR + NAMES + xf86drm.h + HINTS + ${PKG_Libdrm_INCLUDE_DIRS} + PATH_SUFFIXES + libdrm + ) + find_library(Libdrm_LIBRARY + NAMES + drm + HINTS + ${PKG_Libdrm_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libdrm + FOUND_VAR + Libdrm_FOUND + REQUIRED_VARS + Libdrm_LIBRARY + Libdrm_INCLUDE_DIR + VERSION_VAR + Libdrm_VERSION + ) + + if(Libdrm_FOUND AND NOT TARGET Libdrm::Libdrm) + add_library(Libdrm::Libdrm UNKNOWN IMPORTED) + set_target_properties(Libdrm::Libdrm PROPERTIES + IMPORTED_LOCATION "${Libdrm_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}" + ) + foreach(suffix libdrm drm) + if(EXISTS "${Libdrm_INCLUDE_DIR}/${suffix}") + set_property(TARGET Libdrm::Libdrm APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/${suffix}" + ) + endif() + endforeach() + endif() + + mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR) + + # compatibility variables + set(Libdrm_LIBRARIES ${Libdrm_LIBRARY}) + set(Libdrm_INCLUDE_DIRS ${Libdrm_INCLUDE_DIR} "${Libdrm_INCLUDE_DIR}/libdrm" "${Libdrm_INCLUDE_DIR}/drm") + set(Libdrm_VERSION_STRING ${Libdrm_VERSION}) + +else() + message(STATUS "FindLibdrm.cmake cannot find libdrm on Windows systems.") + set(Libdrm_FOUND FALSE) +endif() + +include(FeatureSummary) +set_package_properties(Libdrm PROPERTIES + URL "https://wiki.freedesktop.org/dri/" + DESCRIPTION "Userspace interface to kernel DRM services." +) diff --git a/cmake/find-modules/FindLibudev.cmake b/cmake/find-modules/FindLibudev.cmake new file mode 100644 index 00000000000..57e34659d1f --- /dev/null +++ b/cmake/find-modules/FindLibudev.cmake @@ -0,0 +1,10 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +find_package(PkgConfig QUIET) + +pkg_check_modules(Libudev IMPORTED_TARGET "libudev") + +if (NOT TARGET PkgConfig::Libudev) + set(Libudev_FOUND 0) +endif() diff --git a/cmake/find-modules/FindMMRenderer.cmake b/cmake/find-modules/FindMMRenderer.cmake new file mode 100644 index 00000000000..43dcf3f0052 --- /dev/null +++ b/cmake/find-modules/FindMMRenderer.cmake @@ -0,0 +1,29 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# FindMMRenderer +# --------- +# +# Try to locate the mm-renderer library. +# If found, this will define the following variables: +# +# ``MMRenderer_FOUND`` +# True if the mm-renderer library is available +# ``MMRenderer_LIBRARY`` +# The mm-renderer library +# +# If ``MMRenderer_FOUND`` is TRUE, it will also define the following +# imported target: +# +# ``MMRenderer::MMRenderer`` +# The mm-renderer library to link to + +find_library(MMRenderer_LIBRARY NAMES mmrndclient) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MMRenderer DEFAULT_MSG MMRenderer_LIBRARY) +if(MMRenderer_FOUND AND NOT TARGET MMRenderer::MMRenderer) + add_library(MMRenderer::MMRenderer INTERFACE IMPORTED) + target_link_libraries(MMRenderer::MMRenderer + INTERFACE "${MMRenderer_LIBRARY}") +endif() +mark_as_advanced(MMRenderer_LIBRARY) diff --git a/cmake/find-modules/FindMMRendererCore.cmake b/cmake/find-modules/FindMMRendererCore.cmake new file mode 100644 index 00000000000..3f07e3720f0 --- /dev/null +++ b/cmake/find-modules/FindMMRendererCore.cmake @@ -0,0 +1,12 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +find_library(MMRendererCore_LIBRARY NAMES mmrndcore) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MMRendererCore DEFAULT_MSG MMRendererCore_LIBRARY) +if(MMRendererCore_FOUND AND NOT TARGET MMRendererCore::MMRendererCore) + add_library(MMRendererCore::MMRendererCore INTERFACE IMPORTED) + target_link_libraries(MMRendererCore::MMRendererCore + INTERFACE "${MMRendererCore_LIBRARY}") +endif() +mark_as_advanced(MMRendererCore_LIBRARY) diff --git a/cmake/find-modules/FindPipeWire.cmake b/cmake/find-modules/FindPipeWire.cmake new file mode 100644 index 00000000000..5812bac727b --- /dev/null +++ b/cmake/find-modules/FindPipeWire.cmake @@ -0,0 +1,123 @@ +#.rst: +# FindPipeWire +# ------- +# +# Try to find PipeWire on a Unix system. +# +# This will define the following variables: +# +# ``PipeWire_FOUND`` +# True if (the requested version of) PipeWire is available +# ``PipeWire_VERSION`` +# The version of PipeWire +# ``PipeWire_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``PipeWire::PipeWire`` +# target +# ``PipeWire_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``PipeWire_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``PipeWire_FOUND`` is TRUE, it will also define the following imported target: +# +# ``PipeWire::PipeWire`` +# The PipeWire library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# Copyright 2018-2020 Jan Grulich +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig QUIET) + +if(PkgConfig_FOUND) + pkg_search_module(PKG_PipeWire QUIET libpipewire-0.3) + pkg_search_module(PKG_Spa QUIET libspa-0.2) +endif() + +set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS}" "${PKG_Spa_CFLAGS}") +set(PipeWire_VERSION "${PKG_PipeWire_VERSION}") + +find_path(PipeWire_INCLUDE_DIRS + NAMES + pipewire/pipewire.h + HINTS + ${PKG_PipeWire_INCLUDE_DIRS} + ${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3 +) + +find_path(Spa_INCLUDE_DIRS + NAMES + spa/param/props.h + HINTS + ${PKG_Spa_INCLUDE_DIRS} + ${PKG_Spa_INCLUDE_DIRS}/spa-0.2 +) + +find_library(PipeWire_LIBRARIES + NAMES + pipewire-0.3 + HINTS + ${PKG_PipeWire_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PipeWire + FOUND_VAR + PipeWire_FOUND + REQUIRED_VARS + PipeWire_LIBRARIES + PipeWire_INCLUDE_DIRS + Spa_INCLUDE_DIRS + VERSION_VAR + PipeWire_VERSION +) + +if(PipeWire_FOUND AND NOT TARGET PipeWire::PipeWire) + add_library(PipeWire::PipeWire UNKNOWN IMPORTED) + set_target_properties(PipeWire::PipeWire PROPERTIES + IMPORTED_LOCATION "${PipeWire_LIBRARIES}" + INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS};${Spa_INCLUDE_DIRS}" + ) +endif() + +mark_as_advanced(PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS) + +include(FeatureSummary) +set_package_properties(PipeWire PROPERTIES + URL "https://www.pipewire.org" + DESCRIPTION "PipeWire - multimedia processing" +) diff --git a/cmake/FindSDL2.cmake b/cmake/find-modules/FindSDL2.cmake similarity index 100% rename from cmake/FindSDL2.cmake rename to cmake/find-modules/FindSDL2.cmake diff --git a/cmake/find-modules/FindSpeechDispatcher.cmake b/cmake/find-modules/FindSpeechDispatcher.cmake new file mode 100644 index 00000000000..d1453196e00 --- /dev/null +++ b/cmake/find-modules/FindSpeechDispatcher.cmake @@ -0,0 +1,17 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET SpeechDispatcher::SpeechDispatcher) + set(SpeechDispatcher_FOUND 1) + return() +endif() + +find_package(PkgConfig QUIET) + +pkg_check_modules(SpeechDispatcher "speech-dispatcher" IMPORTED_TARGET GLOBAL) + +if (TARGET PkgConfig::SpeechDispatcher) + add_library(SpeechDispatcher::SpeechDispatcher ALIAS PkgConfig::SpeechDispatcher) +endif() diff --git a/cmake/find-modules/FindWMF.cmake b/cmake/find-modules/FindWMF.cmake new file mode 100644 index 00000000000..79306a350ef --- /dev/null +++ b/cmake/find-modules/FindWMF.cmake @@ -0,0 +1,52 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# FindWMF +# --------- +# +# Try to locate the Windows Media Foundation library. +# If found, this will define the following variables: +# +# ``WMF_FOUND`` +# True if Windows Media Foundation is available +# ``WMF_LIBRARIES`` +# The Windows Media Foundation set of libraries +# +# If ``WMF_FOUND`` is TRUE, it will also define the following +# imported target: +# +# ``WMF::WMF`` +# The Windows Media Foundation library to link to + +find_library(WMF_STRMIIDS_LIBRARY strmiids HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_AMSTRMID_LIBRARY amstrmid HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_DMOGUIDS_LIBRARY dmoguids HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_UUID_LIBRARY uuid HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_MSDMO_LIBRARY msdmo HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_OLE32_LIBRARY ole32 HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_OLEAUT32_LIBRARY oleaut32 HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_MF_LIBRARY mf HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_MFUUID_LIBRARY mfuuid HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_MFPLAT_LIBRARY mfplat HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_MFCORE_LIBRARY mfcore HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) +find_library(WMF_PROPSYS_LIBRARY propsys HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) + + +set(WMF_LIBRARIES ${WMF_STRMIIDS_LIBRARY} ${WMF_AMSTRMID_LIBRARY} ${WMF_DMOGUIDS_LIBRARY} ${WMF_UUID_LIBRARY} + ${WMF_MSDMO_LIBRARY} ${WMF_OLE32_LIBRARY} ${WMF_OLEAUT32_LIBRARY} ${WMF_MF_LIBRARY} + ${WMF_MFUUID_LIBRARY} ${WMF_MFPLAT_LIBRARY} ${WMF_MFCORE_LIBRARY} ${WMF_PROPSYS_LIBRARY}) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WMF REQUIRED_VARS + WMF_STRMIIDS_LIBRARY WMF_AMSTRMID_LIBRARY WMF_DMOGUIDS_LIBRARY WMF_UUID_LIBRARY + WMF_MSDMO_LIBRARY WMF_OLE32_LIBRARY WMF_OLEAUT32_LIBRARY WMF_MF_LIBRARY + WMF_MFUUID_LIBRARY WMF_MFPLAT_LIBRARY WMF_MFCORE_LIBRARY WMF_PROPSYS_LIBRARY) + +if(WMF_FOUND AND NOT TARGET WMF::WMF) + add_library(WMF::WMF INTERFACE IMPORTED) + set_target_properties(WMF::WMF PROPERTIES + INTERFACE_LINK_LIBRARIES "${WMF_LIBRARIES}") +endif() + +mark_as_advanced(WMF_LIBRARIES WMF_STRMIIDS_LIBRARY WMF_AMSTRMID_LIBRARY WMF_DMOGUIDS_LIBRARY WMF_UUID_LIBRARY + WMF_MSDMO_LIBRARY WMF_OLE32_LIBRARY WMF_OLEAUT32_LIBRARY WMF_MF_LIBRARY WMF_MFUUID_LIBRARY WMF_MFPLAT_LIBRARY + WMF_MFCORE_LIBRARY WMF_PROPSYS_LIBRARY) diff --git a/cmake/find-modules/FindWrapPulseAudio.cmake b/cmake/find-modules/FindWrapPulseAudio.cmake new file mode 100644 index 00000000000..ce170da632a --- /dev/null +++ b/cmake/find-modules/FindWrapPulseAudio.cmake @@ -0,0 +1,37 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# FindWrapPulseAudio +# --------- +# +# Try to locate the pulseaudio library. +# If found, this will define the following variables: +# +# ``WrapPulseAudio_FOUND`` +# True if the pulseaudio library is available +# +# If ``WrapPulseAduio_FOUND`` is TRUE, it will also define the following +# imported target: +# +# ``WrapPulseAudio::WrapPulseAudio`` +# The pulseaudio library to link to + +if(TARGET WrapPulseAudio::WrapPulseAudio) + set(WrapPulseAudio_FOUND ON) + return() +endif() +find_package(PulseAudio QUIET) +if(PulseAudio_FOUND) + set(WrapPulseAudio_FOUND 1) +endif() +if(WrapPulseAudio_FOUND AND NOT TARGET WrapPulseAudio::WrapPulseAudio) + add_library(WrapPulseAudio::WrapPulseAudio INTERFACE IMPORTED) + target_include_directories(WrapPulseAudio::WrapPulseAudio INTERFACE "${PULSEAUDIO_INCLUDE_DIR}") + target_link_libraries(WrapPulseAudio::WrapPulseAudio + INTERFACE "${PULSEAUDIO_LIBRARY}") +endif() +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WrapPulseAudio REQUIRED_VARS + PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR WrapPulseAudio_FOUND) + +mark_as_advanced(PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR) diff --git a/cmake/find-modules/FindXRender.cmake b/cmake/find-modules/FindXRender.cmake new file mode 100644 index 00000000000..6908cc45fbc --- /dev/null +++ b/cmake/find-modules/FindXRender.cmake @@ -0,0 +1,14 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +find_package(PkgConfig QUIET) + +if(NOT TARGET PkgConfig::XRender) + pkg_check_modules(XRender IMPORTED_TARGET "xrender") + + if (NOT TARGET PkgConfig::XRender) + set(XRender_FOUND 0) + endif() +else() + set(XRender_FOUND 1) +endif() diff --git a/cmake/find-modules/Findgbm.cmake b/cmake/find-modules/Findgbm.cmake new file mode 100644 index 00000000000..a77f7e86dbe --- /dev/null +++ b/cmake/find-modules/Findgbm.cmake @@ -0,0 +1,125 @@ +#.rst: +# Findgbm +# ------- +# +# Try to find gbm on a Unix system. +# +# This will define the following variables: +# +# ``gbm_FOUND`` +# True if (the requested version of) gbm is available +# ``gbm_VERSION`` +# The version of gbm +# ``gbm_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``gbm::gbm`` +# target +# ``gbm_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``gbm_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``gbm_FOUND`` is TRUE, it will also define the following imported target: +# +# ``gbm::gbm`` +# The gbm library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by Findgbm.cmake") +endif() +if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake") +endif() + +if(NOT WIN32) + # Use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig QUIET) + pkg_check_modules(PKG_gbm QUIET gbm) + + set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER}) + set(gbm_VERSION ${PKG_gbm_VERSION}) + + find_path(gbm_INCLUDE_DIR + NAMES + gbm.h + HINTS + ${PKG_gbm_INCLUDE_DIRS} + ) + find_library(gbm_LIBRARY + NAMES + gbm + HINTS + ${PKG_gbm_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(gbm + FOUND_VAR + gbm_FOUND + REQUIRED_VARS + gbm_LIBRARY + gbm_INCLUDE_DIR + VERSION_VAR + gbm_VERSION + ) + + if(gbm_FOUND AND NOT TARGET gbm::gbm) + add_library(gbm::gbm UNKNOWN IMPORTED) + set_target_properties(gbm::gbm PROPERTIES + IMPORTED_LOCATION "${gbm_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${gbm_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${gbm_INCLUDE_DIR}" + ) + endif() + + mark_as_advanced(gbm_LIBRARY gbm_INCLUDE_DIR) + + # compatibility variables + set(gbm_LIBRARIES ${gbm_LIBRARY}) + set(gbm_INCLUDE_DIRS ${gbm_INCLUDE_DIR}) + set(gbm_VERSION_STRING ${gbm_VERSION}) + +else() + message(STATUS "Findgbm.cmake cannot find gbm on Windows systems.") + set(gbm_FOUND FALSE) +endif() + +include(FeatureSummary) +set_package_properties(gbm PROPERTIES + URL "http://www.mesa3d.org" + DESCRIPTION "Mesa gbm library." +) diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index d4dc52556f8..edf0c5b9e20 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -15,3 +15,15 @@ target_link_libraries(Audio ) target_include_directories(Audio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +if(LINUX) + find_package(SpeechDispatcher) + if(TARGET SpeechDispatcher::SpeechDispatcher) + target_link_libraries(Audio PRIVATE SpeechDispatcher::SpeechDispatcher) + endif() + + find_package(Flite) + if(TARGET Flite::Flite) + target_link_libraries(Audio PRIVATE Flite::Flite) + endif() +endif() diff --git a/src/Joystick/CMakeLists.txt b/src/Joystick/CMakeLists.txt index e809509d17f..e1eb4aedaec 100644 --- a/src/Joystick/CMakeLists.txt +++ b/src/Joystick/CMakeLists.txt @@ -73,7 +73,7 @@ set(MINIMUM_SDL2_VERSION 2.30.0) if(NOT QGC_BUILD_DEPENDENCIES) find_package(SDL2 ${MINIMUM_SDL2_VERSION}) - if(SDL2_FOUND) + if(TARGET SDL2::SDL2) message(STATUS "Found JoystickSDL ${SDL2_VERSION_STRING}") target_link_libraries(Joystick PRIVATE SDL2::SDL2) return() @@ -81,7 +81,7 @@ if(NOT QGC_BUILD_DEPENDENCIES) find_package(PkgConfig) if(PkgConfig_FOUND) pkg_check_modules(SDL2 IMPORTED_TARGET sdl2>=${MINIMUM_SDL2_VERSION}) - if(SDL2_FOUND) + if(TARGET PkgConfig::SDL2) message(STATUS "Found JoystickSDL ${SDL2_VERSION}") target_link_libraries(Joystick PRIVATE PkgConfig::SDL2) return() diff --git a/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc b/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc index 6ef042f4810..f89235ed353 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc +++ b/src/VideoManager/VideoReceiver/GStreamer/GStreamer.cc @@ -38,7 +38,7 @@ GST_PLUGIN_STATIC_DECLARE(matroska); GST_PLUGIN_STATIC_DECLARE(mpegtsdemux); GST_PLUGIN_STATIC_DECLARE(opengl); GST_PLUGIN_STATIC_DECLARE(tcp); -// GST_PLUGIN_STATIC_DECLARE(asf); +GST_PLUGIN_STATIC_DECLARE(app); // #ifndef Q_OS_ANDROID // GST_PLUGIN_STATIC_DECLARE(va); // #endif @@ -145,7 +145,7 @@ static void _registerPlugins() GST_PLUGIN_STATIC_REGISTER(mpegtsdemux); GST_PLUGIN_STATIC_REGISTER(opengl); GST_PLUGIN_STATIC_REGISTER(tcp); - // GST_PLUGIN_STATIC_REGISTER(asf); + GST_PLUGIN_STATIC_REGISTER(app); // #ifndef Q_OS_ANDROID // GST_PLUGIN_STATIC_REGISTER(va); // #endif diff --git a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt index 67b7b03ca0d..1b344505284 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt +++ b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) -set(GST_COMPONENTS Allocators Audio Codecparsers Controller Fft GlEGL GlPrototypes GlWayland GlX11 Mpegts Net Pbutils Photography Riff Rtp Rtsp Sdp Tag Va) +set(GST_COMPONENTS Allocators App Audio Codecparsers Controller Fft GlEGL GlPrototypes GlWayland GlX11 Mpegts Net Pbutils Photography Riff Rtp Rtsp Sdp Tag Va) find_package(GStreamer REQUIRED COMPONENTS OPTIONAL_COMPONENTS ${GST_COMPONENTS}) qt_add_library(gstqml6gl STATIC) @@ -18,13 +18,94 @@ target_link_libraries(gstqml6gl foreach(component IN LISTS GST_COMPONENTS) if(GStreamer_${component}_FOUND) - target_link_libraries(gstqml6gl PUBLIC GStreamer::${component}) + target_link_libraries(gstqml6gl INTERFACE GStreamer::${component}) endif() endforeach() ################################################################################ -# TODO: Don't Download & Build if gstreamer1.0-qt6 was found +if(LINUX) + # if(NOT QGC_GST_STATIC_BUILD) + install(DIRECTORY ${GSTREAMER_LIB_PATH}/gstreamer1.0 DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner\")") + install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/gstreamer1.0/gstreamer-1.0/gst-ptp-helper\")") + install(DIRECTORY ${GSTREAMER_LIB_PATH}/gio DESTINATION ${CMAKE_INSTALL_LIBDIR}) + get_target_property(LINKED_PLUGINS GStreamer::Plugins INTERFACE_LINK_LIBRARIES) + install(FILES ${LINKED_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0) + # endif() +elseif(WIN32) + cmake_path(CONVERT "${GSTREAMER_PREFIX}/bin/*.dll" TO_CMAKE_PATH_LIST GST_WIN_BINS_PATH) + file(GLOB GST_WIN_BINS ${GST_WIN_BINS_PATH}) + install(FILES ${GST_WIN_BINS} DESTINATION ${CMAKE_INSTALL_BINDIR}) + + cmake_path(CONVERT "${GSTREAMER_LIB_PATH}/gio/modules/*.dll" TO_CMAKE_PATH_LIST GST_GIO_MODULES_PATH) + file(GLOB GST_GIO_MODULES ${GST_GIO_MODULES_PATH}) + install(FILES ${GST_GIO_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gio/modules) + + cmake_path(CONVERT "${GSTREAMER_PLUGIN_PATH}/*.dll" TO_CMAKE_PATH_LIST GST_WIN_PLUGINS_PATH) + file(GLOB GST_WIN_PLUGINS ${GST_WIN_PLUGINS_PATH}) + install(FILES ${GST_WIN_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0) + + cmake_path(CONVERT "${GSTREAMER_PREFIX}/libexec/gstreamer-1.0/*.exe" TO_CMAKE_PATH_LIST GST_HELPER_BINS_PATH) + file(GLOB GST_HELPER_BINS ${GST_HELPER_BINS_PATH}) + install(FILES ${GST_HELPER_BINS} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/gstreamer-1.0) +elseif(MACOS) + # cmake_path(CONVERT "${GSTREAMER_PREFIX}/bin/*.dylib" TO_CMAKE_PATH_LIST GST_MACOS_BINS_PATH) + # file(GLOB GST_MACOS_BINS ${GST_MACOS_BINS_PATH}) + # install(FILES ${GST_MACOS_BINS} DESTINATION ${CMAKE_INSTALL_BINDIR}) + + # cmake_path(CONVERT "${GSTREAMER_LIB_PATH}/gio/modules/*.dylib" TO_CMAKE_PATH_LIST GST_GIO_MODULES_PATH) + # file(GLOB GST_GIO_MODULES ${GST_GIO_MODULES_PATH}) + # install(FILES ${GST_GIO_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gio/modules) + + # cmake_path(CONVERT "${GSTREAMER_PLUGIN_PATH}/*.dylib" TO_CMAKE_PATH_LIST GST_MACOS_PLUGINS_PATH) + # file(GLOB GST_MACOS_PLUGINS ${GST_MACOS_PLUGINS_PATH}) + # install(FILES ${GST_MACOS_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0) + + # cmake_path(CONVERT "${GSTREAMER_PREFIX}/libexec/gstreamer-1.0/*" TO_CMAKE_PATH_LIST GST_HELPER_BINS_PATH) + # file(GLOB GST_HELPER_BINS ${GST_HELPER_BINS_PATH}) + # install(FILES ${GST_HELPER_BINS} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/gstreamer-1.0) +elseif(ANDROID) + if(CMAKE_HOST_WIN32) + cmake_path(CONVERT "${GSTREAMER_PREFIX}/share/gst-android/ndk-build/tools/windows/*.dll" TO_CMAKE_PATH_LIST GST_WIN_TOOLS_PATH) + file(GLOB GST_WIN_TOOLS ${GST_WIN_TOOLS_PATH}) + install(FILES ${GST_WIN_TOOLS} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() +endif() + +################################################################################ + +# DYLD_LIBRARY_PATH + +# LSEnvironment +# +# GST_REGISTRY_REUSE_PLUGIN_SCANNER +# no +# GST_PLUGIN_SCANNER +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/gst-plugin-scanner +# GST_PTP_HELPER_1_0 +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/gst-ptp-helper +# GIO_EXTRA_MODULES +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gio/modules +# GST_PLUGIN_SYSTEM_PATH_1_0 +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 +# GST_PLUGIN_SYSTEM_PATH +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 +# GST_PLUGIN_PATH_1_0 +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 +# GST_PLUGIN_PATH +# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 +# + +################################################################################ + +# Don't Download & Build if gstreamer1.0-qt6 was found +if(GST_PLUGIN_gstqml6_FOUND) + return() +endif() + +################################################################################ + if(GStreamer_VERSION VERSION_GREATER_EQUAL 1.22) FetchContent_Declare(gstreamer_good_plugins # URL https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/${GST_PLUGINS_VERSION}/gstreamer-${GST_PLUGINS_VERSION}.zip?path=subprojects/gst-plugins-good/ext/qt6 @@ -38,8 +119,6 @@ else() endif() cmake_print_variables(QGC_GST_QT6_PLUGIN_PATH) -# TODO: https://gstreamer.freedesktop.org/documentation/qt6d3d11/index.html#qml6d3d11sink-page - ################################################################################ file(READ ${QGC_GST_QT6_PLUGIN_PATH}/qt6glitem.h FILE_CONTENTS) @@ -146,76 +225,3 @@ if(UNIX) endif() ################################################################################ - -if(LINUX) - # if(NOT QGC_GST_STATIC_BUILD) - install(DIRECTORY ${GSTREAMER_LIB_PATH}/gstreamer1.0 DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner\")") - install(CODE "execute_process(COMMAND chmod +x \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/gstreamer1.0/gstreamer-1.0/gst-ptp-helper\")") - install(DIRECTORY ${GSTREAMER_LIB_PATH}/gio DESTINATION ${CMAKE_INSTALL_LIBDIR}) - get_target_property(LINKED_PLUGINS GStreamer::Plugins INTERFACE_LINK_LIBRARIES) - install(FILES ${LINKED_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0) - # endif() -elseif(WIN32) - cmake_path(CONVERT "${GSTREAMER_PREFIX}/bin/*.dll" TO_CMAKE_PATH_LIST GST_WIN_BINS_PATH) - file(GLOB GST_WIN_BINS ${GST_WIN_BINS_PATH}) - install(FILES ${GST_WIN_BINS} DESTINATION ${CMAKE_INSTALL_BINDIR}) - - cmake_path(CONVERT "${GSTREAMER_LIB_PATH}/gio/modules/*.dll" TO_CMAKE_PATH_LIST GST_GIO_MODULES_PATH) - file(GLOB GST_GIO_MODULES ${GST_GIO_MODULES_PATH}) - install(FILES ${GST_GIO_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gio/modules) - - cmake_path(CONVERT "${GSTREAMER_PLUGIN_PATH}/*.dll" TO_CMAKE_PATH_LIST GST_WIN_PLUGINS_PATH) - file(GLOB GST_WIN_PLUGINS ${GST_WIN_PLUGINS_PATH}) - install(FILES ${GST_WIN_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0) - - cmake_path(CONVERT "${GSTREAMER_PREFIX}/libexec/gstreamer-1.0/*.exe" TO_CMAKE_PATH_LIST GST_HELPER_BINS_PATH) - file(GLOB GST_HELPER_BINS ${GST_HELPER_BINS_PATH}) - install(FILES ${GST_HELPER_BINS} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/gstreamer-1.0) -elseif(MACOS) - # cmake_path(CONVERT "${GSTREAMER_PREFIX}/bin/*.dylib" TO_CMAKE_PATH_LIST GST_MACOS_BINS_PATH) - # file(GLOB GST_MACOS_BINS ${GST_MACOS_BINS_PATH}) - # install(FILES ${GST_MACOS_BINS} DESTINATION ${CMAKE_INSTALL_BINDIR}) - - # cmake_path(CONVERT "${GSTREAMER_LIB_PATH}/gio/modules/*.dylib" TO_CMAKE_PATH_LIST GST_GIO_MODULES_PATH) - # file(GLOB GST_GIO_MODULES ${GST_GIO_MODULES_PATH}) - # install(FILES ${GST_GIO_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gio/modules) - - # cmake_path(CONVERT "${GSTREAMER_PLUGIN_PATH}/*.dylib" TO_CMAKE_PATH_LIST GST_MACOS_PLUGINS_PATH) - # file(GLOB GST_MACOS_PLUGINS ${GST_MACOS_PLUGINS_PATH}) - # install(FILES ${GST_MACOS_PLUGINS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.0) - - # cmake_path(CONVERT "${GSTREAMER_PREFIX}/libexec/gstreamer-1.0/*" TO_CMAKE_PATH_LIST GST_HELPER_BINS_PATH) - # file(GLOB GST_HELPER_BINS ${GST_HELPER_BINS_PATH}) - # install(FILES ${GST_HELPER_BINS} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/gstreamer-1.0) -elseif(ANDROID) - if(CMAKE_HOST_WIN32) - cmake_path(CONVERT "${GSTREAMER_PREFIX}/share/gst-android/ndk-build/tools/windows/*.dll" TO_CMAKE_PATH_LIST GST_WIN_TOOLS_PATH) - file(GLOB GST_WIN_TOOLS ${GST_WIN_TOOLS_PATH}) - install(FILES ${GST_WIN_TOOLS} DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() -endif() - -################################################################################ - -# DYLD_LIBRARY_PATH - -# LSEnvironment -# -# GST_REGISTRY_REUSE_PLUGIN_SCANNER -# no -# GST_PLUGIN_SCANNER -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/gst-plugin-scanner -# GST_PTP_HELPER_1_0 -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/gst-ptp-helper -# GIO_EXTRA_MODULES -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gio/modules -# GST_PLUGIN_SYSTEM_PATH_1_0 -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 -# GST_PLUGIN_SYSTEM_PATH -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 -# GST_PLUGIN_PATH_1_0 -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 -# GST_PLUGIN_PATH -# @executable_path/../Frameworks/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0 -# diff --git a/tools/setup/install-dependencies-debian.sh b/tools/setup/install-dependencies-debian.sh index 225de8958b4..187851b561d 100755 --- a/tools/setup/install-dependencies-debian.sh +++ b/tools/setup/install-dependencies-debian.sh @@ -34,33 +34,36 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ # Qt Required - https://doc.qt.io/qt-6/linux-requirements.html DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ - libfontconfig1 \ - libfreetype6 \ - libx11-6 \ - libx11-xcb1 \ - libxcb-cursor0 \ - libxcb-glx0 \ - libxcb-icccm4 \ - libxcb-image0 \ - libxcb-keysyms1 \ - libxcb-present0 \ - libxcb-randr0 \ - libxcb-render-util0 \ - libxcb-render0 \ - libxcb-shape0 \ - libxcb-shm0 \ - libxcb-sync1 \ - libxcb-util1 \ - libxcb-xfixes0 \ - libxcb-xinerama0 \ - libxcb-xkb1 \ - libxcb1 \ - libxext6 \ - libxfixes3 \ - libxi6 \ - libxkbcommon-x11-0 \ - libxkbcommon0 \ - libxrender1 + libatspi2.0-dev \ + libfontconfig1-dev \ + libfreetype-dev \ + libglib2.0-dev \ + libsm-dev \ + libx11-dev \ + libx11-xcb-dev \ + libxcb-cursor-dev \ + libxcb-glx0-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-keysyms1-dev \ + libxcb-present-dev \ + libxcb-randr0-dev \ + libxcb-render-util0-dev \ + libxcb-render0-dev \ + libxcb-shape0-dev \ + libxcb-shm0-dev \ + libxcb-sync-dev \ + libxcb-util-dev \ + libxcb-xfixes0-dev \ + libxcb-xinerama0-dev \ + libxcb-xkb-dev \ + libxcb1-dev \ + libxext-dev \ + libxfixes-dev \ + libxi-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libxrender-dev DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libunwind-dev @@ -101,15 +104,21 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ # Speech DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ + flite \ flite1-dev \ + libflite1 \ libspeechd-dev \ speech-dispatcher \ + speech-dispatcher-audio-plugins \ speech-dispatcher-espeak \ speech-dispatcher-espeak-ng \ speech-dispatcher-flite \ # Additional DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ + bison \ + flex \ + gobject-introspection \ gvfs \ intel-media-va-driver \ libasound2-dev \ @@ -125,13 +134,14 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libgles2-mesa-dev \ libglew-dev \ libglfw3-dev \ - libglib2.0-dev \ libglu1-mesa-dev \ libglvnd-dev \ libglx-dev \ libglx-mesa0 \ libgudev-1.0-dev \ libgraphene-1.0-dev \ + libharfbuzz-dev \ + libmp3lame-dev \ libmjpegtools-dev \ libjpeg-dev \ libjson-glib-1.0-0 \ @@ -139,6 +149,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libopenal-dev \ libopenjp2-7-dev \ libopus-dev \ + liborc-0.4-dev \ libpng-dev \ libpulse-dev \ libsdl2-dev \ @@ -148,10 +159,15 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ libtheora-dev \ libva-dev \ libvdpau-dev \ + libvorbis-dev \ libvpx-dev \ libwayland-dev \ libwxgtk3.*-dev \ - libx11-dev \ + libx264-dev \ + libx265-dev \ + libxcb-dri2-0-dev \ + libxcb-dri3-dev \ + libxcb-xf86dri0-dev \ libxml2-dev \ libzstd-dev \ mesa-common-dev \ @@ -159,7 +175,13 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \ mesa-va-drivers \ mesa-vdpau-drivers \ mesa-vulkan-drivers \ - vainfo + va-driver-all \ + vainfo \ + wayland-protocols + +if apt-cache show libdav1d-dev >/dev/null 2>&1 && apt-cache show libdav1d-dev 2>/dev/null | grep -q "^Package: libdav1d-dev"; then + DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet libdav1d-dev +fi if apt-cache show libvpl-dev >/dev/null 2>&1 && apt-cache show libvpl-dev 2>/dev/null | grep -q "^Package: libvpl-dev"; then DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet libvpl-dev