]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Check CMake minor version support for VERSION_LESS_EQUAL 1490/head
authorErik Webb <erikwebb@google.com>
Thu, 3 Jan 2019 20:26:20 +0000 (15:26 -0500)
committerErik Webb <erikwebb@google.com>
Thu, 3 Jan 2019 20:26:20 +0000 (15:26 -0500)
VERSION_LESS_EQUAL is only available to CMake 3.7+. This adds additional
logic to check that CMAKE_MINOR_VERSION is at least 7.

Fixes #1489

build/cmake/CMakeLists.txt

index 833730716f0fd4937cff79e625993be25ea7fcc2..f72f3f458cdebf3d8856833a2863618c9e6eb0ca 100644 (file)
@@ -12,9 +12,9 @@ cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
 # As of 2018-12-26 ZSTD has been validated to build with cmake version 3.13.2 new policies. 
 # Set and use the newest cmake policies that are validated to work 
 set(ZSTD_MAX_VALIDATED_CMAKE_VERSION "3.13.2") 
-if("${CMAKE_MAJOR_VERSION}" LESS 3) # Cmake version 2 does not understand the VERSION_LESS_EQUAL operator
+if("${CMAKE_MAJOR_VERSION}" LESS 3) # Cmake version <3.7 does not understand the VERSION_LESS_EQUAL operator
   set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") 
-else()
+elseif(("${CMAKE_MAJOR_VERSION}" EQUAL 3 AND "${CMAKE_MINOR_VERSION}" GREATER 6) OR ("${CMAKE_MAJOR_VERSION}" GREATER 3))
   if("${CMAKE_VERSION}" VERSION_LESS_EQUAL "${ZSTD_MAX_VALIDATED_CMAKE_VERSION}") 
     set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") 
   else()