aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 23 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c84653..3e64f6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,24 +4,36 @@ project(QMidiPlayer VERSION 0.8.7 LANGUAGES C CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
-include(FindPkgConfig)
-find_package(Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
-find_package(Threads REQUIRED)
-pkg_search_module(fluidsynth REQUIRED fluidsynth>=2.0.0)
-pkg_search_module(rtmidi REQUIRED rtmidi)
+set(OPTIONAL_QT_DEPS "")
option(BUILD_VISUALIZATION "Build visualization plugin" ON)
if(WIN32)
+ set(OPTIONAL_QT_DEPS "WinExtras")
option(BUILD_WINEXTRA "Build Windows extra library" ON)
option(BUILD_BACKTRACE "Build backtrace library" OFF)
endif()
if(UNIX)
- option(BUILD_PORTABLE "Instruct the built binary not to search system directories" OFF)
+ option(BUILD_PORTABLE "Instruct the built binary not to search system directories" OFF)
+endif()
+
+option(USE_QT6 "Build with Qt 6" OFF)
+
+include(FindPkgConfig)
+if (USE_QT6)
+ find_package(QT NAMES Qt6 REQUIRED)
+ find_package(Qt6 REQUIRED COMPONENTS Widgets LinguistTools OPTIONAL_COMPONENTS DBus ${OPTIONAL_QT_DEPS})
+else()
+ find_package(QT NAMES Qt5 REQUIRED)
+ find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets LinguistTools OPTIONAL_COMPONENTS DBus ${OPTIONAL_QT_DEPS})
endif()
+find_package(Threads REQUIRED)
+find_package(ICU COMPONENTS uc i18n REQUIRED)
+pkg_search_module(fluidsynth REQUIRED fluidsynth>=2.0.0)
+pkg_search_module(rtmidi REQUIRED rtmidi)
add_definitions(-DAPP_VERSION=\"${PROJECT_VERSION}\")
add_definitions(-DPLUGIN_VERSION=\"${PROJECT_VERSION}\")
@@ -32,14 +44,16 @@ add_definitions(-DRC_VER_PATCH=${PROJECT_VERSION_PATCH})
add_subdirectory(core)
add_subdirectory(qmidiplayer-desktop)
add_subdirectory(sample-plugin)
-add_subdirectory(mpris-plugin)
+if (Qt${QT_VERSION_MAJOR}DBus_FOUND)
+ add_subdirectory(mpris-plugin)
+endif()
add_subdirectory(midifmt-plugin)
add_subdirectory(simple-visualization)
if(BUILD_VISUALIZATION)
add_subdirectory(visualization)
endif()
if(WIN32)
- if(BUILD_WINEXTRA)
+ if(BUILD_WINEXTRA AND Qt${QT_VERSION_MAJOR}WinExtras_FOUND)
add_subdirectory(windows-extra)
endif()
if(BUILD_BACKTRACE)