title: How to generate a Visual Studio project that uses the Intel Compiler using cmake under Windows
body: <p>I'm developing a cross-platform (Linux/Windows) application in C. I've gotten tired of maintaining both a usable Makefile and the Visual Studio solution/projects so I wanted to transition to cmake. I'm using the Intel Compiler on both platforms.</p>
  
  <p>I've downloaded cmake 3.0 on Windows and cmake 2.8 on Linux (it's the one in ubuntu 12.04 repositories). On Linux everything went smooth and the Makefiles were generated successfully. It was a simple matter of running: <code>CC=icc CXX=icc cmake ..</code>.</p>
  
  <p>On Windows, however, no matter what command I try I cannot use the Intel Compiler. The output vcxproj is always using the MSVC compiler.</p>
  
  <p>I've tried the following command:</p>
  
  <pre><code>cmake -G "Visual Studio 11 2012 Win64" -D CMAKE_C_COMPILER="C:/Program Files (x86)/Intel/Composer XE/bin/intel64/icl.exe" -D CMAKE_CXX_COMPILER="C:/Program Files (x86)/Intel/Composer XE/bin/intel64/icl.exe" ..
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>-- The C compiler identification is MSVC 17.0.61030.0
  -- The CXX compiler identification is MSVC 17.0.61030.0
  -- Check for working C compiler using: Visual Studio 11 2012 Win64
  -- Check for working C compiler using: Visual Studio 11 2012 Win64 -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working CXX compiler using: Visual Studio 11 2012 Win64
  -- Check for working CXX compiler using: Visual Studio 11 2012 Win64 -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Configuring done
  -- Generating done
  </code></pre>
  
  <p>When I change the generator to "NMake Makefiles" then icc is set as the compiler.</p>
  
  <pre><code>-- The C compiler identification is Intel 14.0.3.20140422
  -- The CXX compiler identification is Intel 14.0.3.20140422
  -- Check for working C compiler: C:/Program Files (x86)/Intel/Composer XE/bin/intel64/icl.exe
  </code></pre>
  
  <p>I'm testing this on a pretty basic project with only one source file, so my CMakeLists.txt file contains only:</p>
  
  <pre><code>project(dummy_cmake)
  
  add_executable(hellonikola main.c)
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>
  
  <p>P.S.</p>
  
  <p>cmake-gui behaves the same. I select to specify a different native compiler and give the path to icc and get the above outputs as well.</p>
  
  <p>I've tried using cmake 2.8 on Windows as well and the behaviour is the same.</p>