From 4a8602b49e90e10f7a1c8d9e06d52e37bfa6484d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 27 Jul 2016 16:26:55 +0200 Subject: [PATCH] Set CMP0056 if CMake>=3.2 --- Installation/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index c1490164b92..0058828a7e5 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -27,6 +27,17 @@ if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() +if(POLICY CMP0056) + # http://www.cmake.org/cmake/help/v3.2/policy/CMP0056.html + # + # Fix a bug: `try_compile` should use `CMAKE_EXE_LINKER_FLAGS`. + # That variable can contain important flags like + # + # -static-libstdc++ -static-libgcc + # + cmake_policy(SET CMP0056 NEW) +endif() + # Use GNUInstallDirst to get canonical paths include(GNUInstallDirs)