[CMake] Generator for Visual Studio 2008 with Intel C++ 11.0?

Jesse Perla jesseperla at gmail.com
Thu Feb 19 09:19:49 EST 2009


> If ICProjConvert*.exe works you might be able to jurry-rig a .bat file or
> something to convert your projects manually after CMake runs.

Here is how I got things to work:
0. It appears that the ICProjConvert***.exe is by default in the
c:\Program Files\Common Files\Intel\Shared Files\ia32\Bin directory.
It is not in the path, and note that there could be multiple versions
in the same directory if you have several versions of the intel
compiler installed.
1. Created a simple CMakeLists.txt for a project called HELLO
2. Generated using "Visual Studio 9 2008"
3. While in the build directory with the .sln file, ran the following
on the command line:"\Program Files\Common Files\Intel\Shared
Files\ia32\Bin"\ICProjConvert110 HELLO.sln /IC
4.  This seemed to work when I loaded it and used the Intel 11.0 compiler.
5. It pops out a few errors/warnings that the ZERO_CHECK and ALL_BUILD
are not compatible with the intel project system, but this doesn't
seem to cause any problems.

A few questions on implementation.
1.  I am not sure I know enough cmake to make the generator myself,
but I could try next week if noone else has time.

2. Would the basic approach be to add in a add_custom_command with the
COMMAND as a variation on this string?  If so, how would I get this to
execute at the end?

3. It would be really nice to have the appropriate compiler flags
taken from the existing intel compiler generators.
  When I generate NMake files, I use:
      cmake -DCMAKE_CXX_COMPILER=icl -G "NMake Makefiles" ../
  which I assume generates the appropriate flags.

4. But my understanding is that the visual studio generator ignores
the CMAKE_CXX_COMPILER?  So would we need to copy in the intel flags?

5. To implement, can we make a copy of the visual studio generator,
rename it in the same directory, add in the custom command to generate
(looking for the appropriate exe/directory), copy in the appropriate
compiler flags from the CMAKE_CXX_COMPILER choices?

6. Or is it better to modify the visual studio generator so that it
checks the CMAKE_CXX_COMPILER and calls the custom command conditional
on this being intel?  Would we still need to mess with the old
compiler flags?

Last:
1. It is an annoyance when using the visual studio generators
(independent of intel vs. msvc), the default project seems to be set
to the ZERO_CHECK.  The "Build Solution" choice does seem to build the
whole thing, but when you hit F5 to debug, it doesn't know the
executable associated with the ZERO_CHECK.  In inevitably right click
on my main project and choose "Set as Startup Project" to get this to
work, but again this is wiped out everytime you change cmakelists.txt.
 Is it dangerous to do this?  And is there any way to set the startup
project as the one we want?  Of course, since we could be generating
multiple executables, this would have to be some kind of a variable
set in the CMAKELists or cache.  (e.g. set(VISUAL_STUDIO_STARTUP
hello1) would set it to that executable target).


More information about the CMake mailing list