MantisBT - CMake
View Issue Details
0011937CMakeCMakepublic2011-03-07 14:222012-09-03 16:01
Daniel Richard G. 
Brad King 
normalfeaturealways
closedduplicate 
CMake 2.8.4 
 
0011937: Need determination of Intel C++ compiler version
When the MSVC compiler is used, CMake will determine the version for you and set MSVC_VERSION accordingly, as well as set MSVC60, MSVC71, MSVC80 et al.

When you use the Intel C++ compiler, however, you don't get any information on the compiler version. This can be a problem if you want to support multiple versions of the compiler, using mutually-incompatible compiler flags.

I've put together a code fragment, modeled on the MSVC version-finding part of Modules/Platform/Windows-cl.cmake, that does this for ICC. It is attached.

Some notes:

* In modifying the MSVC version-finding code, I generally translated MSVC->ICC and CL->ICL. The terms "ICC" versus "ICL" are related in much the same way as "MSVC" versus "CL".

* This fragment can be added to Modules/Platform/Windows-icl.cmake (in the source repository) or Modules/Platform/Windows-Intel.cmake (in 2.8.4).

* The code refers to a C file CMakeTestNMakeICLVersion.c, which contains the following:

    VERSION=__INTEL_COMPILER

However, with some tweaking, you could have Windows-cl.cmake and this code make use of the same file, by combining them into e.g.

    VERSION_CL=_MSC_VER
    VERSION_ICL=__INTEL_COMPILER

and adjusting the regexes appropriately.

* This code only covers the case of the Intel compiler used with a makefile generator. ICC can be used within Visual Studio, and the various ICC${version} and ICC_VERSION variables ought to be available in that case, too. I only use ICC with the "NMake Makefiles" generator, however, so making that work is a bit out of my purview.
No tags attached.
duplicate of 0006251closed Brad King Provide compiler version information 
? icc-get-version.cmake (2,150) 2011-03-07 14:22
https://public.kitware.com/Bug/file/3739/icc-get-version.cmake
Issue History
2011-03-07 14:22Daniel Richard G.New Issue
2011-03-07 14:22Daniel Richard G.File Added: icc-get-version.cmake
2012-04-19 12:13David ColeNote Added: 0029257
2012-04-19 12:13David ColeAssigned To => Brad King
2012-04-19 12:13David ColeStatusnew => assigned
2012-04-19 13:55Brad KingNote Added: 0029260
2012-04-19 13:55Brad KingRelationship addedduplicate of 0006251
2012-04-19 13:55Brad KingStatusassigned => resolved
2012-04-19 13:55Brad KingResolutionopen => duplicate
2012-09-03 16:01David ColeNote Added: 0030864
2012-09-03 16:01David ColeStatusresolved => closed

Notes
(0029257)
David Cole   
2012-04-19 12:13   
Is this fixed in 2.8.8? Or is there more to do?
(0029260)
Brad King   
2012-04-19 13:55   
Issue 0006251 subsumes this issue so I'm resolving this one as a duplicate.

It was partially resolved in CMake 2.8.8. See 0006251:0029259.
(0030864)
David Cole   
2012-09-03 16:01   
Closing resolved issues that have not been updated in more than 4 months.