diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-09-16 20:21:08 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-09-16 20:21:43 (GMT) |
commit | 8efb84b9a8d287cb9c98adf78549a94e555b02ad (patch) | |
tree | 2774ea78bb956139c83818732b0224c5fabba024 | |
parent | 6d5ee49ff3a33b30b9a7baf0af4f1929ad8d3b72 (diff) | |
download | hdf5-8efb84b9a8d287cb9c98adf78549a94e555b02ad.zip hdf5-8efb84b9a8d287cb9c98adf78549a94e555b02ad.tar.gz hdf5-8efb84b9a8d287cb9c98adf78549a94e555b02ad.tar.bz2 |
Separate fortran generation into static and shared folders.
-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") |