summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerABI.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2011-09-08 21:42:49 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2011-09-08 21:42:49 (GMT)
commit555f589a5a3e9387956d451dc253fa1e3f35adff (patch)
treecbc1f8942da0b0d901032eebeddc43c73338e073 /Modules/CMakeDetermineCompilerABI.cmake
parent71402eb25244e5805df54c2f6e62ddd36201dbd6 (diff)
downloadCMake-555f589a5a3e9387956d451dc253fa1e3f35adff.zip
CMake-555f589a5a3e9387956d451dc253fa1e3f35adff.tar.gz
CMake-555f589a5a3e9387956d451dc253fa1e3f35adff.tar.bz2
For VS Intel Fortran IDE builds, add a check to find the Fortran library PATH.
To use VS C and Fotran in the same solution, it is required that VS be able to find the Fortran run time libraries as they will be implicitly linked by any Fortran library used by VS C programs. This adds a check into CMakeDetermineCompilerABI using a try-compile to find the correct PATH.
Diffstat (limited to 'Modules/CMakeDetermineCompilerABI.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 39d1f17..528c327 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -83,6 +83,32 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
ENDIF()
+ # for VS IDE Intel Fortran we have to figure out the
+ # implicit link path for the fortran run time using
+ # a try-compile
+ IF("${lang}" MATCHES "Fortran"
+ AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+ SET(_desc "Determine Intel Fortran Compiler Implicit Link Path")
+ MESSAGE(STATUS "${_desc}")
+ # Build a sample project which reports symbols.
+ TRY_COMPILE(IFORT_LIB_PATH_COMPILED
+ ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
+ ${CMAKE_ROOT}/Modules/FortranCInterface/IntelVSImplicitPath
+ IntelFortranImplicit
+ CMAKE_FLAGS
+ "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
+ OUTPUT_VARIABLE _output)
+ FILE(READ
+ ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/implict_link.txt
+ dir)
+ LIST(APPEND implicit_dirs "${dir}")
+ FILE(WRITE
+ "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
+ "${_output}")
+ SET(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
+ MESSAGE(STATUS "${_desc}")
+ ENDIF()
+
SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
SET(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)