CMakeLists backwards compatibility (#2607)

use version checks supported on older cmakes
use atleast 3.11 FindBoost.cmake as import targets are not properly
exposed on previous versions
This commit is contained in:
Russel Waters 2020-02-27 21:37:34 -05:00 committed by GitHub
commit 81d92057d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2106 additions and 2 deletions

View file

@ -1,13 +1,19 @@
cmake_minimum_required (VERSION 3.4)
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12")
if (CMAKE_VERSION VERSION_GREATER 3.12 OR CMAKE_VERSION VERSION_EQUAL 3.12)
#find_package uses <PACKAGENAME>_ROOT variables
cmake_policy(SET CMP0074 NEW)
endif()
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
if (CMAKE_VERSION VERSION_GREATER 3.13 OR CMAKE_VERSION VERSION_EQUAL 3.13)
#option honors normal variables
cmake_policy(SET CMP0077 NEW)
endif()
if (CMAKE_VERSION VERSION_LESS 3.11)
# compatibility for boost import targets use bundled 3.11 FindBoost.cmake
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/legacyModules")
endif ()
# compatibility for osx sierra and on
# needs to be set before project
set (CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "")

File diff suppressed because it is too large Load diff