summaryrefslogtreecommitdiffstats
path: root/hl/fortran
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-09 15:01:11 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-09 15:01:11 (GMT)
commitb67a6727cf0c848f92463a15ac76a2fbdfc6555a (patch)
treef16ef6a07497a03c0fd13436186037e802f35f90 /hl/fortran
parentfc42b3efaa724c0caa6ff84bf5d8136a6aae22bb (diff)
downloadhdf5-b67a6727cf0c848f92463a15ac76a2fbdfc6555a.zip
hdf5-b67a6727cf0c848f92463a15ac76a2fbdfc6555a.tar.gz
hdf5-b67a6727cf0c848f92463a15ac76a2fbdfc6555a.tar.bz2
[svn-r27359] Fixed Cmake to handle autogenerated Fortran HL APIs
Diffstat (limited to 'hl/fortran')
-rw-r--r--hl/fortran/src/CMakeLists.txt42
-rw-r--r--hl/fortran/test/tsttable.F904
2 files changed, 44 insertions, 2 deletions
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 4f266a4..85bc9b4 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -12,6 +12,40 @@ if (WIN32)
endif (WIN32)
#-----------------------------------------------------------------------------
+# Generate the H5LT and H5TB REAL APIs
+#-----------------------------------------------------------------------------
+
+add_executable (H5HL_buildiface
+ ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90
+ )
+
+if (WIN32 AND MSVC)
+ if (BUILD_SHARED_LIBS)
+ set_target_properties (H5HL_buildiface
+ PROPERTIES
+ COMPILE_FLAGS "/MT"
+ )
+ endif (BUILD_SHARED_LIBS)
+ set_target_properties (H5HL_buildiface
+ PROPERTIES
+ LINK_FLAGS "/SUBSYSTEM:CONSOLE"
+ )
+endif (WIN32 AND MSVC)
+set_target_properties (H5HL_buildiface PROPERTIES
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
+)
+
+set (CMD $<TARGET_FILE:H5HL_buildiface>)
+add_custom_command (
+ OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}
+ DEPENDS H5HL_buildiface
+)
+
+#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (
@@ -54,6 +88,14 @@ set (HDF5_HL_F90_F_SRCS
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.F90
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90
)
+set (HDF5_HL_F90_F_SRCS
+ ${HDF5_HL_F90_F_SRCS}
+
+ # generated files
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
+)
+
set_source_files_properties (${HDF5_HL_F90_F_SRCS} PROPERTIES LANGUAGE Fortran)
add_library (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS})
diff --git a/hl/fortran/test/tsttable.F90 b/hl/fortran/test/tsttable.F90
index f57f933..74029a5 100644
--- a/hl/fortran/test/tsttable.F90
+++ b/hl/fortran/test/tsttable.F90
@@ -82,9 +82,9 @@ SUBROUTINE test_table1()
SIZEOF_X = SIZEOF(bufd(1))
#endif
- ! If Fortran DOUBLE PRECISION and C DOUBLE sizeof don't match then disable
+ ! If Fortran DOUBLE PRECISION and C DOUBLE sizeofs don't match then disable
! creating a DOUBLE RECISION field, and instead create a REAL field. This
- ! is to handle when DOUBLE PRECISION is promoted via a compiler option.
+ ! is needed to handle when DOUBLE PRECISION is promoted via a compiler flag.
Exclude_double = .FALSE.
IF(Cs_sizeof_double.NE.SIZEOF_X)THEN
Exclude_double = .TRUE.