Salome HOME
Even if MPI is activated, scotch can be activated
[tools/medcoupling.git] / CMakeLists.txt
index 3093ba067235d263eb3ba87f7ecb383df9846300..ef83a56c739409b7188b05c98c6b1fbbb496af08 100644 (file)
@@ -52,7 +52,7 @@ INCLUDE(SalomeSetupPlatform)
 # User options
 # ============
 INCLUDE(CMakeDependentOption)
-OPTION(MEDCOUPLING_MICROMED "Build MED without MED file dependancy." OFF)
+OPTION(MEDCOUPLING_MICROMED "Build MED without MED file dependency." OFF)
 OPTION(MEDCOUPLING_ENABLE_PYTHON "Build PYTHON bindings." ON)
 OPTION(MEDCOUPLING_ENABLE_PARTITIONER "Build MEDPartitioner." ON)
 OPTION(MEDCOUPLING_ENABLE_RENUMBER "Build Renumber." ON)
@@ -69,9 +69,11 @@ ENDIF()
 CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner."  ${USE_METIS_NOT_PARMETIS}
         "MEDCOUPLING_ENABLE_PARTITIONER" OFF)
 CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON 
-        "MEDCOUPLING_ENABLE_PARTITIONER;NOT MEDCOUPLING_USE_MPI" OFF)
+        "MEDCOUPLING_ENABLE_PARTITIONER" OFF)
 CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ${MEDCOUPLING_USE_MPI} 
         "MEDCOUPLING_ENABLE_PARTITIONER;MEDCOUPLING_USE_MPI" OFF)
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_PTSCOTCH "Enable ptscotch graph library in MEDPartitioner." ${MEDCOUPLING_USE_MPI} 
+        "MEDCOUPLING_ENABLE_PARTITIONER;MEDCOUPLING_USE_MPI" OFF)
 SET(XDR_DEFAULT_OPTION ON)
 IF(WIN32)
     SET(XDR_DEFAULT_OPTION OFF)
@@ -89,6 +91,10 @@ IF(${MEDCOUPLING_PARTITIONER_PARMETIS} AND ${MEDCOUPLING_PARTITIONER_METIS})
     MESSAGE(FATAL_ERROR "ParMetis and Metis are mutually exclusive! Make a choice (options MEDCOUPLING_PARTITIONER_METIS and MEDCOUPLING_PARTITIONER_PARMETIS).")
 ENDIF()
 
+IF(${MEDCOUPLING_PARTITIONER_PTSCOTCH} AND ${MEDCOUPLING_PARTITIONER_SCOTCH})
+    MESSAGE(FATAL_ERROR "PTScotch and Scotch are mutually exclusive! Make a choice (options MEDCOUPLING_PARTITIONER_SCOTCH and MEDCOUPLING_PARTITIONER_PTSCOTCH).")
+ENDIF()
+
 #
 # Set list of prerequisites
 # =========================
@@ -138,6 +144,13 @@ IF(MEDCOUPLING_USE_MPI)
       ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS")
     ENDIF()
   ENDIF(MEDCOUPLING_PARTITIONER_PARMETIS)
+  IF(MEDCOUPLING_PARTITIONER_PTSCOTCH)
+    FIND_PACKAGE(SalomePTScotch)
+    SALOME_LOG_OPTIONAL_PACKAGE(PTScotch MEDCOUPLING_PARTITIONER_PTSCOTCH)
+    IF(SalomePTScotch_FOUND)
+      ADD_DEFINITIONS("-DMED_ENABLE_PTSCOTCH")
+    ENDIF(SalomePTScotch_FOUND)
+  ENDIF(MEDCOUPLING_PARTITIONER_PTSCOTCH)
 ENDIF(MEDCOUPLING_USE_MPI)
 
 IF(MEDCOUPLING_ENABLE_RENUMBER)
@@ -245,7 +258,7 @@ INCLUDE(CMakePackageConfigHelpers)
 # List of targets in this project we want to make visible to the rest of the world.
 # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
 SET(_${PROJECT_NAME}_exposed_targets
-   interpkernel medcoupling medcouplingremapper)
+   interpkernel medcouplingcpp medcouplingremapper)
 
 IF(NOT MEDCOUPLING_MICROMED)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader)