From 746bbd08cc3e3945596b52d60d34bfb0f4c0cdb2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 24 Jan 2018 16:25:28 +0100 Subject: [PATCH] Use C++11 for tests during CMake configuration if necessary Enable CMake policy CMP0067 to ensure that the tests are done using the same C++ dialect that is actually used for compiling the library. --- build/cmake/policies.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/cmake/policies.cmake b/build/cmake/policies.cmake index 843b593aef..46c35011a4 100644 --- a/build/cmake/policies.cmake +++ b/build/cmake/policies.cmake @@ -48,3 +48,8 @@ if(POLICY CMP0054) # only interpret if() arguments as variables or keywords when unquoted cmake_policy(SET CMP0054 NEW) endif() + +if(POLICY CMP0067) + # Honor language standard in try_compile() source-file signature. + cmake_policy(SET CMP0067 NEW) +endif()