summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-12-20 16:24:22 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-12-20 16:24:22 (GMT)
commitd5b435c8b5e19a4ba4ab9ce033340757d9021843 (patch)
tree8802285847e431584d16d14a62902f3925dc74fa
parent6cbb336ca753118a8413feb928627cb3a33a227f (diff)
parentb25f123f5f5e25c1447a6a02861cb7c7265c12f2 (diff)
downloadhdf5-d5b435c8b5e19a4ba4ab9ce033340757d9021843.zip
hdf5-d5b435c8b5e19a4ba4ab9ce033340757d9021843.tar.gz
hdf5-d5b435c8b5e19a4ba4ab9ce033340757d9021843.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit 'b25f123f5f5e25c1447a6a02861cb7c7265c12f2': Fix -- HDFFV-10363 Fortran compilation fails for xlf and cmake builds
-rw-r--r--fortran/src/CMakeLists.txt16
1 files changed, 15 insertions, 1 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 0f576d4..18d6d80 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -95,6 +95,18 @@ add_custom_command (
)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
+if (BUILD_SHARED_LIBS)
+ set (CMDSH $<TARGET_FILE:H5match_types>)
+ add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
+ ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
+ COMMAND ${CMDSH}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
+ DEPENDS H5match_types
+ )
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h PROPERTIES GENERATED TRUE)
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
+endif ()
#-----------------------------------------------------------------------------
# f90CStub lib
@@ -223,7 +235,7 @@ set (f90_F_SOURCES
if (BUILD_SHARED_LIBS)
set (f90_F_SOURCES_SHARED
# generated file
- ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+ ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
${f90_F_BASE_SOURCES}
@@ -243,6 +255,7 @@ set (SHARED_LINK_FLAGS " ")
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET})
target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS})
+target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS})
endif ()
@@ -271,6 +284,7 @@ if (BUILD_SHARED_LIBS)
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS})
target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET})
target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS})
+ target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS})
endif ()