diff options
-rw-r--r-- | fortran/src/CMakeLists.txt | 57 |
1 files changed, 20 insertions, 37 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 278f814..4a0928e 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -65,7 +65,6 @@ 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) @@ -154,6 +153,23 @@ endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- +set (f90_F_GEN_SOURCES + ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 +) +set (CMD $<TARGET_FILE:H5_buildiface>) +add_custom_command ( + OUTPUT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + COMMAND ${CMD} + DEPENDS ${f90_F_GEN_SOURCES} +) +add_custom_target (H5gen ALL +#v3.2 BYPRODUCT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + #WORKING_DIRECTORY ${HDF5_F90_SRC_BINARY_DIR} + DEPENDS ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 +) + set (f90_F_BASE_SOURCES # generated files ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 @@ -176,50 +192,17 @@ set (f90_F_BASE_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90 ) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) + set (f90_F_SOURCES ${f90_F_BASE_SOURCES} # generated file - ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE) - 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 - COMMAND ${CMD} -#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 - 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 @@ -247,7 +230,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_SHARED}) + add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") |