Set CMAKE_<lang>_COMPILER_ID for VS generators

Currently the VS generators do not support Intel C/C++ .icproj files and
the MS tools do not include a Fortran compiler.  Therefore we can always
set the C and CXX compiler IDs to "MSVC" and the Fortran ID to "Intel".

This fixes a regression in support for the Intel Fortran compiler under
the VS plugin introduced by commit cd43636c (Modernize Intel compiler
info on Windows, 2010-12-16).  The commit moved the compiler information
into platform files that only load when the proper compiler id is set.
It worked for the NMake Makefiles generator but not for the VS IDE
generator because it did not set the compiler id.
This commit is contained in:
Brad King 2011-09-02 08:37:05 -04:00
parent 83ce7c4d3c
commit 38aab37962
3 changed files with 3 additions and 12 deletions

View File

@ -105,10 +105,7 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_C_COMPILER_ID_RUN 1)
SET(CMAKE_C_PLATFORM_ID "Windows")
# TODO: Set the compiler id. It is probably MSVC but
# the user may be using an integrated Intel compiler.
# SET(CMAKE_C_COMPILER_ID "MSVC")
SET(CMAKE_C_COMPILER_ID "MSVC")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_C_COMPILER_ID_RUN)

View File

@ -117,10 +117,7 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
SET(CMAKE_CXX_PLATFORM_ID "Windows")
# TODO: Set the compiler id. It is probably MSVC but
# the user may be using an integrated Intel compiler.
# SET(CMAKE_CXX_COMPILER_ID "MSVC")
SET(CMAKE_CXX_COMPILER_ID "MSVC")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
SET(CMAKE_CXX_COMPILER_ID_RUN 1)

View File

@ -146,10 +146,7 @@ MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
SET(CMAKE_Fortran_PLATFORM_ID "Windows")
# TODO: Set the compiler id. It is probably MSVC but
# the user may be using an integrated Intel compiler.
# SET(CMAKE_Fortran_COMPILER_ID "MSVC")
SET(CMAKE_Fortran_COMPILER_ID "Intel")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)