Skip to content

Commit

Permalink
Merge branch 'main' into lp1937941-sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jul 30, 2021
2 parents 705d07b + ec6db45 commit 1a65cf6
Show file tree
Hide file tree
Showing 54 changed files with 2,418 additions and 712 deletions.
195 changes: 122 additions & 73 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/control/controleffectknob.cpp
src/control/controlencoder.cpp
src/control/controlindicator.cpp
src/control/controlindicatortimer.cpp
src/control/controllinpotmeter.cpp
src/control/controllogpotmeter.cpp
src/control/controlmodel.cpp
Expand Down Expand Up @@ -1404,27 +1405,59 @@ if(UNIX AND NOT APPLE)
)

option(INSTALL_USER_UDEV_RULES "Install user udev rule file for USB HID and Bulk controllers" ON)
if (INSTALL_USER_UDEV_RULES)
install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/res/linux/mixxx-usb-uaccess.rules"
DESTINATION
"${MIXXX_INSTALL_DATADIR}/udev/rules.d"
)
install(CODE "
message(STATUS \"Important Note: Installation of udev rules\n\"
\"The udev rule file for USB HID and Bulk controller permissions will be\n\"
\"installed to:\n\"
\" ${CMAKE_INSTALL_PREFIX}/${MIXXX_INSTALL_DATADIR}/udev/rules.d.\n\"
\"If you are installing Mixxx from source for your own use, copy\n\"
\"mixxx-usb-uaccess.rules to /etc/udev/rules.d/ and run:\n\"
\" udevadm control --reload-rules && udevadm trigger\n\"
\"as root to load the rules.\n\"
\"If you are building a package for a distribution, the correct directory for\n\"
\"system rules is either /lib/udev/rules.d (e.g. Debian, Fedora) or\n\"
\"/usr/lib/udev/rules.d (e.g. Arch Linux) with an appropriate priority prefix.\n\"
\"Adjust your package script accordingly and set -DINSTALL_USER_UDEV_RULES=OFF\")
")
if(INSTALL_USER_UDEV_RULES)
set(MIXXX_UDEVDIR "${MIXXX_INSTALL_DATADIR}/udev")
if (CMAKE_INSTALL_PREFIX STREQUAL "/usr" OR CMAKE_INSTALL_PREFIX STREQUAL "/" )
# /usr and / install prefixes at treated by cmake GNUInstallDirs as
# synonym for "system location". In this case we can look up the correct udevdir
# using pkg-config.
# See: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#special-cases
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules( PKGCONFIG_UDEV udev)
if (PKGCONFIG_UDEV_FOUND)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=udevdir udev
OUTPUT_VARIABLE PKGCONFIG_UDEVDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(PKGCONFIG_UDEVDIR)
file(TO_CMAKE_PATH "${PKGCONFIG_UDEVDIR}" MIXXX_UDEVDIR)
endif()
endif()
endif()
endif()
if (MIXXX_UDEVDIR STREQUAL "${MIXXX_INSTALL_DATADIR}/udev")
install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/res/linux/mixxx-usb-uaccess.rules"
DESTINATION
"${MIXXX_UDEVDIR}/rules.d"
)
install(CODE "
message(STATUS \"Important Note: Installation of udev rules\n\"
\"The udev rule file for USB HID and Bulk controller permissions have been\n\"
\"installed to:\n\"
\" ${MIXXX_UDEVDIR}/rules.d.\n\"
\"If you are installing Mixxx from source for your own use, copy\n\"
\"mixxx-usb-uaccess.rules to /etc/udev/rules.d/ and run:\n\"
\" udevadm control --reload-rules && udevadm trigger\n\"
\"as root to load the rules.\n\"
\"If you are building a package for a distribution, the correct directory for\n\"
\"system rules is either /lib/udev/rules.d (e.g. Debian, Fedora) or\n\"
\"/usr/lib/udev/rules.d (e.g. Arch Linux) with an appropriate priority prefix.\n\"
\"Adjust your package script accordingly and set -DINSTALL_USER_UDEV_RULES=OFF\")
")
else()
install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/res/linux/mixxx-usb-uaccess.rules"
DESTINATION
"${MIXXX_UDEVDIR}/rules.d"
RENAME
"69-mixxx-usb-uaccess.rules"
)
endif()
endif()
endif()

Expand Down Expand Up @@ -2065,6 +2098,47 @@ target_link_libraries(mixxx-lib PUBLIC
Qt5::Widgets
Qt5::Xml)
target_compile_definitions(mixxx-lib PUBLIC QT_TABLET_SUPPORT QT_USE_QSTRINGBUILDER)
get_target_property(QT5_TYPE Qt5::Core TYPE)
if(QT5_TYPE STREQUAL "STATIC_LIBRARY")

# NOTE(rryan): If you are adding a plugin here, you must also
# update src/mixxxapplication.cpp to define a Q_IMPORT_PLUGIN
# for it. Not all imageformats plugins are built as .libs when
# building Qt statically on Windows. Check the build environment
# to see exactly what's available as a standalone .lib vs linked
# into Qt .libs by default.

target_link_libraries(mixxx-lib PRIVATE
# platform plugins
Qt5::QOffscreenIntegrationPlugin
Qt5::QMinimalIntegrationPlugin

# imageformats plugins
Qt5::QGifPlugin
Qt5::QICOPlugin
Qt5::QJpegPlugin
Qt5::QSvgPlugin

# sqldrivers
Qt5::QSQLiteDriverPlugin
)

if(WIN32)
target_link_libraries(mixxx-lib PRIVATE
Qt5::QWindowsIntegrationPlugin
Qt5::QWindowsVistaStylePlugin
)
endif()

if(APPLE)
target_link_libraries(mixxx-lib PRIVATE
Qt5::QCocoaIntegrationPlugin
Qt5::QMacStylePlugin
)
endif()

endif()

if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
find_package(Qt5 COMPONENTS X11Extras DBus REQUIRED)
Expand All @@ -2075,9 +2149,7 @@ if(UNIX AND NOT APPLE)
Qt5::DBus
)
elseif(WIN32)
get_target_property(QT5_TYPE Qt5::Core TYPE)
if(QT5_TYPE STREQUAL "STATIC_LIBRARY")
target_compile_definitions(mixxx-lib PUBLIC QT_NODLL)
target_link_libraries(mixxx-lib PRIVATE
# Pulled from qt-4.8.2-source\mkspecs\win32-msvc2010\qmake.conf
# QtCore
Expand Down Expand Up @@ -2111,32 +2183,6 @@ elseif(WIN32)
uxtheme # ?
version # ?
wtsapi32 # ?

# NOTE(rryan): If you are adding a plugin here, you must also
# update src/mixxxapplication.cpp to define a Q_IMPORT_PLUGIN
# for it. Not all imageformats plugins are built as .libs when
# building Qt statically on Windows. Check the build environment
# to see exactly what's available as a standalone .lib vs linked
# into Qt .libs by default.

# iconengines plugins
Qt5::QSvgIconPlugin

# imageformats plugins
Qt5::QGifPlugin
Qt5::QICOPlugin
Qt5::QJpegPlugin
Qt5::QSvgPlugin
Qt5::QTgaPlugin

# platform plugins (new in Qt5 for Windows)
Qt5::QWindowsIntegrationPlugin

# styles (new in Qt5 for Windows)
Qt5::QWindowsVistaStylePlugin

# sqldrivers (new in Qt5? or did we just start enabling them)
Qt5::QSQLiteDriverPlugin
)

find_library(QT5FONTDATABASESUPPORT_LIBRARY Qt5FontDatabaseSupport)
Expand Down Expand Up @@ -2872,30 +2918,33 @@ set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/packaging/CPackConfig.cmake"
include(CPack)

if(APPLE AND MACOS_BUNDLE)
macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var _prefix)
get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION)
if(EXISTS "${_qt_plugin_path}")
get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME)
get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH)
get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME)
set(_qt_plugin_dest "${_prefix}/Contents/PlugIns/${_qt_plugin_type}")
install(FILES "${_qt_plugin_path}"
DESTINATION "${_qt_plugin_dest}")
set(${_qt_plugins_var}
"${${_qt_plugins_var}};\$ENV{DEST_DIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}")
else()
message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found")
endif()
endmacro()


