diff options
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | fortran/test/fortranlib_test.F90 | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd3e1c9..0c1556e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,19 @@ cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5 C CXX) +if (HDF5_BUILD_FORTRAN) + include (${CMAKE_ROOT}/Modules/CMakeDetermineFortranCompiler.cmake) + if (${CMAKE_Fortran_COMPILER_ID}) + enable_language(Fortran) + endif () + +# Building with PGI requires CMake 3.3 or greater because previous versions +# of CMake add the wrong compiler flag for the PGI Fortran compiler. + if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3") + message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ") + endif () +endif () + #----------------------------------------------------------------------------- # Instructions for use : Normal Build # diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index c3e995b..2f88c45 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -24,6 +24,8 @@ ! !***** +!#include <H5config_f.inc> + PROGRAM fortranlibtest USE HDF5 |