From 58a616dea3027a968d0244cedadf814849a5eedf Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Mon, 5 Oct 2009 14:39:28 -0400
Subject: Fix Preprocess test for Intel on Windows

We need to leave out the '%' character from tests with the Intel
compiler.  Since '%' needs to be written '%%' in NMake when not using a
response file but just '%' when using a response file, we just skip the
character for now.  It works with MSVC in NMake only because that
compiler expects '%%' inside response files, which do get used.
---
 Tests/Preprocess/CMakeLists.txt | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index f154b6f..b4ec17c 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -117,8 +117,9 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
 endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
 
 set(EXPR_OP1 "/")
-if(NOT MSVC OR PP_NMAKE)
-  # MSVC cl: %
+if((NOT MSVC OR PP_NMAKE) AND
+   NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
+  # MSVC cl, Intel icl: %
   # When the cl compiler is invoked from the command line then % must
   # be written %% (to distinguish from %ENV% syntax).  However cl does
   # not seem to accept the syntax when it is invoked from inside a
@@ -128,9 +129,14 @@ if(NOT MSVC OR PP_NMAKE)
   # line.  Currently only NMake supports running cl with a response
   # file.  Supporting other make tools would require CMake to generate
   # response files explicitly for each object file.
+  #
+  # When the icl compiler is invoked from the command line then % must
+  # be written just '%'.  However nmake requires '%%' except when using
+  # response files.  Currently we have no way to affect escaping based
+  # on whether flags go in a response file, so we just have to skip it.
   set(STRING_EXTRA "${STRING_EXTRA}%")
   set(EXPR_OP1 "%")
-endif(NOT MSVC OR PP_NMAKE)
+endif()
 
 # General: \"
 # Make tools do not reliably accept \\\" syntax:
-- 
cgit v0.12