Skip to content

Commit

Permalink
Merge pull request mixxxdj#12604 from daschuer/qml_module_windows
Browse files Browse the repository at this point in the history
Install qml module on Windows
  • Loading branch information
JoergAtGithub authored Feb 19, 2024
2 parents fc26fea + 504d568 commit d21cb08
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 17 deletions.
140 changes: 133 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2607,11 +2607,20 @@ if(QT6)
find_package(QT 6.2 NAMES Qt6 COMPONENTS Core REQUIRED)
list(APPEND QT_EXTRA_COMPONENTS "SvgWidgets")
list(APPEND QT_EXTRA_COMPONENTS "Core5Compat")
else()
find_package(QT 5.12 NAMES Qt5 COMPONENTS Core REQUIRED)
endif()
if(QML)
list(APPEND QT_EXTRA_COMPONENTS "Quick")
list(APPEND QT_EXTRA_COMPONENTS "LabsQmlModels")
list(APPEND QT_EXTRA_COMPONENTS "QuickControls2")
list(APPEND QT_EXTRA_COMPONENTS "QuickControls2Impl")
list(APPEND QT_EXTRA_COMPONENTS "QuickLayouts")
list(APPEND QT_EXTRA_COMPONENTS "QuickShapesPrivate")
list(APPEND QT_EXTRA_COMPONENTS "QuickTemplates2")
list(APPEND QT_EXTRA_COMPONENTS "QuickWidgets")
else()
find_package(QT 5.12 NAMES Qt5 COMPONENTS Core REQUIRED)
list(APPEND QT_EXTRA_COMPONENTS "QmlWorkerScript")
list(APPEND QT_EXTRA_COMPONENTS "ShaderTools")
endif()
find_package(Qt${QT_VERSION_MAJOR}
COMPONENTS
Expand Down Expand Up @@ -2709,6 +2718,14 @@ if(QML)
# qt_finalize_target takes care that the resources :/mixxx.org/imports/Mixxx/
# and :/mixxx.org/imports/Mixxx/Controls are placed into beginning of the binary
qt_finalize_target(mixxx)

install(
DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/res/qml"
DESTINATION
"${MIXXX_INSTALL_DATADIR}"
)

endif()

option(DEBUG_ASSERTIONS_FATAL "Fail if debug become true assertions" OFF)
Expand Down Expand Up @@ -2797,6 +2814,103 @@ else()
DESTINATION "${MIXXX_INSTALL_DATADIR}/sqldrivers"
COMPONENT applocal)

if(QML)
install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::LabsQmlModels
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QuickControls2
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QuickControls2Impl
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QuickLayouts
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QuickShapesPrivate
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QuickTemplates2
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::QmlWorkerScript
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

install(IMPORTED_RUNTIME_ARTIFACTS
Qt${QT_VERSION_MAJOR}::ShaderTools
DESTINATION "${MIXXX_INSTALL_DATADIR}"
COMPONENT applocal)

#install qml6-module-qt5compat-graphicaleffects
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/Qt5Compat/GraphicalEffects"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/Qt5Compat"
COMPONENT applocal)

# install qml6-module-qtqml-workerscript
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQml/WorkerScript"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQml"
COMPONENT applocal)

# install qml6-module-qtquick-controls
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/Controls"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
COMPONENT applocal)

# install qml6-module-qtquick-layouts
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/Layouts"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
COMPONENT applocal)

# install qml6-module-qtquick-nativestyle
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/NativeStyle"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
COMPONENT applocal)

# install qml6-module-qtquick-shapes
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/Shapes"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
COMPONENT applocal)

# install qml6-module-qtquick-templates
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/Templates"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
COMPONENT applocal)

# qml6-module-qtquick-window
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/Window"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
COMPONENT applocal)

# install qml6-module-qt-labs-qmlmodels
install(
DIRECTORY "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/Qt/labs/qmlmodels"
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/Qt/labs"
COMPONENT applocal)

