diff --git a/examples/hello/bpWriter/CMakeLists.txt b/examples/hello/bpWriter/CMakeLists.txt index 91e386a3e9a1c8fc964ac2e1c7dabd7df132c420..ffd7d017bcedc54808f4abc5ac19957db0a32394 100644 --- a/examples/hello/bpWriter/CMakeLists.txt +++ b/examples/hello/bpWriter/CMakeLists.txt @@ -3,8 +3,12 @@ # accompanying file Copyright.txt for details. #------------------------------------------------------------------------------# -add_executable(hello_bpWriter helloBPWriter.cpp) -target_link_libraries(hello_bpWriter adios2) +if(ADIOS_USE_MPI) + find_package(MPI COMPONENTS C REQUIRED) + add_executable(hello_bpWriter helloBPWriter.cpp) + target_include_directories(hello_bpWriter ${MPI_C_INCLUDE_PATH}) + target_link_libraries(hello_bpWriter adios2 ${MPI_C_LIBRARIES}) +endif() add_executable(hello_bpWriter_nompi helloBPWriter_nompi.cpp) target_link_libraries(hello_bpWriter_nompi adios2) diff --git a/examples/hello/timeBP/CMakeLists.txt b/examples/hello/timeBP/CMakeLists.txt index b1d815932f93192cea66f914544c21334fe024ac..7a859cd13e127a4ad23fa7837c3bbfeb2bd6c8c9 100644 --- a/examples/hello/timeBP/CMakeLists.txt +++ b/examples/hello/timeBP/CMakeLists.txt @@ -3,8 +3,14 @@ # accompanying file Copyright.txt for details. #------------------------------------------------------------------------------# -add_executable(hello_timeBPWriter timeBPWriter.cpp) -target_link_libraries(hello_timeBPWriter adios2) +if(ADIOS_USE_MPI) + find_package(MPI COMPONENTS C REQUIRED) + add_executable(hello_timeBPWriter timeBPWriter.cpp) + target_link_libraries(hello_timeBPWriter adios2) + target_include_directories(hello_timeBPWriter ${MPI_C_INCLUDE_PATH}) + target_link_libraries(hello_timeBPWriter adios2 ${MPI_C_LIBRARIES}) +endif() + add_executable(hello_timeBPWriter_nompi timeBPWriter_nompi.cpp) target_link_libraries(hello_timeBPWriter_nompi adios2)