guard policy setting by version checks (#2550)

* guard policy setting by version checks greater or equal
short explainations of policies being set
This commit is contained in:
Russel Waters 2020-02-12 09:42:51 -05:00 committed by GitHub
commit 7a2860bf70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,13 @@
cmake_minimum_required (VERSION 3.4)
cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0077 NEW)
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12")
#find_package uses <PACKAGENAME>_ROOT variables
cmake_policy(SET CMP0074 NEW)
endif()
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
#option honors normal variables
cmake_policy(SET CMP0077 NEW)
endif()
# compatibility for osx sierra and on
# needs to be set before project
set (CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "")