X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=CMakeLists.txt;h=681cceb79e2aae5040f8d5d6e09281edd92af2e0;hb=f84a3fd303cbea73a7c9b3839e417862fea43baa;hp=d89a300aa26a1c2c1b6804ef029e135a55c2c4f7;hpb=620cd1aa35e05099b3f84400dd33afc207c98244;p=quassel.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d89a300a..681cceb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,12 +127,12 @@ endif() # Setting COMPILE_DEFINITIONS_ is deprecated since CMake 3.0 in favor of generator expressions. # These have existed since CMake 2.8.10; until we depend on that, we have to explicitly enable the old policy. -if (CMAKE_MAJOR_VERSION GREATER 2) +if (POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() # Honor visibility settings for all target types -if (CMAKE_VERSION VERSION_GREATER 3.3) +if (POLICY CMP0063) cmake_policy(SET CMP0063 NEW) endif() @@ -215,13 +215,22 @@ if (USE_QT5) ) endif() - find_package(Phonon4Qt5 QUIET) - set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED - URL "https://projects.kde.org/projects/kdesupport/phonon" - DESCRIPTION "a multimedia abstraction library" + find_package(Qt5Multimedia QUIET) + set_package_properties(Qt5Multimedia PROPERTIES TYPE RECOMMENDED + URL "http://qt.digia.com" + DESCRIPTION "Multimedia support for Qt5" PURPOSE "Required for audio notifications" ) + if (NOT Qt5Multimedia_FOUND) + find_package(Phonon4Qt5 QUIET) + set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED + URL "https://projects.kde.org/projects/kdesupport/phonon" + DESCRIPTION "a multimedia abstraction library" + PURPOSE "Required for audio notifications" + ) + endif() + find_package(LibsnoreQt5 0.7.0 QUIET) set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL URL "https://projects.kde.org/projects/playground/libs/snorenotify" @@ -438,6 +447,11 @@ endif() cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + +if (USE_QT5 AND Qt5_POSITION_INDEPENDENT_CODE) + set(CMAKE_REQUIRED_FLAGS "-fPIC -DQT_NO_VERSION_TAGGING") +endif() + check_cxx_source_compiles(" #include \"qglobal.h\" #if defined QT_NO_SSL