diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-09-19 14:28:52 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-09-19 14:28:52 (GMT) |
commit | 99d6246fc2934a9eddda8e6b2a724e4c551c5755 (patch) | |
tree | 549e9d3bc03d60d3ec6cb3839adba9c45257d95c /fortran/src | |
parent | 6d5ee49ff3a33b30b9a7baf0af4f1929ad8d3b72 (diff) | |
parent | 3585b373508ca5ea940fbf6e7d0ffeed1968a6bf (diff) | |
download | hdf5-99d6246fc2934a9eddda8e6b2a724e4c551c5755.zip hdf5-99d6246fc2934a9eddda8e6b2a724e4c551c5755.tar.gz hdf5-99d6246fc2934a9eddda8e6b2a724e4c551c5755.tar.bz2 |
Merge pull request #27 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '3585b373508ca5ea940fbf6e7d0ffeed1968a6bf':
Add default site names
Separate fortran generation into static and shared folders.
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/CMakeLists.txt | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index ea38c58..f123420 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -65,6 +65,7 @@ set_target_properties (H5_buildiface PROPERTIES ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) else (WIN32) @@ -187,6 +188,18 @@ set (f90_F_SOURCES # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + set (f90_F_SOURCES_SHARED + ${f90_F_BASE_SOURCES} + + # generated file + ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 + ) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + set (CMD $<TARGET_FILE:H5_buildiface>) add_custom_target (H5gen ALL @@ -195,9 +208,19 @@ add_custom_target (H5gen ALL WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS ${f90_F_BASE_SOURCES} ) - set_source_files_properties (${f90_F_SOURCES} PROPERTIES LANGUAGE Fortran) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + add_custom_target (H5genSH ALL + COMMAND ${CMD} + #v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared + DEPENDS ${f90_F_BASE_SOURCES} + ) + set_source_files_properties (${f90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + + #----------------------------------------------------------------------------- # Add Main fortran library #----------------------------------------------------------------------------- @@ -224,7 +247,7 @@ endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES}) + add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") |