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
This commit is contained in:
Brad King
2017-09-22 13:47:01 -04:00
parent 4609aaf513
commit dd5324ab1e
+1
View File
@@ -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)