cmake: check policy first

Fix unkown policy error with higher version cmake, e.g. 3.11.4

Example of error:
> Policy "CMP0074" is not known to this version of CMake.
This commit is contained in:
Xiaofeng Wang
2019-08-28 08:06:40 +08:00
committed by Vinnie Falco
parent db2f0052ff
commit 6eb55b21da
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,7 @@ Version 267:
* Add package for Travis config
* Fix signed/unsigned mismatch in file_stdio::seek
* basic_stream dtor cannot throw
* cmake: check policy first
--------------------------------------------------------------------------------

View File

@ -8,7 +8,10 @@
#
cmake_minimum_required (VERSION 3.5.1)
cmake_policy (SET CMP0074 NEW)
if (POLICY CMP0074)
cmake_policy (SET CMP0074 NEW)
endif()
#-------------------------------------------------------------------------------