From c0ecf8db6de97ce7e95a6d5e74fa70de05326b83 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 9 Nov 2023 21:12:20 +0100 Subject: [PATCH] Expose MPI configuration in CMake export file. --- CMakeLists.txt | 5 +++++ MEDCouplingConfig.cmake.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 915ae7e38..914f21b4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,11 @@ ENDIF(MEDCOUPLING_BUILD_TESTS) IF(MEDCOUPLING_USE_MPI) FIND_PACKAGE(SalomeMPI REQUIRED) + # Used when exporting configuration: + SET(MEDCOUPLING_CXX_COMPILER "${CMAKE_CXX_COMPILER}") + SET(MEDCOUPLING_MPI_CXX_COMPILER "${MPI_CXX_COMPILER}") # Might not always be set even if MPI there ... + SET(MEDCOUPLING_MPI_CXX_LIBRARIES "${MPI_CXX_LIBRARIES}") + ADD_DEFINITIONS("-DHAVE_MPI") SALOME_ADD_MPI_TO_HDF5() IF(MEDCOUPLING_PARTITIONER_PARMETIS) diff --git a/MEDCouplingConfig.cmake.in b/MEDCouplingConfig.cmake.in index f3f817087..cadd265e8 100644 --- a/MEDCouplingConfig.cmake.in +++ b/MEDCouplingConfig.cmake.in @@ -113,6 +113,11 @@ ENDIF(MEDCOUPLING_ENABLE_PYTHON) SET(MEDCOUPLING_INSTALL_RES "@MEDCOUPLING_INSTALL_BINS@") SET(MEDCOUPLING_INSTALL_DOC "@MEDCOUPLING_INSTALL_BINS@") +# MPI configuration used when compiling MEDCoupling (if relevant) +SET(MEDCOUPLING_CXX_COMPILER "@MEDCOUPLING_CXX_COMPILER@") +SET(MEDCOUPLING_MPI_CXX_COMPILER "@MEDCOUPLING_MPI_CXX_COMPILER@") +SET(MEDCOUPLING_MPI_CXX_LIBRARIES "@MEDCOUPLING_MPI_CXX_LIBRARIES@") + # Exposed MEDCoupling targets: SET(MEDCoupling_interpkernel interpkernel) SET(MEDCoupling_medcouplingcpp medcouplingcpp) -- 2.39.2