Skip to content

Commit

Permalink
CMakeLists backwards compatibility (#2607)
Browse files Browse the repository at this point in the history
use version checks supported on older cmakes
use atleast 3.11 FindBoost.cmake as import targets are not properly
exposed on previous versions
  • Loading branch information
Russel Waters authored Feb 28, 2020
1 parent bac78d0 commit 81d9205
Show file tree
Hide file tree
Showing 2 changed files with 2,106 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 "")
Expand Down
Loading

0 comments on commit 81d9205

Please sign in to comment.