From 30b1641ff4e74b4dd2958d47e39a5023d8f166c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Delaitre?= Date: Wed, 14 Feb 2018 14:26:44 +1300 Subject: [PATCH] Fix wrong check of the CMAKE_VERSION (#602) `CMAKE_VERSION_MAJOR` is just the first component of the CMake version (e.g. 3 for 3.10.1) which compares less than `3.7.9` if it is less than 3. The proper variable to compare is `CMAKE_VERSION` which contains the full version number. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4ab478..dcb6d89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ endif () # when minimum version required is 3.8.0 remove if below # both branches do exactly the same thing -if (CMAKE_MAJOR_VERSION VERSION_LESS 3.7.9) +if (CMAKE_VERSION VERSION_LESS 3.7.9) if (NOT MSVC) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)