Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6 switch #11892

Merged
merged 11 commits into from Aug 30, 2023
3 changes: 3 additions & 0 deletions .github/workflows/build-checks.yml
Expand Up @@ -37,6 +37,7 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DWARNINGS_FATAL=ON \
-DQT6=ON \
-DOPTIMIZE=off \
-DBATTERY=ON \
-DBROADCAST=ON \
Expand Down Expand Up @@ -65,6 +66,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCLANG_TIDY=clang-tidy \
-DWARNINGS_FATAL=ON \
-DQT6=ON \
-DBATTERY=ON \
-DBROADCAST=ON \
-DBULK=ON \
Expand All @@ -91,6 +93,7 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DOPTIMIZE=off \
-DQT6=ON \
-DCOVERAGE=ON \
-DWARNINGS_FATAL=OFF \
-DDEBUG_ASSERTIONS_FATAL=OFF \
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/build.yml
Expand Up @@ -15,10 +15,11 @@ jobs:
fail-fast: false
matrix:
include:
- name: Ubuntu 22.04 (gcc)
- name: Ubuntu 22.04
os: ubuntu-22.04
cmake_args: >-
-DWARNINGS_FATAL=ON
-DQT6=ON
-DBULK=ON
-DFFMPEG=ON
-DLOCALECOMPARE=ON
Expand All @@ -30,17 +31,18 @@ jobs:
compiler_cache: ccache
compiler_cache_path: ~/.ccache
cpack_generator: DEB
buildenv_basepath: /home/runner/buildenv
buildenv_basepath: /home/runner/buildenv.sh
buildenv_script: tools/debian_buildenv.sh
artifacts_name: Ubuntu 22.04 DEB
artifacts_path: build/*.deb
artifacts_slug: ubuntu-jammy
qt_qpa_platform: offscreen
- name: Ubuntu 22.04 (Qt 6.2, gcc)
- name: Ubuntu 22.04 (QML)
os: ubuntu-22.04
cmake_args: >-
-DWARNINGS_FATAL=ON
-DQT6=ON
-DQML=ON
-DBULK=ON
-DFFMPEG=ON
-DLOCALECOMPARE=ON
Expand All @@ -53,7 +55,7 @@ jobs:
compiler_cache_path: ~/.ccache
cpack_generator: DEB
buildenv_basepath: /home/runner/buildenv
buildenv_script: tools/debian_buildenv_qt6.sh
buildenv_script: tools/debian_buildenv.sh
artifacts_name: Ubuntu 22.04 Qt6 DEB
artifacts_path: build/*.deb
artifacts_slug: ubuntu-jammy
Expand All @@ -66,9 +68,10 @@ jobs:
-DHSS1394=ON
-DMACOS_BUNDLE=ON
-DMODPLUG=ON
-DQT6=ON
-DWAVPACK=ON
-DVCPKG_TARGET_TRIPLET=x64-osx-min1012
-DVCPKG_DEFAULT_HOST_TRIPLET=x64-osx-min1012
-DVCPKG_TARGET_TRIPLET=x64-osx-min1015
-DVCPKG_DEFAULT_HOST_TRIPLET=x64-osx-min1015
# TODO: Fix this broken test on macOS
ctest_args: --exclude-regex DirectoryDAOTest.relocateDirectory
cpack_generator: DragNDrop
Expand All @@ -88,9 +91,10 @@ jobs:
-DHSS1394=ON
-DMACOS_BUNDLE=ON
-DMODPLUG=ON
-DQT6=ON
-DWAVPACK=ON
-DVCPKG_TARGET_TRIPLET=arm64-osx-min1100
-DVCPKG_DEFAULT_HOST_TRIPLET=x64-osx-min1012
-DVCPKG_DEFAULT_HOST_TRIPLET=x64-osx-min1015
# TODO: Fix this broken test on macOS
crosscompile: true
cpack_generator: DragNDrop
Expand All @@ -117,11 +121,12 @@ jobs:
-DMAD=ON
-DMEDIAFOUNDATION=ON
-DMODPLUG=ON
-DQT6=ON
-DWAVPACK=ON
cc: cl
cxx: cl
# TODO: Fix these broken tests on Windows
ctest_args: --exclude-regex '^AutoDJProcessorTest.*$'
ctest_args: --exclude-regex '^(AutoDJProcessorTest.*|CoverArtCacheTest\.loadCoverFromFile.*|CoverArtUtilTest\.extractEmbeddedCover|CoverArtUtilTest\.searchImage|TrackUpdateTest\.parseModified.*)$'
cpack_generator: WIX
compiler_cache: sccache
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
Expand Down Expand Up @@ -187,7 +192,7 @@ jobs:
with:
# This should always match the minimum required version in
# our CMakeLists.txt
cmake-version: "3.19.x"
cmake-version: "3.21.x"

- name: "[Windows] Set up MSVC Developer Command Prompt"
if: runner.os == 'Windows'
Expand Down
84 changes: 64 additions & 20 deletions CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.21)

# CMAKE_CXX_COMPILER_ID: Distinguish between "AppleClang" and "Clang"
if(POLICY CMP0025)
Expand Down Expand Up @@ -154,25 +154,19 @@ if(APPLE)
message(FATAL_ERROR "'xcode-select -v' failed with '${XCODE_SELECT_RESULT}'. You may need to install Xcode and run 'sudo xcode-select --install'.")
endif()

if(QT6)
# Minimum macOS version supported by Qt 6
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Minimum macOS version the build will be able to run on")
if(NOT VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "x64-osx-min1012")
endif()
if(VCPKG_TARGET_TRIPLET STREQUAL "arm64-osx-min1100")
# Minimum macOS version for arm64 Support
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0 CACHE STRING "Minimum macOS version the build will be able to run on")
set(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "The target architecture")
set(CMAKE_SYSTEM_PROCESSOR arm64 CACHE STRING "The target system processor")
set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "Setting this enables CMAKE_CROSSCOMPILE")
else()
if(VCPKG_TARGET_TRIPLET STREQUAL "arm64-osx-min1100")
# Minimum macOS version for arm64 Support
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0 CACHE STRING "Minimum macOS version the build will be able to run on")
set(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "The target achritecture")
set(CMAKE_SYSTEM_PROCESSOR arm64 CACHE STRING "The target system processor")
set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "Setting this enables CMAKE_CROSSCOMPILE")
if(QT6)
# Minimum macOS version supported by Qt 6
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Minimum macOS version the build will be able to run on")
else()
# Minimum macOS version supported by Qt 5.12
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "Minimum macOS version the build will be able to run on")
if(NOT VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "x64-osx-min1012")
endif()
# Needed for deployment target < 10.14
add_compile_options(-fno-aligned-allocation)
endif()
Expand Down Expand Up @@ -1802,7 +1796,7 @@ if(MSVC)
)
endif()

if(WIN32)
if(WIN32 AND NOT QT6)
# Qt 5 loads these ANGLE DLLs at runtime if the graphics driver is blocklisted.
# Qt does not link these and vcpkg does not build them as a dependency of Qt,
# so copy them manually.
Expand Down Expand Up @@ -2502,9 +2496,59 @@ if(Qt_IS_STATIC)
Qt${QT_VERSION_MAJOR}::QMacStylePlugin
)
endif()
else()
if(QT6 AND (WIN32 OR APPLE))
# Qt6 does not automatically install plugins like in Qt 5

install(IMPORTED_RUNTIME_ARTIFACTS
# platform plugins
Qt${QT_VERSION_MAJOR}::QOffscreenIntegrationPlugin
Qt${QT_VERSION_MAJOR}::QMinimalIntegrationPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/platforms"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QGifPlugin
Qt${QT_VERSION_MAJOR}::QICOPlugin
Qt${QT_VERSION_MAJOR}::QJpegPlugin
Qt${QT_VERSION_MAJOR}::QSvgPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/imageformats"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QSQLiteDriverPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/sqldrivers"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)

endif()
if(WIN32)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/platforms"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QWindowsVistaStylePlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/styles"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)
endif()
if(APPLE)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QCocoaIntegrationPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/platforms"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QMacStylePlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/styles"
RUNTIME_DEPENDENCY_SET mixxx
COMPONENT applocal)
endif()

add_custom_command(
TARGET mixxx POST_BUILD
COMMAND "${CMAKE_COMMAND}" -DCOMPONENT=applocal -DCMAKE_INSTALL_PREFIX="${CMAKE_CURRENT_BINARY_DIR}" -P cmake_install.cmake)
endif()
endif()

if(APPLE)
if(Qt_IS_STATIC OR QT6)
Expand Down Expand Up @@ -2618,8 +2662,8 @@ if(APPLE OR WIN32)
endif()
get_filename_component(QT_TRANSLATIONS ${QT_TRANSLATION_FILE} DIRECTORY)
install(
DIRECTORY "${QT_TRANSLATIONS}"
DESTINATION "${MIXXX_INSTALL_DATADIR}"
DIRECTORY "${QT_TRANSLATIONS}/"
DESTINATION "${MIXXX_INSTALL_DATADIR}/translations"
# QT 5 translations have been separated into several files, and most of the qt_xx.qm files
# contain just shortcuts to load the qtbase, qtmultimedia etc files.
FILES_MATCHING REGEX
Expand Down
13 changes: 7 additions & 6 deletions tools/debian_buildenv.sh
Expand Up @@ -67,6 +67,7 @@ case "$1" in
libflac-dev \
libgmock-dev \
libgtest-dev \
libgl1-mesa-dev \
libhidapi-dev \
libid3tag0-dev \
liblilv-dev \
Expand All @@ -78,10 +79,10 @@ case "$1" in
libopusfile-dev \
libportmidi-dev \
libprotobuf-dev \
libqt5opengl5-dev \
libqt5sql5-sqlite \
libqt5svg5-dev \
libqt5x11extras5-dev \
libqt6core5compat6-dev\
libqt6opengl6-dev \
libqt6sql6-sqlite \
libqt6svg6-dev \
librubberband-dev \
libshout-idjc-dev \
libsndfile1-dev \
Expand All @@ -97,8 +98,8 @@ case "$1" in
markdown \
portaudio19-dev \
protobuf-compiler \
qt5keychain-dev \
qtdeclarative5-dev \
qtkeychain-qt6-dev \
qt6-declarative-dev \
qml-module-qtquick-controls \
qml-module-qtquick-controls2 \
qml-module-qt-labs-qmlmodels \
Expand Down
117 changes: 0 additions & 117 deletions tools/debian_buildenv_qt6.sh

This file was deleted.