]> SALOME platform Git repositories - modules/med.git/blob - adm_local/cmake_files/FindMEDCoupling.cmake
Salome HOME
Set PARAMED*_LIBRARY variables
[modules/med.git] / adm_local / cmake_files / FindMEDCoupling.cmake
1 # Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20
21 # Find MEDCoupling installation
22 #
23 # The following variable are set:
24 #   MEDCOUPLING_INCLUDE_DIRS
25 #   INTERPKERNEL_LIBRARY
26 #   MEDCOUPLING_LIBRARY
27 #   MEDLOADER_LIBRARY
28 #   PARAMEDMEM_LIBRARY
29 #   PARAMEDLOADER_LIBRARY
30 #   MEDCOUPLING_LIBRARIES
31 #   MEDCOUPLING_PYTHON_DIRS
32 #
33 #  The CMake (or environment) variable MEDCOUPLING_ROOT_DIR can be set to
34 #  guide the detection and indicate a root directory to look into.
35 #
36
37 MESSAGE(STATUS "Check for MEDCoupling ...")
38
39 SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to the MEDCoupling.")
40 IF(MEDCOUPLING_ROOT_DIR)
41   LIST(APPEND CMAKE_PREFIX_PATH "${MEDCOUPLING_ROOT_DIR}")
42 ENDIF(MEDCOUPLING_ROOT_DIR)
43
44 FIND_PATH(MEDCOUPLING_INCLUDE_DIRS MEDCoupling.hxx) # mandatory
45
46 FIND_LIBRARY(INTERPKERNEL_LIBRARY NAMES interpkernel) # mandatory
47 FIND_LIBRARY(MEDCOUPLING_REMAPPER_LIBRARY NAMES medcouplingremapper) # mandatory
48 FIND_LIBRARY(MEDCOUPLING_LIBRARY NAMES medcoupling) # mandatory
49 FIND_LIBRARY(MEDLOADER_LIBRARY NAMES medloader) # optional
50 FIND_LIBRARY(PARAMEDMEM_LIBRARY NAMES paramedmem) # optional
51 FIND_LIBRARY(PARAMEDLOADER_LIBRARY NAMES paramedloader) # optional
52 FIND_LIBRARY(MEDPARTITIONERCPP_LIBRARY NAMES medpartitionercpp) # optional
53 FIND_LIBRARY(RENUMBERCPP_LIBRARY NAMES renumbercpp) # optional
54
55 FIND_PACKAGE(PythonInterp QUIET)
56 FIND_PATH(MEDCOUPLING_PYTHON_DIRS NAMES MEDCoupling.py MEDLoader.py PATH_SUFFIXES lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) # optional
57
58 SET(MEDCOUPLING_LIBRARIES
59   ${INTERPKERNEL_LIBRARY}
60   ${MEDCOUPLING_REMAPPER_LIBRARY}
61   ${MEDCOUPLING_LIBRARY}
62   ${MEDLOADER_LIBRARY}
63   ${MEDPARTITIONERCPP_LIBRARY}
64   ${RENUMBERCPP_LIBRARY}
65   )
66
67 INCLUDE(FindPackageHandleStandardArgs)
68 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MEDCoupling REQUIRED_VARS MEDCOUPLING_INCLUDE_DIRS MEDCOUPLING_LIBRARIES)