olm/lib/doctest/examples/mpi/CMakeLists.txt
Hubert Chathi 8475061136 switch to doctest for unit testing
thanks to Nico Werner, who did most of the porting work
2021-12-22 13:45:33 -05:00

7 lines
276 B
CMake

find_package(MPI COMPONENTS CXX)
if(MPI_FOUND)
add_executable(test_mpi main.cpp mpi.cpp)
target_link_libraries(test_mpi doctest ${CMAKE_THREAD_LIBS_INIT} MPI::MPI_CXX)
doctest_add_test(NO_OUTPUT NAME test_mpi COMMAND mpirun -np 3 $<TARGET_FILE:test_mpi>)
endif()