Browse Source

Merge topic 'irsl-msvc-omp-fix'

4dae55fb IRSL: Fix MSVC variable deferencing

Acked-by: Kitware Robot <[email protected]>
Merge-request: !1588
Brad King 8 years ago
parent
commit
f0b3fab179
1 changed files with 7 additions and 2 deletions
  1. 7 2
      Modules/InstallRequiredSystemLibraries.cmake

+ 7 - 2
Modules/InstallRequiredSystemLibraries.cmake

@@ -56,10 +56,13 @@
 #   Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
 #   option.  If not specified, no such option will be used.
 
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+
 set(_IRSL_HAVE_Intel FALSE)
 set(_IRSL_HAVE_MSVC FALSE)
 foreach(LANG IN ITEMS C CXX Fortran)
-  if(CMAKE_${LANG}_COMPILER_ID STREQUAL Intel)
+  if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel")
     if(NOT _IRSL_HAVE_Intel)
       get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
       if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -81,7 +84,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
       endif()
       set(_IRSL_HAVE_Intel TRUE)
     endif()
-  elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL MSVC)
+  elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
     set(_IRSL_HAVE_MSVC TRUE)
   endif()
 endforeach()
@@ -743,3 +746,5 @@ if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
       )
   endif()
 endif()
+
+cmake_policy(POP)