Add a fortran test if there is a fortran compiler

This commit is contained in:
Bill Hoffman 2004-08-26 15:50:39 -04:00
parent 66a08c10e5
commit e803b32b89
2 changed files with 38 additions and 26 deletions

View File

@ -4,7 +4,6 @@
# use environment variable CCC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
# as a default compiler
IF(NOT CMAKE_Fortran_COMPILER)
# prefer the environment variable CC
IF($ENV{FC} MATCHES ".+")
@ -42,8 +41,8 @@ IF(NOT CMAKE_Fortran_COMPILER)
# efc: Intel Fortran 95 compiler for IA64
# the order is 95 or newer compilers first, then 90, then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default
SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95 lf95 xlf95 fort gfortran f90 pgf90 xlf90 epcf90
f77 fort77 frt pgf77 xlf fl32 af77 g77 )
SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95
lf95 xlf95 fort gfortran f90 pgf90 xlf90 epcf90 f77 fort77 frt pgf77 xlf fl32 af77 g77 )
FIND_PROGRAM(CMAKE_Fortran_COMPILER_FULLPATH NAMES ${CMAKE_Fortran_COMPILER_LIST} )
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT
${CMAKE_Fortran_COMPILER_FULLPATH} NAME)

View File

@ -616,7 +616,20 @@ IF(BUILD_TESTING)
)
ENDIF (CTEST_TEST_CTEST)
# see if we can find a fortran compiler on the machine
# if so, add the fortran test and see if it works.
INCLUDE(CMakeDetermineFortranCompiler)
IF(CMAKE_Fortran_COMPILER_FULLPATH)
ADD_TEST(Fortran ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Fortran"
"${CMake_BINARY_DIR}/Tests/Fortran"
--build-generator ${CMAKE_GENERATOR}
--build-project Simple
--build-makeprogram ${MAKEPROGRAM}
--build-two-config
--test-command testf)
ENDIF(CMAKE_Fortran_COMPILER_FULLPATH)
IF (CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE OR WXWINDOWS_INCLUDE_DIR)
# Will be set if the wxwindows gui is on