Normalize FindMPI hints.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Mon, 26 Oct 2020 16:50:12 +0000 (17:50 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Tue, 27 Oct 2020 10:15:04 +0000 (10:15 +0000)
Let gmxapi target use the MPI C component instead of CXX for consistency
with gmxManageMPI.cmake.

Refs #3671
Refs #3672

api/gmxapi/CMakeLists.txt

index e287816034cea6a983d500728abc24e3bca1c917..b5313c5a8d1240b2d9f57e305a6256634924fa8b 100644 (file)
@@ -67,9 +67,9 @@ if (GMX_LIB_MPI)
     # Clarification should be possible with resolution of #3672.
     set(_gmx_mpi_type "library")
     # Ref https://cmake.org/cmake/help/v3.13/module/FindMPI.html#variables-for-using-mpi
-    find_package(MPI COMPONENTS CXX)
-    if (MPI_CXX_FOUND)
-        target_link_libraries(gmxapi PUBLIC MPI::MPI_CXX)
+    find_package(MPI COMPONENTS C)
+    if (MPI_C_FOUND)
+        target_link_libraries(gmxapi PUBLIC MPI::MPI_C)
     else()
         message(FATAL_ERROR "Building gmxapi for MPI-enabled GROMACS, but no MPI toolchain found.")
     endif ()