summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenMP.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-22 17:47:01 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-22 17:50:35 (GMT)
commitdd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa (patch)
treeebb8853d3a3c3d3f4eeb454dd4633f1c9fe84a03 /Modules/FindOpenMP.cmake
parent4609aaf513ffd6f253ec7c8a8bca6bb93d7eede5 (diff)
downloadCMake-dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa.zip
CMake-dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa.tar.gz
CMake-dd5324ab1e68d745e0e83e0d0fe75fd5c9774bfa.tar.bz2
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
Diffstat (limited to 'Modules/FindOpenMP.cmake')
-rw-r--r--Modules/FindOpenMP.cmake1
1 files changed, 1 insertions, 0 deletions
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 ``<lang>`` 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)