summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-09-01 14:00:14 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-09-01 14:00:14 (GMT)
commit17f5ee36247d6a73f8b92318c9fa0a03381ea1e7 (patch)
tree5411153e5edd2a3aaacdf593c9d6bcc73588eb27 /CMakeLists.txt
parentbb8c64169b3f018d38b761db501c0931f8418dc7 (diff)
downloadhdf5-17f5ee36247d6a73f8b92318c9fa0a03381ea1e7.zip
hdf5-17f5ee36247d6a73f8b92318c9fa0a03381ea1e7.tar.gz
hdf5-17f5ee36247d6a73f8b92318c9fa0a03381ea1e7.tar.bz2
[svn-r27647] Added compiler check for PGI and CMake version.
CMake must be > v3.3 to compile with PGI due to CMake bug in earlier versions.
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
#