summaryrefslogtreecommitdiffstats
path: root/fortran/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/src/CMakeLists.txt')
-rw-r--r--fortran/src/CMakeLists.txt11
1 files changed, 7 insertions, 4 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index bc6ab33..ec4d7d1 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -115,7 +115,7 @@ ENDIF (H5_HAVE_PARALLEL)
SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C)
ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS})
-TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
+TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE})
SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran)
@@ -180,18 +180,18 @@ SET (f90_F_SRCS
#-----------------------------------------------------------------------------
# Add H5FDMPIO if parallel
#-----------------------------------------------------------------------------
-IF (H5_HAVE_PARALLEL)
+IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
SET (f90_F_SRCS
${f90_F_SRCS}
${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90
${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90
)
-ELSE (H5_HAVE_PARALLEL)
+ELSE (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
SET (f90_F_SRCS
${f90_F_SRCS}
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90
)
-ENDIF (H5_HAVE_PARALLEL)
+ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
#-----------------------------------------------------------------------------
# Add Main fortran library
@@ -220,6 +220,9 @@ ENDIF (WIN32 AND NOT CYGWIN)
TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
+IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
+ TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES})
+ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE})
SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran)