From 155b6929aa31c5dc8f8a923a4f40581464219c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Wed, 6 Nov 2024 12:50:36 +0100 Subject: [PATCH] Explicitly specify ADIOS2 components in openPMDConfig.cmake When including openPMD in downstream CMake and that CMake script contains Fortran, ADIOS2 will automatically detect that. But since we do not reexport the ADIOS2 headers, we only need the components that openPMD explicitly uses: CXX and MPI. --- openPMDConfig.cmake.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openPMDConfig.cmake.in b/openPMDConfig.cmake.in index 3f6902e503..e39f219fe6 100644 --- a/openPMDConfig.cmake.in +++ b/openPMDConfig.cmake.in @@ -31,7 +31,12 @@ set(openPMD_HDF5_FOUND ${openPMD_HAVE_HDF5}) set(openPMD_HAVE_ADIOS2 @openPMD_HAVE_ADIOS2@) if(openPMD_HAVE_ADIOS2) - find_dependency(ADIOS2) + set(REQUIRED_ADIOS2_COMPONENTS CXX) + if(openPMD_HAVE_MPI) + LIST(APPEND REQUIRED_ADIOS2_COMPONENTS MPI) + endif() + find_dependency(ADIOS2 COMPONENTS ${REQUIRED_ADIOS2_COMPONENTS}) + unset(REQUIRED_ADIOS2_COMPONENTS) endif() set(openPMD_ADIOS2_FOUND ${openPMD_HAVE_ADIOS2})