find_package(MPI COMPONENTS C)
if (MPI_C_FOUND)
target_link_libraries(gmxapi PRIVATE MPI::MPI_C)
+ # If clients also need to link this target, we need to provide help in gmxapi-config.cmake
+ set(_gmxapi_find_dependencies "find_dependency(MPI COMPONENTS C)")
else()
message(FATAL_ERROR "Building gmxapi for MPI-enabled GROMACS, but no MPI toolchain found.")
endif ()
@PACKAGE_INIT@
# Refer to CMake docs for information on more elaborate use of this stub file:
# https://cmake.org/cmake/help/v3.4/module/CMakePackageConfigHelpers.html#command:configure_package_config_file
+include(CMakeFindDependencyMacro)
+@_gmxapi_find_dependencies@
include("${CMAKE_CURRENT_LIST_DIR}/gmxapi.cmake")
check_required_components(gmxapi)
set_property(TARGET Gromacs::gmxapi PROPERTY MPI "@_mpi@")