summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-09-03 18:28:47 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-09-03 18:28:47 (GMT)
commit6b1b8869d1a82260e91909d67cad6f8fe2530f70 (patch)
treed6bbcb7938cfc95465375280e83129dac39dda04 /CMakeLists.txt
parent0cca701dc20ea14ccf5004d7663bfcff45a354e1 (diff)
downloadhdf5-6b1b8869d1a82260e91909d67cad6f8fe2530f70.zip
hdf5-6b1b8869d1a82260e91909d67cad6f8fe2530f70.tar.gz
hdf5-6b1b8869d1a82260e91909d67cad6f8fe2530f70.tar.bz2
[svn-r27671] Move fortran id check to fortran section
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 13 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c1556e..96d5772 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,19 +1,6 @@
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
#
@@ -638,12 +625,12 @@ if (BUILD_TESTING)
option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0")
mark_as_advanced (HDF_TEST_EXPRESS)
- include (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
- configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
-
enable_testing ()
include (CTest)
+ include (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
+ configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
+
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib)
@@ -709,8 +696,18 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
endif (NOT ALLOW_UNSUPPORTED)
endif (BUILD_SHARED_LIBS AND APPLE)
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON)
+
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
+
+ message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
+ # 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 ()
+
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
+
if (HDF5_ENABLE_F2003)
if (NOT FORTRAN_HAVE_ISO_C_BINDING)
set (HDF5_ENABLE_F2003 OFF)