Remove an unnecessary transitive dependency of imported CMake target.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Thu, 29 Oct 2020 20:48:06 +0000 (21:48 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 2 Nov 2020 06:55:00 +0000 (06:55 +0000)
Refs #3777

api/gmxapi/CMakeLists.txt

index b5313c5a8d1240b2d9f57e305a6256634924fa8b..12b2fd4226304f7e2f841b7294aa3edb544dc618 100644 (file)
@@ -69,7 +69,7 @@ if (GMX_LIB_MPI)
     # Ref https://cmake.org/cmake/help/v3.13/module/FindMPI.html#variables-for-using-mpi
     find_package(MPI COMPONENTS C)
     if (MPI_C_FOUND)
-        target_link_libraries(gmxapi PUBLIC MPI::MPI_C)
+        target_link_libraries(gmxapi PRIVATE MPI::MPI_C)
     else()
         message(FATAL_ERROR "Building gmxapi for MPI-enabled GROMACS, but no MPI toolchain found.")
     endif ()