]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Expose MPI configuration in CMake export file. abn/cmake_mpi V9_12_0b1
authorabn <adrien.bruneton@cea.fr>
Thu, 9 Nov 2023 20:12:20 +0000 (21:12 +0100)
committerabn <adrien.bruneton@cea.fr>
Thu, 9 Nov 2023 20:31:13 +0000 (21:31 +0100)
CMakeLists.txt
MEDCouplingConfig.cmake.in

index 915ae7e382fdcf84db79be006e321dd2131c4acb..914f21b4a62596a9f3200af74124fad3c1643fc9 100644 (file)
@@ -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)
index f3f817087699520723af69e9d101429da30b17f6..cadd265e887dc5dc6ad680a9e73919e631671ade 100644 (file)
@@ -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)