diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-10-28 16:17:18 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-10-28 16:17:18 (GMT) |
commit | b4ae8bad4b8e7810a44e2f77363de3009260a473 (patch) | |
tree | 7dd8a97d409c6339948ac4b3e0eda77cd9b7384e /Tests/Fortran/CMakeLists.txt | |
parent | ebd0c2d3771835a1317c1fd70eafd3ebf2135b01 (diff) | |
download | CMake-b4ae8bad4b8e7810a44e2f77363de3009260a473.zip CMake-b4ae8bad4b8e7810a44e2f77363de3009260a473.tar.gz CMake-b4ae8bad4b8e7810a44e2f77363de3009260a473.tar.bz2 |
RC 4 merge
Diffstat (limited to 'Tests/Fortran/CMakeLists.txt')
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index adcadd4..709ea5f 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -7,8 +7,25 @@ message("CMAKE_Fortran_COMPILER_INIT = ${CMAKE_Fortran_COMPILER_INIT}") message("CMAKE_Fortran_COMPILER_FULLPATH = ${CMAKE_Fortran_COMPILER_FULLPATH}") message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}") message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}") -add_executable(testf hello.f) +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) message(STATUS "Testing FortranCInterface module") |