diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | config/cmake/HDF5UseFortran.cmake | 9 | ||||
-rwxr-xr-x | config/cmake/cacheinit.cmake | 2 | ||||
-rw-r--r-- | config/cmake/hdf5-config.cmake.build.in | 1 | ||||
-rw-r--r-- | config/cmake/hdf5-config.cmake.install.in | 1 | ||||
-rw-r--r-- | fortran/examples/CMakeLists.txt | 40 |
6 files changed, 53 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bfb7ab1..ff63012 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -707,6 +707,7 @@ SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) IF (HDF5_BUILD_FORTRAN) + OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) IF (HDF5_BUILD_HL_LIB) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 1f429f5..c1c5acb 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -110,6 +110,15 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble FORTRAN_DEFAULT_REAL_NOT_DOUBLE ) +CHECK_FORTRAN_FEATURE(iso_c_binding + " + PROGRAM main + USE iso_c_binding + END PROGRAM + " + FORTRAN_HAVE_ISO_C_BINDING +) + #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) #----------------------------------------------------------------------------- diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index c967ce5..1aa4aa2 100755 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -14,6 +14,8 @@ SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
+SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
+
SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index 35090fc..ccf5e67 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -8,6 +8,7 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) #-----------------------------------------------------------------------------
SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
+SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 7414eac..268d5ed 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -11,6 +11,7 @@ GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) #-----------------------------------------------------------------------------
SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
+SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index ee459e1..6ecfd37 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -30,6 +30,13 @@ SET (examples compound ) +SET (F2003_examples + rwdset_fortran2003 + nested_derived_type + compound_fortran2003 + compound_complex_fortran2003 +) + FOREACH (example ${examples}) ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) @@ -37,7 +44,7 @@ FOREACH (example ${examples}) IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS + HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) TARGET_LINK_LIBRARIES (f90_ex_${example} @@ -48,10 +55,41 @@ FOREACH (example ${examples}) IF (BUILD_TESTING) ADD_TEST (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "f90_ex_${example}") ENDIF (BUILD_TESTING) ENDFOREACH (example ${examples}) +FOREACH (example ${F2003_examples}) + ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) + TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "") + IF (WIN32 AND NOT CYGWIN) + SET_PROPERTY (TARGET f03_ex_${example} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) + ENDIF (WIN32 AND NOT CYGWIN) + TARGET_LINK_LIBRARIES (f03_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + + IF (BUILD_TESTING) + ADD_TEST (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "f03_ex_${example}") + ENDIF (BUILD_TESTING) + +ENDFOREACH (example ${F2003_examples}) + + IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) |