#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARMETIS.cmake)
#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindMETIS.cmake)
#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSCOTCH.cmake)
-#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSPLITTER.cmake)
-#INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindRENUMBER.cmake)
#IF(WIN32)
# INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake)
#ENDIF(WIN32)
#
# User options
# ============
+INCLUDE(CMakeDependentOption)
OPTION(SALOME_MED_STANDALONE "Build MED without CORBA bindings. When OFF, exchange to PARAVIS is disabled." OFF)
OPTION(SALOME_MED_MICROMED "Build MED without MED file dependancy." OFF)
OPTION(SALOME_MED_ENABLE_PYTHON "Build PYTHON bindings." ON)
+OPTION(SALOME_MED_ENABLE_PARTITIONER "Build MEDPartitioner." ON)
OPTION(SALOME_USE_MPI "To build ParaMEDMEM." OFF)
OPTION(SALOME_BUILD_GUI "Build GUI of MED." ON)
OPTION(SALOME_BUILD_TESTS "Build MED tests." ON)
OPTION(SALOME_BUILD_DOC "Build MED doc." ON)
-
+CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
+CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
+CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF)
+#
#
# Set list of prerequisites
# =========================
IF(NOT SALOME_MED_MICROMED)
FIND_PACKAGE(SalomeHDF5 REQUIRED)
FIND_PACKAGE(SalomeMEDFile REQUIRED)
+ IF(SALOME_MED_ENABLE_PARTITIONER)
+ FIND_PACKAGE(SalomeLibXml2 REQUIRED)
+ ENDIF(SALOME_MED_ENABLE_PARTITIONER)
ENDIF(NOT SALOME_MED_MICROMED)
IF(SALOME_BUILD_GUI)
IF(NOT SALOME_MED_MICROMED)
ADD_SUBDIRECTORY(MEDLoader)
ADD_SUBDIRECTORY(RENUMBER)
+ IF(SALOME_MED_ENABLE_PARTITIONER)
+ ADD_SUBDIRECTORY(MEDPartitioner)
+ ENDIF(SALOME_MED_ENABLE_PARTITIONER)
IF(SALOME_BUILD_TESTS)
ADD_SUBDIRECTORY(INTERP_KERNELTest)
ENDIF(SALOME_BUILD_TESTS)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML_DEFINITIONS} ${MPI_DEFINITIONS})
-
-IF(SALOME_BUILD_TESTS)
- ADD_SUBDIRECTORY(Test)
-ENDIF(SALOME_BUILD_TESTS)
+ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML2_DEFINITIONS})
INCLUDE_DIRECTORIES(
- ${PARMETIS_INCLUDE_DIRS}
- ${METIS_INCLUDE_DIRS}
- ${SCOTCH_INCLUDE_DIRS}
- ${METIS_INCLUDE_DIRS}
- ${LIBXML_INCLUDE_DIRS}
+ ${LIBXML2_INCLUDE_DIR}
${MEDFILE_INCLUDE_DIRS}
${HDF5_INCLUDE_DIRS}
- ${MPI_INCLUDE_DIRS}
${PTHREADS_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
)
+IF(MED_ENABLE_SCOTCH)
+ ADD_DEFINITIONS(${SCOTCH_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS})
+ENDIF(MED_ENABLE_SCOTCH)
+
+IF(MED_ENABLE_METIS)
+ ADD_DEFINITIONS(${METIS_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS})
+ENDIF(MED_ENABLE_METIS)
+
+IF(MED_ENABLE_PARMETIS)
+ ADD_DEFINITIONS(${METIS_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${PARMETIS_INCLUDE_DIRS})
+ENDIF(MED_ENABLE_PARMETIS)
+
+IF(SALOME_USE_MPI)
+ ADD_DEFINITIONS(${MPI_DEFINITIONS})
+ ADD_DEFINITIONS("-DHAVE_MPI2")
+ INCLUDE_DIRECTORIES(${MPI_INCLUDE_DIRS})
+ENDIF(SALOME_USE_MPI)
+
+IF(SALOME_BUILD_TESTS)
+ ADD_SUBDIRECTORY(Test)
+ENDIF(SALOME_BUILD_TESTS)
+
SET(medpartitionercpp_HEADERS_HXX
MEDPARTITIONER_MeshCollection.hxx
MEDPARTITIONER_MeshCollectionDriver.hxx
${MEDFILE_C_LIBRARIES}
${HDF5_LIBRARIES}
${STDLIB}
- ${LIBXML_LIBRARIES}
+ ${LIBXML2_LIBRARIES}
${MPI_LIBRARIES}
interpkernel
medcoupling
MEDPARTITIONER_UtilsPara.cxx
MEDPARTITIONER_JointFinder.cxx
)
+ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx)
+ SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
+ TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp ${medpartitionercpp_LDFLAGS})
+ INSTALL(TARGETS medpartitioner_para DESTINATION ${SALOME_INSTALL_BINS})
ENDIF(SALOME_USE_MPI)
ADD_LIBRARY(medpartitionercpp SHARED ${medpartitionercpp_SOURCES})
SET_TARGET_PROPERTIES(medpartitionercpp PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS} ${PLATFORM_LIBS} ${PTHREAD_LIBS})
INSTALL(TARGETS medpartitionercpp DESTINATION ${SALOME_INSTALL_LIBS})
-
-IF(MED_ENABLE_PARMETIS)
- ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx)
- SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
- TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp ${medpartitionercpp_LDFLAGS})
- INSTALL(TARGETS medpartitioner_para DESTINATION ${SALOME_INSTALL_BINS})
-ENDIF(MED_ENABLE_PARMETIS)
ADD_EXECUTABLE(medpartitioner medpartitioner.cxx)
SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
ADD_DEFINITIONS(${BOOST_DEFINITIONS} ${CPPUNIT_DEFINITIONS})
INCLUDE_DIRECTORIES(
- ${PARMETIS_INCLUDE_DIRS}
- ${METIS_INCLUDE_DIRS}
- ${SCOTCH_INCLUDE_DIRS}
${CPPUNIT_INCLUDE_DIRS}
- ${METIS_INCLUDE_DIRS}
- ${LIBXML_INCLUDE_DIRS}
- ${MEDFILE_INCLUDE_DIRS}
- ${HDF5_INCLUDE_DIRS}
- ${MPI_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/..
- ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader
- ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling
- ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL
- ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases
- ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Geometric2D
- ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/ExprEval
- ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/GaussPoints
${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNELTest # for BasicMainTest.hxx
)
MEDPARTITIONERTest.cxx
)
-SET(MEDPARTITIONERTest_DEFINITIONS "")
SET(MEDPARTITIONERTest_LDFLAGS medpartitionercpp ${CPPUNIT_LIBRARIES})
-IF(MED_ENABLE_SCOTCH)
- SET(MEDPARTITIONERTest_DEFINITIONS "${MEDPARTITIONERTest_DEFINITIONS} ${SCOTCH_DEFINITIONS}")
-ENDIF(MED_ENABLE_SCOTCH)
-
-IF(MPI_IS_OK)
+IF(SALOME_USE_MPI)
IF(MED_ENABLE_PARMETIS)
SET(MEDPARTITIONERTest_SOURCES ${MEDPARTITIONERTest_SOURCES} MEDPARTITIONERTestPara.cxx)
- SET(MEDPARTITIONERTest_DEFINITIONS "${MEDPARTITIONERTest_DEFINITIONS} ${MPI_DEFINITIONS} ${PARMETIS_DEFINITIONS}")
ENDIF(MED_ENABLE_PARMETIS)
-ENDIF(MPI_IS_OK)
-
-IF(MED_ENABLE_METIS)
- SET(MEDPARTITIONERTest_DEFINITIONS "${MEDPARTITIONERTest_DEFINITIONS} ${METIS_DEFINITIONS}")
-ENDIF(MED_ENABLE_METIS)
+ENDIF(SALOME_USE_MPI)
ADD_LIBRARY(MEDPARTITIONERTest SHARED ${MEDPARTITIONERTest_SOURCES})
-SET_TARGET_PROPERTIES(MEDPARTITIONERTest PROPERTIES COMPILE_FLAGS "${MEDPARTITIONERTest_DEFINITIONS}")
TARGET_LINK_LIBRARIES(MEDPARTITIONERTest ${MEDPARTITIONERTest_LDFLAGS})
INSTALL(TARGETS MEDPARTITIONERTest DESTINATION ${SALOME_INSTALL_LIBS})
ADD_EXECUTABLE(TestMEDPARTITIONER TestMEDPARTITIONER.cxx)
-SET_TARGET_PROPERTIES(TestMEDPARTITIONER PROPERTIES COMPILE_FLAGS "${MEDPARTITIONERTest_DEFINITIONS}")
TARGET_LINK_LIBRARIES(TestMEDPARTITIONER MEDPARTITIONERTest)
INSTALL(TARGETS TestMEDPARTITIONER DESTINATION ${SALOME_INSTALL_BINS})