From dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 22 Sep 2017 13:47:01 -0400 Subject: FindOpenMP: Avoid CMP0054 warnings When invoked in projects that don't set CMP0054 to NEW, FindOpenMP triggers a warning: CMake Warning (dev) at .../Modules/FindOpenMP.cmake:... (if): Policy CMP0054 is not set...Quoted variables like "c" will no longer be dereferenced when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. Set the policy within the module's scope to avoid this. Fixes: #17292 --- Modules/FindOpenMP.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 4a3edf9..595b0b3 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -75,6 +75,7 @@ # the OpenMP specification implemented by the ```` compiler. cmake_policy(PUSH) +cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced cmake_policy(SET CMP0057 NEW) # if IN_LIST function(_OPENMP_FLAG_CANDIDATES LANG) -- cgit v0.12