+++ /dev/null
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# ------
-
-MESSAGE(STATUS "Check for metis ...")
-
-# ------
-
-IF(METIS_IS_MANDATORY STREQUAL 0)
- SET(METIS_IS_MANDATORY 0)
- SET(METIS_IS_OPTIONAL 1)
-ENDIF(METIS_IS_MANDATORY STREQUAL 0)
-IF(METIS_IS_OPTIONAL STREQUAL 0)
- SET(METIS_IS_MANDATORY 1)
- SET(METIS_IS_OPTIONAL 0)
-ENDIF(METIS_IS_OPTIONAL STREQUAL 0)
-IF(NOT METIS_IS_MANDATORY AND NOT METIS_IS_OPTIONAL)
- SET(METIS_IS_MANDATORY 0)
- SET(METIS_IS_OPTIONAL 1)
-ENDIF(NOT METIS_IS_MANDATORY AND NOT METIS_IS_OPTIONAL)
-
-# ------
-
-SET(MED_ENABLE_METIS 1)
-IF(WITHOUT_METIS OR WITH_METIS STREQUAL 0)
- SET(MED_ENABLE_METIS 0)
- MESSAGE(STATUS "metis disabled from command line.")
-ENDIF(WITHOUT_METIS OR WITH_METIS STREQUAL 0)
-
-# ------
-
-IF(MED_ENABLE_METIS)
- IF(WITH_METIS)
- SET(METIS_ROOT_USER ${WITH_METIS})
- ENDIF(WITH_METIS)
- IF(NOT METIS_ROOT_USER)
- SET(METIS_ROOT_USER $ENV{METISDIR})
- ENDIF(NOT METIS_ROOT_USER)
- IF(NOT METIS_ROOT_USER)
- SET(METIS_ROOT_USER $ENV{METIS_ROOT})
- ENDIF(NOT METIS_ROOT_USER)
- IF(NOT METIS_ROOT_USER)
- SET(METIS_ROOT_USER $ENV{METISHOME})
- ENDIF(NOT METIS_ROOT_USER)
-ENDIF(MED_ENABLE_METIS)
-
-# ------
-
-IF(MED_ENABLE_METIS)
- IF(NOT METIS_ROOT_USER)
- FIND_PROGRAM(METIS_MAINBINARY pmetis)
- IF(METIS_MAINBINARY)
- MESSAGE(STATUS "metis found: ${METIS_MAINBINARY}")
- IF(METIS_MAINBINARY STREQUAL /usr/bin/pmetis)
- ELSE(METIS_MAINBINARY STREQUAL /usr/bin/pmetis)
- SET(METIS_ROOT_USER ${METIS_MAINBINARY})
- GET_FILENAME_COMPONENT(METIS_ROOT_USER ${METIS_ROOT_USER} PATH)
- ENDIF(METIS_MAINBINARY STREQUAL /usr/bin/pmetis)
- ELSE(METIS_MAINBINARY)
- MESSAGE(STATUS "metis not found, try to use WITH_METIS option or METIS_ROOT (or METISHOME or METISDIR) environment variable")
- SET(MED_ENABLE_METIS 0)
- ENDIF(METIS_MAINBINARY)
- ENDIF(NOT METIS_ROOT_USER)
-ENDIF(MED_ENABLE_METIS)
-
-# ------
-
-IF(MED_ENABLE_METIS)
- IF(METIS_ROOT_USER)
- SET(METIS_FIND_PATHS_OPTION NO_DEFAULT_PATH)
- ELSE(METIS_ROOT_USER)
- SET(METIS_FIND_PATHS_OPTION)
- ENDIF(METIS_ROOT_USER)
-ENDIF(MED_ENABLE_METIS)
-
-# ------
-
-IF(MED_ENABLE_METIS)
- IF(METIS_ROOT_USER)
- SET(METIS_INCLUDE_PATHS ${METIS_ROOT_USER}/Lib)
- ELSE(METIS_ROOT_USER)
- SET(METIS_INCLUDE_PATHS)
- ENDIF(METIS_ROOT_USER)
- SET(METIS_INCLUDE_TO_FIND metis.h)
- FIND_PATH(METIS_INCLUDE_DIR ${METIS_INCLUDE_TO_FIND} PATHS ${METIS_INCLUDE_PATHS} ${METIS_FIND_PATHS_OPTION})
- SET(METIS_DEFINITIONS)
- IF(METIS_INCLUDE_DIR)
- IF(METIS_ROOT_USER)
- SET(METIS_INCLUDES -I${METIS_INCLUDE_DIR})#to remove
- SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
- ENDIF(METIS_ROOT_USER)
- SET(METIS_INCLUDES -D_METISUSEDLL_ ${METIS_INCLUDES})#to remove
- SET(METIS_DEFINITIONS "${METIS_DEFINITIONS} -D_METISUSEDLL_")
- MESSAGE(STATUS "${METIS_INCLUDE_TO_FIND} found in ${METIS_INCLUDE_DIR}")
- ELSE(METIS_INCLUDE_DIR)
- SET(MED_ENABLE_METIS 0)
- IF(METIS_ROOT_USER)
- MESSAGE(STATUS "${METIS_INCLUDE_TO_FIND} not found in ${METIS_INCLUDE_PATHS}, check your METIS installation.")
- ELSE(METIS_ROOT_USER)
- MESSAGE(STATUS "${METIS_INCLUDE_TO_FIND} not found on system, try to use WITH_METIS option or METIS_ROOT (or METISHOME or METISDIR) environment variable.")
- ENDIF(METIS_ROOT_USER)
- ENDIF(METIS_INCLUDE_DIR)
-ENDIF(MED_ENABLE_METIS)
-
-# ----
-
-IF(MED_ENABLE_METIS)
- IF(METIS_ROOT_USER)
- IF(WINDOWS)
- SET(METIS_LIB_PATHS ${METIS_ROOT_USER}/dll ${METIS_ROOT_USER}/lib)
- ELSE(WINDOWS)
- SET(METIS_LIB_PATHS ${METIS_ROOT_USER})
- ENDIF(WINDOWS)
- ELSE(METIS_ROOT_USER)
- SET(METIS_LIB_PATHS)
- ENDIF(METIS_ROOT_USER)
- IF(WINDOWS)
- IF(CMAKE_BUILD_TYPE STREQUAL Release)
- FIND_LIBRARY(METIS_LIB metisdll PATHS ${METIS_LIB_PATHS} ${METIS_FIND_PATHS_OPTION})
- ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
- FIND_LIBRARY(METIS_LIB metisddll PATHS ${METIS_LIB_PATHS} ${METIS_FIND_PATHS_OPTION})
- ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
- ELSE(WINDOWS)
- FIND_LIBRARY(METIS_LIB metis PATHS ${METIS_LIB_PATHS} ${METIS_FIND_PATHS_OPTION})
- ENDIF(WINDOWS)
- SET(METIS_LIBS)
- IF(METIS_LIB)
- SET(METIS_LIBS ${METIS_LIBS} ${METIS_LIB})
- MESSAGE(STATUS "metis lib found: ${METIS_LIB}")
- ELSE(METIS_LIB)
- SET(MED_ENABLE_METIS 0)
- IF(METIS_ROOT_USER)
- MESSAGE(STATUS "metis lib not found in ${METIS_LIB_PATHS}, check your METIS installation.")
- ELSE(METIS_ROOT_USER)
- MESSAGE(STATUS "metis lib not found on system, try to use WITH_METIS option or METIS_ROOT (or METISHOME or METISDIR) environment variable.")
- ENDIF(METIS_ROOT_USER)
- ENDIF(METIS_LIB)
-ENDIF(MED_ENABLE_METIS)
-
-# ----
-
-IF(MED_ENABLE_METIS)
- SET(METIS_CPPFLAGS ${METIS_INCLUDES} -DMED_ENABLE_METIS)
- SET(METIS_DEFINITIONS "${METIS_DEFINITIONS} -DMED_ENABLE_METIS")
-ELSE(MED_ENABLE_METIS)
- IF(METIS_IS_MANDATORY)
- MESSAGE(FATAL_ERROR "metis not found ... mandatory ... abort")
- ELSE(METIS_IS_MANDATORY)
- MESSAGE(STATUS "metis not found ... optional ... disabled")
- ENDIF(METIS_IS_MANDATORY)
-ENDIF(MED_ENABLE_METIS)
-
-# ------
--- /dev/null
+# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# ------
+
+MESSAGE(STATUS "Check for metis ...")
+
+SET(METIS_ROOT_DIR $ENV{METIS_ROOT_DIR} CACHE PATH "Path to the MEDFile.")
+IF(METIS_ROOT_DIR)
+ LIST(APPEND CMAKE_LIBRARY_PATH "${METIS_ROOT_DIR}")
+ LIST(APPEND CMAKE_INCLUDE_PATH "${METIS_ROOT_DIR}/Lib")
+ENDIF(METIS_ROOT_DIR)
+
+FIND_LIBRARY(METIS_LIBRARIES metis)
+FIND_PATH(METIS_INCLUDE_DIRS metis.h)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Metis REQUIRED_VARS METIS_INCLUDE_DIRS METIS_LIBRARIES)
--- /dev/null
+# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Medfile detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Metis METIS_ROOT_DIR_EXP 0)
+#MARK_AS_ADVANCED()
INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS})
ENDIF(MED_ENABLE_SCOTCH)
-IF(MED_ENABLE_METIS)
+IF(SALOME_MED_PARTITIONER_METIS)
ADD_DEFINITIONS(${METIS_DEFINITIONS})
+ ADD_DEFINITIONS("-DMED_ENABLE_METIS")
INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS})
-ENDIF(MED_ENABLE_METIS)
+ENDIF(SALOME_MED_PARTITIONER_METIS)
IF(MED_ENABLE_PARMETIS)
- ADD_DEFINITIONS(${METIS_DEFINITIONS})
+ ADD_DEFINITIONS(${PARMETIS_DEFINITIONS})
INCLUDE_DIRECTORIES(${PARMETIS_INCLUDE_DIRS})
ENDIF(MED_ENABLE_PARMETIS)
SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${PARMETIS_DEFINITIONS}")
SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBS})
ENDIF(MED_ENABLE_PARMETIS)
-IF(MED_ENABLE_METIS)
+IF(SALOME_MED_PARTITIONER_METIS)
SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx)
SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx)
SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${METIS_DEFINITIONS}")
- SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBS})
-ENDIF(MED_ENABLE_METIS)
+ SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBRARIES})
+ENDIF(SALOME_MED_PARTITIONER_METIS)
IF(MED_ENABLE_SCOTCH)
SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ScotchGraph.hxx)
SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ScotchGraph.cxx)