|
|
@@ -11,8 +11,19 @@ ADD_EXECUTABLE(testf hello.f)
|
|
|
# test the C to Fortran interface module
|
|
|
include(FortranCInterface)
|
|
|
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
|
|
- set(srcs foo.f)
|
|
|
- set(FORTRAN_FUNCTIONS test_mod:sub)
|
|
|
+ if(FORTRAN_C_MODULE_MANGLING_FOUND)
|
|
|
+ set(srcs foo.f)
|
|
|
+ set(FORTRAN_FUNCTIONS test_mod:sub)
|
|
|
+ else(FORTRAN_C_MODULE_MANGLING_FOUND)
|
|
|
+ if(CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|MIPSpro")
|
|
|
+ message("SunPro and MPISpro compilers do not support"
|
|
|
+ " linking Fortran module procedures from C")
|
|
|
+ else()
|
|
|
+ message("This will fail, but let the user see the error")
|
|
|
+ set(srcs foo.f)
|
|
|
+ set(FORTRAN_FUNCTIONS test_mod:sub)
|
|
|
+ endif()
|
|
|
+ endif(FORTRAN_C_MODULE_MANGLING_FOUND)
|
|
|
endif()
|
|
|
set(FORTRAN_FUNCTIONS ${FORTRAN_FUNCTIONS} my_sub mysub )
|
|
|
set(srcs ${srcs} mysub.f foo.c)
|