Skip to content

Commit

Permalink
Better support for newer CMake's
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored and vitaut committed Jul 11, 2018
1 parent 2a4cd6d commit 0eb01b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
message(STATUS "CMake version: ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 3.1.0...3.11)

cmake_minimum_required(VERSION 3.1.0)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_VERSION})
endif()

# Determine if fmt is built as a subproject (using add_subdirectory)
# or if it is the master project.
set(MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MASTER_PROJECT ON)
message(STATUS "CMake version: ${CMAKE_VERSION}")
endif ()

# Joins arguments and places the results in ${result_var}.
Expand Down

1 comment on commit 0eb01b8

@whannes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work with MSVC 2017 native cmake support, see: #809

Please sign in to comment.