Revert "Increase CMake minimum version to 3.0"
authorCampbell Barton <ideasman42@gmail.com>
Mon, 9 Nov 2015 15:52:29 +0000 (02:52 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 9 Nov 2015 15:53:10 +0000 (02:53 +1100)
This reverts commit ff3cf93405e63fa367f64412bcfe96b382b24b38.

Turns out distros only a year old still use CMake 2.8x

CMakeLists.txt
intern/ghost/test/CMakeLists.txt

index 38a9037ef149cb9dbcd383b4f2ae3b73d3248db7..1b5a0ed81e5d2cde4bae0803e12baab7a6ae0ce7 100644 (file)
@@ -45,7 +45,12 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
        endif()
 endif()
 
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
+       # keep until CMake-3.0 is min requirement
+       cmake_policy(SET CMP0043 OLD)
+endif()
 
 if(NOT EXECUTABLE_OUTPUT_PATH)
        set(FIRST_RUN TRUE)
@@ -71,8 +76,18 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO  NDEBU
 #-----------------------------------------------------------------------------
 # Set policy
 
-# Simplify variable reference and escape sequence evaluation
-cmake_policy(SET CMP0053 NEW)
+# see "cmake --help-policy CMP0003"
+# So library linking is more sane
+cmake_policy(SET CMP0003 NEW)
+
+# So BUILDINFO and BLENDERPATH strings are automatically quoted
+cmake_policy(SET CMP0005 NEW)
+
+# So syntax problems are errors
+cmake_policy(SET CMP0010 NEW)
+
+# Input directories must have CMakeLists.txt
+cmake_policy(SET CMP0014 NEW)
 
 #-----------------------------------------------------------------------------
 # Load some macros.
@@ -484,6 +499,11 @@ endif()
 # Apple
 
 if(APPLE)
+       if(${CMAKE_VERSION} VERSION_LESS 3.0) # else breaks setting CMP0043 policy
+               cmake_minimum_required(VERSION 2.8.8)
+               cmake_policy(VERSION 2.8.8)
+       endif()
+
        if(NOT CMAKE_OSX_ARCHITECTURES)
                set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
                "Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
@@ -493,8 +513,12 @@ if(APPLE)
        execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
        if(${MAC_SYS} MATCHES 15)
                set(OSX_SYSTEM 10.11)
+               # throw an error here, older cmake cannot handle 2 digit subversion!
+               cmake_minimum_required(VERSION 3.0.0)
        elseif(${MAC_SYS} MATCHES 14)
                set(OSX_SYSTEM 10.10)
+               # throw an error here, older cmake cannot handle 2 digit subversion!
+               cmake_minimum_required(VERSION 3.0.0)
        elseif(${MAC_SYS} MATCHES 13)
                set(OSX_SYSTEM 10.9)
        elseif(${MAC_SYS} MATCHES 12)
index 00136dc8327bc5fee7e68bdddffcc444cc8de3a3..e1475966d47e4b720fc7eb8b18d270c3e71be0f8 100644 (file)
@@ -1,5 +1,8 @@
 
-cmake_minimum_required(VERSION 3.0.0)
+cmake_policy(SET CMP0003 NEW)
+cmake_policy(SET CMP0005 NEW)
+
+cmake_minimum_required(VERSION 2.8)
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../..//build_files/cmake/Modules")