diff options
Diffstat (limited to 'fortran/examples')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 609d965..3f3ae9f 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -92,8 +92,7 @@ FOREACH (example ${F2003_examples}) ENDFOREACH (example ${F2003_examples}) ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) - -IF (H5_HAVE_PARALLEL) +IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "") @@ -106,12 +105,13 @@ IF (H5_HAVE_PARALLEL) TARGET_LINK_LIBRARIES (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} + ${MPI_Fortran_LIBRARIES} ) SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) IF (BUILD_TESTING) - ADD_TEST (NAME f90_ex_ph5example COMMAND $<TARGET_FILE:f90_ex_ph5example>) + ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:f90_ex_ph5example>) ENDIF (BUILD_TESTING) -ENDIF (H5_HAVE_PARALLEL) +ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) |