Move CMake policies

This commit is contained in:
Florian Albrechtskirchinger 2022-09-22 11:40:10 +02:00
parent e1a815f350
commit c14c484303
No known key found for this signature in database
GPG Key ID: 19618CE9B2D4BE6D

View File

@ -1,5 +1,14 @@
cmake_minimum_required(VERSION 3.1)
##
## POLICIES
##
if (POLICY CMP0077)
# Allow CMake 3.13+ to override options when using FetchContent / add_subdirectory.
cmake_policy(SET CMP0077 NEW)
endif ()
##
## PROJECT
## name and version
@ -26,11 +35,6 @@ include(ExternalProject)
## OPTIONS
##
if (POLICY CMP0077)
# Allow CMake 3.13+ to override options when using FetchContent / add_subdirectory.
cmake_policy(SET CMP0077 NEW)
endif ()
# VERSION_GREATER_EQUAL is not available in CMake 3.1
if(${JSON_MAIN_PROJECT} AND (${CMAKE_VERSION} VERSION_EQUAL 3.13 OR ${CMAKE_VERSION} VERSION_GREATER 3.13))
set(JSON_BuildTests_INIT ON)