ENH: Added Fortran 90 test if the platform supports it.

This commit is contained in:
Brad King 2005-02-15 09:01:14 -05:00
parent 23dfc9440a
commit eb9164bf0e
4 changed files with 26 additions and 0 deletions

View File

@ -6,3 +6,10 @@ MESSAGE("CMAKE_Fortran_COMPILER_FULLPATH = ${CMAKE_Fortran_COMPILER_FULLPATH}")
MESSAGE("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}") MESSAGE("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}")
MESSAGE("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}") MESSAGE("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}")
ADD_EXECUTABLE(testf hello.f) ADD_EXECUTABLE(testf hello.f)
IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90 AND CMAKE_GENERATOR_NEW)
ADD_EXECUTABLE(test_module
test_module_main.f90
test_module_implementation.f90
test_module_interface.f90)
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90 AND CMAKE_GENERATOR_NEW)

View File

@ -0,0 +1,6 @@
FUNCTION TEST_MODULE_FUNCTION(A,B)
REAL :: TEST_MODULE_FUNCTION
REAL, INTENT(IN) :: A
REAL, INTENT(IN) :: B
TEST_MODULE_FUNCTION = A + B
END FUNCTION TEST_MODULE_FUNCTION

View File

@ -0,0 +1,9 @@
MODULE TEST_MODULE
INTERFACE
FUNCTION TEST_MODULE_FUNCTION(A,B)
REAL :: TEST_MODULE_FUNCTION
REAL, INTENT(IN) :: A
REAL, INTENT(IN) :: B
END FUNCTION TEST_MODULE_FUNCTION
END INTERFACE
END MODULE TEST_MODULE

View File

@ -0,0 +1,4 @@
PROGRAM MAINF90
USE TEST_MODULE
PRINT *,'Sum is',TEST_MODULE_FUNCTION(1., 2.)
END PROGRAM MAINF90