summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 13 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
#