[cmake-developers] [CMake 0011937]: Need determination of Intel C++ compiler version

Mantis Bug Tracker mantis at public.kitware.com
Mon Mar 7 14:22:22 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=11937 
====================================================================== 
Reported By:                Daniel R. Gomez
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11937
Category:                   CMake
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-03-07 14:22 EST
Last Modified:              2011-03-07 14:22 EST
====================================================================== 
Summary:                    Need determination of Intel C++ compiler version
Description: 
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.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-07 14:22 Daniel R. GomezNew Issue                                    
2011-03-07 14:22 Daniel R. GomezFile Added: icc-get-version.cmake               
    
======================================================================




More information about the cmake-developers mailing list