[Cmake-commits] [cmake-commits] hoffman committed CMakeLists.txt 1.32.2.1 1.32.2.2 hello.f 1.1 1.1.18.1 testf.f NONE 1.1.2.2 world.def NONE 1.1.2.2 world.f NONE 1.1.2.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Oct 28 12:17:14 EDT 2009
Update of /cvsroot/CMake/CMake/Tests/Fortran
In directory public:/mounts/ram/cvs-serv18987/Tests/Fortran
Modified Files:
Tag: CMake-2-8
CMakeLists.txt hello.f
Added Files:
Tag: CMake-2-8
testf.f world.def world.f
Log Message:
RC 4 merge
--- NEW FILE: testf.f ---
PROGRAM TESTF
CALL HELLO()
CALL WORLD()
END
Index: hello.f
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Fortran/hello.f,v
retrieving revision 1.1
retrieving revision 1.1.18.1
diff -C 2 -d -r1.1 -r1.1.18.1
*** hello.f 6 Aug 2004 19:05:00 -0000 1.1
--- hello.f 28 Oct 2009 16:17:12 -0000 1.1.18.1
***************
*** 1,5 ****
! PROGRAM GREETINGS
! PRINT *, 'Real programmers write Fortran!'
END
--- 1,5 ----
! SUBROUTINE HELLO
! PRINT *, 'Hello'
END
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Fortran/CMakeLists.txt,v
retrieving revision 1.32.2.1
retrieving revision 1.32.2.2
diff -C 2 -d -r1.32.2.1 -r1.32.2.2
*** CMakeLists.txt 9 Oct 2009 20:11:45 -0000 1.32.2.1
--- CMakeLists.txt 28 Oct 2009 16:17:12 -0000 1.32.2.2
***************
*** 8,13 ****
message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}")
message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}")
- add_executable(testf hello.f)
function(test_fortran_c_interface_module)
--- 8,30 ----
message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}")
message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}")
+ set(_SHARED SHARED)
+ if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(XL|VisualAge)$")
+ # We do not implement SHARED Fortran libs on AIX yet!
+ # Workaround: Set LINKER_LANGUAGE to C, which uses 'xlc' and Fortran implicits.
+ set(_SHARED STATIC)
+ elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
+ # g77 2.96 does not support shared libs on Itanium because g2c is not -fPIC
+ execute_process(COMMAND ${CMAKE_Fortran_COMPILER} --version
+ OUTPUT_VARIABLE output ERROR_VARIABLE output)
+ if("${output}" MATCHES "Red Hat .* 2\\.96")
+ set(_SHARED STATIC)
+ endif()
+ endif()
+
+ add_library(hello STATIC hello.f)
+ add_library(world ${_SHARED} world.f world.def)
+ add_executable(testf testf.f)
+ target_link_libraries(testf hello world)
function(test_fortran_c_interface_module)
--- NEW FILE: world.def ---
EXPORTS
WORLD
--- NEW FILE: world.f ---
SUBROUTINE WORLD
PRINT *, 'World!'
END
More information about the Cmake-commits
mailing list