From 6c55f65d07a972dbd2d1668aab2e0056ccdd52fc Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Fri, 6 Dec 2019 00:15:14 -0500 Subject: [PATCH] Set cmake policy CMP0075, to have check_include_file use the value of CMAKE_REQUIRED_LIBRARIES (currently, adds -lm). See issue #510. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 569462f..0008cbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,12 @@ if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() +# Include file check macros honor CMAKE_REQUIRED_LIBRARIES +# i.e. the check_include_file() calls will include -lm when checking. +if(POLICY CMP0075) + cmake_policy(SET CMP0075 NEW) +endif() + include(CTest) if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING AND -- 2.40.0