Fix support for CMake < 3
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 24 Jul 2014 21:26:58 +0000 (23:26 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 24 Jul 2014 21:26:58 +0000 (23:26 +0200)
Meh. Apparently I can't just set behavior for future policies, so we
need to ensure that we're actually running CMake 3.

CMakeLists.txt

index 0ed071a..ac51b16 100644 (file)
@@ -34,10 +34,10 @@ include(CheckCXXCompilerFlag)
 # For building against Qt5, we check for an even newer cmake version below!
 cmake_minimum_required(VERSION 2.8.1 FATAL_ERROR)
 
-if(COMMAND cmake_policy)
+if(CMAKE_MAJOR_VERSION GREATER 2)
    cmake_policy(SET CMP0026 OLD)
    cmake_policy(SET CMP0043 OLD)
-endif(COMMAND cmake_policy)
+endif()
 
 # Use our own (well, and KDE's) version of some modules
 # In particular cmake's own FindQt4 and FindOpenSSL are quite buggy