[Cmake-commits] CMake branch, next, updated. v2.8.5-1866-g5a768fc

Bill Hoffman bill.hoffman at kitware.com
Fri Sep 9 11:01:38 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  5a768fc24e4e0b75ca939abec533ed89bfd101bf (commit)
       via  555f589a5a3e9387956d451dc253fa1e3f35adff (commit)
      from  c4afdf60f981c483071d37b0d5850ccd24ae6cc0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a768fc24e4e0b75ca939abec533ed89bfd101bf
commit 5a768fc24e4e0b75ca939abec533ed89bfd101bf
Merge: c4afdf6 555f589
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Fri Sep 9 11:01:22 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 9 11:01:22 2011 -0400

    Merge topic 'FortranCInterface-VS' into next
    
    555f589 For VS Intel Fortran IDE builds, add a check to find the Fortran library PATH.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=555f589a5a3e9387956d451dc253fa1e3f35adff
commit 555f589a5a3e9387956d451dc253fa1e3f35adff
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Thu Sep 8 17:42:49 2011 -0400
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Thu Sep 8 17:42:49 2011 -0400

    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.

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)
 
diff --git a/Modules/FortranCInterface/IntelVSImplicitPath/CMakeLists.txt b/Modules/FortranCInterface/IntelVSImplicitPath/CMakeLists.txt
new file mode 100644
index 0000000..e2a4b3f
--- /dev/null
+++ b/Modules/FortranCInterface/IntelVSImplicitPath/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required (VERSION 2.8)
+project(IntelFortranImplicit Fortran)
+add_custom_command(OUTPUT ${IntelFortranImplicit_BINARY_DIR}/env.txt
+  COMMAND set > ${IntelFortranImplicit_BINARY_DIR}/env.txt)
+add_library(FortranLib hello.f
+  ${IntelFortranImplicit_BINARY_DIR}/env.txt)
+add_custom_target(ExtractLibPath ALL
+  COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/extract.cmake
+  WORKING_DIRECTORY ${IntelFortranImplicit_BINARY_DIR}
+)
+add_dependencies(ExtractLibPath FortranLib)
diff --git a/Modules/FortranCInterface/IntelVSImplicitPath/extract.cmake b/Modules/FortranCInterface/IntelVSImplicitPath/extract.cmake
new file mode 100644
index 0000000..055247c
--- /dev/null
+++ b/Modules/FortranCInterface/IntelVSImplicitPath/extract.cmake
@@ -0,0 +1,12 @@
+file(STRINGS env.txt LIB REGEX "^LIB=.*$")
+string(REPLACE "LIB=" "" LIB "${LIB}" )
+# change LIB from a string to a ; separated list of paths
+set(LIB ${LIB})
+# look at each path and try to find ifconsol.lib
+foreach( dir ${LIB})
+  file(TO_CMAKE_PATH "${dir}" dir)
+  if(EXISTS "${dir}/ifconsol.lib")
+    file(WRITE implict_link.txt ${dir})
+    return()
+  endif()
+endforeach()
diff --git a/Modules/FortranCInterface/IntelVSImplicitPath/hello.f b/Modules/FortranCInterface/IntelVSImplicitPath/hello.f
new file mode 100644
index 0000000..e69de29

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeDetermineCompilerABI.cmake            |   26 ++++++++++++++++++++
 .../IntelVSImplicitPath/CMakeLists.txt             |   11 ++++++++
 .../IntelVSImplicitPath/extract.cmake              |   12 +++++++++
 .../FortranCInterface/IntelVSImplicitPath/hello.f  |    0
 4 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 Modules/FortranCInterface/IntelVSImplicitPath/CMakeLists.txt
 create mode 100644 Modules/FortranCInterface/IntelVSImplicitPath/extract.cmake
 copy Tests/BundleTest/SomeRandomFile.txt => Modules/FortranCInterface/IntelVSImplicitPath/hello.f (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list