endif()

if(WIN32)
install(IMPORTED_RUNTIME_ARTIFACTS Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin
DESTINATION "${MIXXX_INSTALL_DATADIR}/platforms"
Expand All @@ -2814,9 +2928,7 @@ else()
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)
set(APPLOCAL_COMPONENT_DEFINED true)
endif()
endif()

Expand Down Expand Up @@ -3589,8 +3701,22 @@ set(CPACK_DEBIAN_PACKAGE_SECTION "sound")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "pdf-viewer, pulseaudio-utils")
set(CPACK_DEBIAN_PACKAGE_REPLACES "mixxx-data")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5sql5-sqlite, fonts-open-sans, fonts-ubuntu,\
qml-module-qtquick-controls, qml-module-qtquick-controls2, qml-module-qt-labs-qmlmodels, qml-module-qtquick-shapes, qt6-qpa-plugins")
if(QT6)
if(QML)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"libqt6sql6-sqlite, fonts-open-sans, fonts-ubuntu, qt6-qpa-plugins,\
qml6-module-qt5compat-graphicaleffects, qml6-module-qtquick-controls, qml6-module-qtquick-layouts, qml6-module-qtquick-nativestyle, qml6-module-qtquick-templates, qml6-module-qtquick-window, qml6-module-qt-labs-qmlmodels, qml6-module-qtquick-shapes, qml6-module-qtqml-workerscript")
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt6sql6-sqlite, fonts-open-sans, fonts-ubuntu, qt6-qpa-plugins")
endif()
else()
if(QML)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5sql5-sqlite, fonts-open-sans, fonts-ubuntu,\
qml-module-qtquick-controls, qml-module-qtquick-controls2, qml-module-qt-labs-qmlmodels, qml-module-qtquick-shapes")
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5sql5-sqlite, fonts-open-sans, fonts-ubuntu")
endif()
endif()
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_PACKAGE_HOMEPAGE_URL}")
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
Expand Down
7 changes: 2 additions & 5 deletions packaging/debian/control.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ Build-Depends: debhelper (>= 11),
markdown,
libglu1-mesa-dev,
qtkeychain-qt6-dev,
qt6-declarative-dev,
qt6-declarative-private-dev,
qt6-base-private-dev,
libqt6core5compat6-dev,
libqt6opengl6-dev,
libqt6sql6-sqlite,
libqt6svg6-dev,
qml-module-qtquick-controls,
qml-module-qtquick-controls2,
qml-module-qt-labs-qmlmodels,
qml-module-qtquick-shapes,
cmake (>= 3.13),
libjack-dev,
portaudio19-dev,
Expand Down
18 changes: 13 additions & 5 deletions tools/debian_buildenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ case "$1" in
libprotobuf-dev \
libqt6core5compat6-dev\
libqt6opengl6-dev \
libqt6shadertools6-dev \
libqt6sql6-sqlite \
libqt6svg6-dev \
librubberband-dev \
Expand All @@ -99,11 +100,18 @@ case "$1" in
portaudio19-dev \
protobuf-compiler \
qtkeychain-qt6-dev \
qt6-declarative-dev \
qml-module-qtquick-controls \
qml-module-qtquick-controls2 \
qml-module-qt-labs-qmlmodels \
qml-module-qtquick-shapes \
qt6-declarative-private-dev \
qt6-base-private-dev \
qt6-qpa-plugins \
qml6-module-qt5compat-graphicaleffects \
qml6-module-qtqml-workerscript \
qml6-module-qtquick-controls \
qml6-module-qtquick-layouts \
qml6-module-qtquick-nativestyle \
qml6-module-qtquick-shapes \
qml6-module-qtquick-templates \
qml6-module-qtquick-window \
qml6-module-qt-labs-qmlmodels \
"${PACKAGES_EXTRA[@]}"
;;
*)
Expand Down

0 comments on commit d21cb08

Please sign in to comment.