From af40e8c31256095eb8436b798fa1fbc0c71b0319 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 11 Oct 2013 13:40:43 -0400 Subject: [PATCH] VS: Detect Intel Fortran compiler id and version Teach CMakeDetermineCompilerId to use a .vfproj project file to build the Fortran compiler id source file under the Visual Studio generators. --- Modules/CMakeDetermineCompilerId.cmake | 6 ++- Modules/CMakeDetermineFortranCompiler.cmake | 4 -- Modules/CompilerId/VS-Intel.vfproj.in | 42 +++++++++++++++++++++ Source/cmGlobalVisualStudio7Generator.cxx | 1 - 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 Modules/CompilerId/VS-Intel.vfproj.in diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 4c2b506b0..e591f2c42 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -114,7 +114,11 @@ Id flags: ${testflags} set(id_platform ${CMAKE_VS_PLATFORM_NAME}) set(id_lang "${lang}") set(id_cl cl.exe) - if(NOT "${vs_version}" VERSION_LESS 10) + if(lang STREQUAL Fortran) + set(v Intel) + set(ext vfproj) + set(id_cl ifort.exe) + elseif(NOT "${vs_version}" VERSION_LESS 10) set(v 10) set(ext vcxproj) elseif(NOT "${vs_version}" VERSION_LESS 7) diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 4d3fb9076..13cfb0054 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -26,10 +26,6 @@ if(NOT CMAKE_Fortran_COMPILER_NAMES) endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio") - set(CMAKE_Fortran_COMPILER_ID_RUN 1) - set(CMAKE_Fortran_PLATFORM_ID "Windows") - set(CMAKE_Fortran_COMPILER_ID "Intel") - set(CMAKE_Fortran_COMPILER "${CMAKE_GENERATOR_FC}") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") set(CMAKE_Fortran_COMPILER_XCODE_TYPE sourcecode.fortran.f90) else() diff --git a/Modules/CompilerId/VS-Intel.vfproj.in b/Modules/CompilerId/VS-Intel.vfproj.in new file mode 100644 index 000000000..044dd202d --- /dev/null +++ b/Modules/CompilerId/VS-Intel.vfproj.in @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 6247f7da6..d476c24de 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -76,7 +76,6 @@ void cmGlobalVisualStudio7Generator { mf->AddDefinition("CMAKE_GENERATOR_RC", "rc"); mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); - mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort"); this->AddPlatformDefinitions(mf); if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {