Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
ca5e9e64
Commit
ca5e9e64
authored
Aug 26, 2004
by
Bill Hoffman
Browse files
ENH: try to find fortran compiler before adding the test
parent
c2be640c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Modules/CMakeDetermineFortranCompiler.cmake
View file @
ca5e9e64
...
...
@@ -24,7 +24,8 @@ IF(NOT CMAKE_Fortran_COMPILER)
# if no compiler has been specified yet, then look for one
IF
(
NOT CMAKE_Fortran_COMPILER_INIT
)
# if not in the envionment then search for the compiler in the path# Known compilers:
# if not in the envionment then search for the compiler in the path
# Known compilers:
# f77/f90/f95: generic compiler names
# g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress)
...
...
@@ -39,14 +40,20 @@ IF(NOT CMAKE_Fortran_COMPILER)
# fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
# ifc: Intel Fortran 95 compiler for Linux/x86
# 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
#
# 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.
# NOTE for testing purposes this list is DUPLICATED in
# CMake/Source/CMakeLists.txt, IF YOU CHANGE THIS LIST,
# PLEASE UPDATE THAT FILE AS WELL!
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
)
SET
(
CMAKE_Fortran_COMPILER_FULLPATH
"
${
CMAKE_Fortran_COMPILER_FULLPATH
}
"
CACHE INTERNAL
"full path to the compiler cmake found"
)
SET
(
CMAKE_Fortran_COMPILER_FULLPATH
"
${
CMAKE_Fortran_COMPILER_FULLPATH
}
"
CACHE INTERNAL
"full path to the compiler cmake found"
)
ENDIF
(
NOT CMAKE_Fortran_COMPILER_INIT
)
SET
(
CMAKE_Fortran_COMPILER
${
CMAKE_Fortran_COMPILER_INIT
}
CACHE STRING
"Fortran compiler"
)
...
...
Source/CMakeLists.txt
View file @
ca5e9e64
...
...
@@ -621,6 +621,7 @@ IF(BUILD_TESTING)
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
}
)
MARK_AS_ADVANCED
(
CMAKE_Fortran_COMPILER_FULLPATH
)
IF
(
CMAKE_Fortran_COMPILER_FULLPATH
)
ADD_TEST
(
Fortran
${
CMAKE_CTEST_COMMAND
}
--build-and-test
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment