summaryrefslogtreecommitdiffstats
path: root/hl/fortran/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-09-21 15:46:03 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-09-21 15:46:03 (GMT)
commite219ee88e42c09ab75e97a04a1b42d0b1410e721 (patch)
tree3b61dc80b2e594327d159f4f8c8e993b17756cd5 /hl/fortran/src
parent5f13efeb79e09c2f84dde4f74d3a1d115a865145 (diff)
downloadhdf5-e219ee88e42c09ab75e97a04a1b42d0b1410e721.zip
hdf5-e219ee88e42c09ab75e97a04a1b42d0b1410e721.tar.gz
hdf5-e219ee88e42c09ab75e97a04a1b42d0b1410e721.tar.bz2
Add gen file technique to HL and test fortran libraries
Diffstat (limited to 'hl/fortran/src')
-rw-r--r--hl/fortran/src/CMakeLists.txt64
1 files changed, 48 insertions, 16 deletions
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 6419ab8..82db6fe 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -37,6 +37,7 @@ set_target_properties (H5HL_buildiface PROPERTIES
)
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared")
if (WIN32)
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE})
else (WIN32)
@@ -111,30 +112,61 @@ set (HDF5_HL_F90_F_BASE_SOURCES
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.F90
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90
)
-set (HDF5_HL_F90_F_SOURCES
- ${HDF5_HL_F90_F_BASE_SOURCES}
- # generated files
- ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
- ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
+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 ${HDF5_HL_F90_F_BASE_SOURCES}
+ COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
+)
+add_custom_target (H5HLgen ALL
+ DEPENDS ${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_SOURCES} PROPERTIES LANGUAGE Fortran)
-
set_source_files_properties (
${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
PROPERTIES GENERATED TRUE
)
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (CMDSH $<TARGET_FILE:H5HL_buildiface>)
+ add_custom_command (
+ OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared
+ DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
+ COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files"
+ )
+ add_custom_target (H5HLgen ALL
+ DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ )
+ set_source_files_properties (
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ PROPERTIES GENERATED TRUE
+ )
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
-set (CMD $<TARGET_FILE:H5HL_buildiface>)
-add_custom_target (H5HLgen ALL
- COMMAND ${CMD}
-#v3.2 BYPRODUCT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
-#v3.2 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
- WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}
- DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
+set (HDF5_HL_F90_F_SOURCES
+ ${HDF5_HL_F90_F_BASE_SOURCES}
+
+ # 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_SOURCES} PROPERTIES LANGUAGE Fortran)
+
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (HDF5_HL_F90_F_SOURCES_SHARED
+ ${HDF5_HL_F90_F_BASE_SOURCES}
+
+ # generated files
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ )
+ set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ")
@@ -155,7 +187,7 @@ endif (WIN32)
set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET})
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES})
+ add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
set (SHARED_LINK_FLAGS " ")
if (WIN32 AND MSVC)
set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def")