install_qt5_plugin(Qt5::QCocoaIntegrationPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QSQLiteDriverPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QMacStylePlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QSvgPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QSvgIconPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QJpegPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QGifPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
if(NOT QT5_TYPE STREQUAL "STATIC_LIBRARY")
macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var _prefix)
get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION)
if(EXISTS "${_qt_plugin_path}")
get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME)
get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH)
get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME)
set(_qt_plugin_dest "${_prefix}/Contents/PlugIns/${_qt_plugin_type}")
install(FILES "${_qt_plugin_path}"
DESTINATION "${_qt_plugin_dest}")
set(${_qt_plugins_var}
"${${_qt_plugins_var}};\$ENV{DEST_DIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}")
else()
message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found")
endif()
endmacro()

install_qt5_plugin(Qt5::QCocoaIntegrationPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QMacStylePlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QOffscreenIntegrationPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QMinimalIntegrationPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QSvgPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QJpegPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QGifPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QICOPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
install_qt5_plugin(Qt5::QSQLiteDriverPlugin BUNDLE_LIBS "${MIXXX_INSTALL_PREFIX}")
endif()

set(BUNDLE_NAME "${MIXXX_INSTALL_PREFIX}")
set(BUNDLE_DIRS "${CMAKE_PREFIX_PATH}/lib;${Qt5Widgets_DIR}/../..")
Expand Down
Loading

0 comments on commit 1a65cf6

Please sign in to comment.