From: abn Date: Thu, 9 Nov 2023 20:12:20 +0000 (+0100) Subject: Expose MPI configuration in CMake export file. X-Git-Tag: V9_12_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fabn%2Fcmake_mpi;p=tools%2Fmedcoupling.git Expose MPI configuration in CMake export file. --- 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)