From fb97883bef9f1881f08b0005786be3ec954f5acc Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 26 Apr 2019 20:45:46 -0400 Subject: [PATCH] Build: Do not set CMP0037 on CMake 3.11.0 and above - This policy is no longer necessary because CMake issue #16062, which caused incorrect warnings to be shown, has been resolved in 3.11.0. - Thanks to Janik Rabe --- ChangeLog | 2 ++ test/CMakeLists.txt | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92470d39a..2193146aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -145,6 +145,8 @@ - Removed compile-time language settings and I18N. - Workaround for alias grep=rg in fish Thanks to Lionel Miller. +- Do not set CMP0037 on CMake 3.11.0 and above + Thanks to Janik Rabe ------ current release --------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f1f79bd12..3e37e5e3b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required (VERSION 3.0) -# See this CMake issue before complaining about the following. -# https://cmake.org/Bug/view.php?id=16062 -if(POLICY CMP0037) +# This is a work-around for the following CMake issue: +# https://gitlab.kitware.com/cmake/cmake/issues/16062 +# The issue has been fixed in CMake 3.11.0; the policy is set +# to OLD for compatibility with older versions of CMake only. +if(POLICY CMP0037 AND ${CMAKE_VERSION} VERSION_LESS "3.11.0") cmake_policy(SET CMP0037 OLD) endif()