cmake: Bump minimum required CMake version to 3.5
[quassel.git] / CMakeLists.txt
index 225dfd6..542d362 100644 (file)
@@ -6,6 +6,8 @@
 # General setup
 #####################################################################
 
+cmake_minimum_required(VERSION 3.5)
+
 # Versions
 set(QUASSEL_MAJOR  0)
 set(QUASSEL_MINOR 13)
@@ -42,7 +44,7 @@ if (USE_CCACHE)
 endif()
 
 # Set up project
-project(Quassel C CXX)
+project(Quassel CXX)
 
 # General conveniences
 set(CMAKE_AUTOMOC ON)
@@ -51,7 +53,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 # Include various CMake modules
 include(CMakePushCheckState)
 include(CheckFunctionExists)
-include(CheckIncludeFile)
+include(CheckIncludeFileCXX)
 include(CheckCXXSourceCompiles)
 include(CMakeDependentOption)
 include(FeatureSummary)
@@ -144,12 +146,6 @@ option(WITH_LDAP "Enable LDAP authentication support if present on system" ON)
 # Setup CMake
 #####################################################################
 
-if (WITH_KDE)
-    cmake_minimum_required(VERSION 2.8.12)
-else()
-    cmake_minimum_required(VERSION 2.8.9)
-endif()
-
 # Setting COMPILE_DEFINITIONS_<CONFIG> 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 (POLICY CMP0043)
@@ -187,7 +183,7 @@ endif()
 # using -DCMAKE_DISABLE_FIND_PACKAGE_<PkgName>=TRUE
 #####################################################################
 
-set(QT_MIN_VERSION "5.2.0")
+set(QT_MIN_VERSION "5.5.0")
 add_definitions(-DHAVE_QT5)
 
 find_package(Qt5Core ${QT_MIN_VERSION} QUIET)
@@ -241,15 +237,6 @@ if (BUILD_GUI)
         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"
@@ -265,7 +252,6 @@ if (BUILD_GUI)
         )
     endif()
 
-
     if (WITH_WEBKIT)
         find_package(Qt5WebKit QUIET)
         set_package_properties(Qt5WebKit PROPERTIES TYPE RECOMMENDED
@@ -395,15 +381,13 @@ endif()
 
 # Non-Qt-based packages
 
-# zlib for compression, however we can always fall back to miniz
-find_package(ZLIB QUIET)
-set_package_properties(ZLIB PROPERTIES TYPE RECOMMENDED
+find_package(ZLIB REQUIRED)
+set_package_properties(ZLIB PROPERTIES TYPE REQUIRED
     URL "http://www.zlib.net"
     DESCRIPTION "a popular compression library"
-    PURPOSE     "Use the most common library for protocol compression, instead of the bundled miniz implementation"
+    PURPOSE     "Used for protocol compression"
 )
 
-
 if (NOT WIN32)
     # Execinfo is needed for generating backtraces
     find_package(ExecInfo QUIET)
@@ -495,13 +479,6 @@ include(QuasselInstallDirs)
 # Various config-dependent checks and settings
 #####################################################################
 
-if (NOT ZLIB_FOUND)
-    message(STATUS "zlib NOT found, using bundled miniz for compression")
-    if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
-        message(STATUS "WARNING: This may be slow on 32 bit systems!")
-    endif()
-endif()
-
 if (HAVE_SSL)
     add_definitions(-DHAVE_SSL)
 endif()
@@ -509,7 +486,7 @@ add_feature_info("SSL support in Qt" HAVE_SSL "Use secure network connections")
 
 # Check for syslog support
 if (NOT WIN32)
-    check_include_file(syslog.h HAVE_SYSLOG)
+    check_include_file_cxx(syslog.h HAVE_SYSLOG)
     add_feature_info("syslog.h" HAVE_SYSLOG "Provide support for logging to the syslog")
 endif()