Fix CMake warning about minimum version when trying to find KF5
authorMilian Wolff <mail@milianw.de>
Sun, 22 Jan 2017 00:01:08 +0000 (01:01 +0100)
committerMilian Wolff <mail@milianw.de>
Sun, 22 Jan 2017 00:02:08 +0000 (01:02 +0100)
Disable even trying to build the GUI when we deal with a CMake older
than 2.8.12.

CMake Warning (dev) at /home/milian/projects/compiled/kf5/share/ECM/modules/ECMFindModuleHelpers.cmake:133 (message):
  Your project should require at least CMake 2.8.12 to use FindKF5.cmake
Call Stack (most recent call first):
  /home/milian/projects/compiled/kf5/share/ECM/find-modules/FindKF5.cmake:52 (ecm_find_package_version_check)
  CMakeLists.txt:35 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMakeLists.txt

index 8fb2cf0..a643db6 100644 (file)
@@ -1,4 +1,10 @@
-cmake_minimum_required(VERSION 2.8.9)
+if (CMAKE_VERSION VERSION_LESS "2.8.12")
+    cmake_minimum_required(VERSION 2.8.9)
+    set(HEAPTRACK_BUILD_GUI OFF)
+else()
+    cmake_minimum_required(VERSION 2.8.12)
+endif()
+
 project(heaptrack)
 enable_testing()