From e651ea761480fefd5b2e46b8518c709a88bc357e Mon Sep 17 00:00:00 2001 From: amnezia-developer <131430934+amnezia-developer@users.noreply.github.com> Date: Wed, 17 May 2023 22:38:28 +0300 Subject: [PATCH] Add Qt Multimedia to project (#236) Add Qt Multimedia to iOS cmake project --- .github/workflows/deploy.yml | 18 ++++++++---------- client/CMakeLists.txt | 25 ++++++++++++++++++++----- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ca7ac87d..7436ad59 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest env: - QT_VERSION: 6.4.1 + QT_VERSION: 6.5.0 QIF_VERSION: 4.5 steps: @@ -63,7 +63,7 @@ jobs: runs-on: windows-latest env: - QT_VERSION: 6.4.1 + QT_VERSION: 6.5.0 QIF_VERSION: 4.5 BUILD_ARCH: 64 @@ -124,8 +124,7 @@ jobs: runs-on: macos-latest env: - QT_VERSION: 6.4.1 - QIF_VERSION: 4.4 + QT_VERSION: 6.5.0 steps: - name: 'Setup xcode' @@ -139,18 +138,18 @@ jobs: version: ${{ env.QT_VERSION }} host: 'mac' target: 'desktop' + modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia' arch: 'clang_64' - modules: 'qtremoteobjects qt5compat qtshadertools' dir: ${{ runner.temp }} set-env: 'true' - - name: 'Install ios Qt' + - name: 'Install iOS Qt' uses: jurplel/install-qt-action@v3 with: version: ${{ env.QT_VERSION }} host: 'mac' target: 'ios' - modules: 'qtremoteobjects qt5compat qtshadertools' + modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia' dir: ${{ runner.temp }} setup-python: 'true' set-env: 'true' @@ -200,7 +199,7 @@ jobs: runs-on: macos-latest env: - QT_VERSION: 6.4.1 + QT_VERSION: 6.5.0 QIF_VERSION: 4.5 steps: @@ -263,8 +262,7 @@ jobs: arch: ['android_x86_64', 'android_x86'] #, 'android_armv7', 'android_arm64_v8a'] env: - QT_VERSION: 6.4.1 - QIF_VERSION: 4.5 + QT_VERSION: 6.5.0 steps: - name: 'Install desktop Qt' diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 79e2b010..b9328ee6 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -18,17 +18,32 @@ set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "Autogen") set_property(GLOBAL PROPERTY AUTOMOC_TARGETS_FOLDER "Autogen") set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "Autogen") -find_package(Qt6 REQUIRED COMPONENTS - Widgets Core Gui Network Xml - RemoteObjects Quick Svg QuickControls2 - Core5Compat Concurrent +set(PACKAGES + Widgets Core Gui Network Xml + RemoteObjects Quick Svg QuickControls2 + Core5Compat Concurrent ) -set(LIBS ${LIBS} +if(IOS) + set(PACKAGES + ${PACKAGES} + Multimedia + ) +endif() + +find_package(Qt6 REQUIRED COMPONENTS ${PACKAGES}) + +set(LIBS ${LIBS} Qt6::Widgets Qt6::Core Qt6::Gui Qt6::Network Qt6::Xml Qt6::RemoteObjects Qt6::Quick Qt6::Svg Qt6::QuickControls2 Qt6::Core5Compat Qt6::Concurrent ) +if(IOS) + set(LIBS + ${LIBS} + Qt6::Multimedia + ) +endif() qt_standard_project_setup()