1 # Copyright (C) 2010-2015 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Find the MED includes and library
23 # MED3HOME, a directory where MED was installed. This directory is used to help find trhe other values.
24 # MED_INCLUDE_DIR, where to find med.h
25 # MED_INCLUDE_DIRS, where to find med.h file, concatenated with other include dirs from HDF5 and MPI (if parallel)
26 # MED_LIBRARIES, libraries to link against to use MED. (including HDF5 and MPI if parallel)
27 # MED_FOUND, If false, do not try to use MED.
28 # also defined, but not for general use are
29 # MED_LIBRARY, the med library.
30 # MEDC_LIBRARY, the medC library
32 SET(MED3HOME $ENV{MED3HOME} CACHE PATH "Path to the med install dir")
35 FIND_PROGRAM(MDUMP mdump)
37 SET(MED3HOME ${MDUMP})
38 GET_FILENAME_COMPONENT(MED3HOME ${MED3HOME} PATH)
39 GET_FILENAME_COMPONENT(MED3HOME ${MED3HOME} PATH)
43 FIND_PATH(MED_INCLUDE_DIR med.h
51 FIND_LIBRARY(MED_LIBRARY med
53 ${MED_INCLUDE_DIR}/../lib
60 get_filename_component(MED_LIBRARY_DIR ${MED_LIBRARY} PATH)
62 FIND_LIBRARY(MEDC_LIBRARY medC
74 SET(MED_LIBRARIES ${MED_LIBRARY} ${MEDC_LIBRARY} )
75 SET( MED_FOUND "YES" )
78 ENDIF(MED_INCLUDE_DIR)
82 SET(MED_LIBRARIES ${MED_LIBRARIES} ${HDF5_LIBS})
83 SET(MED_INCLUDE_DIRS ${MED_INCLUDE_DIR} ${HDF5_INCLUDE_DIR})
85 FIND_PACKAGE(SalomeHDF5 REQUIRED)
86 SET(MED_LIBRARIES ${MED_LIBRARIES} ${HDF5_LIBRARIES})
87 SET(MED_INCLUDE_DIRS ${MED_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS})
88 IF(${HDF5_IS_PARALLEL})
89 FIND_PACKAGE(SalomeMPI REQUIRED)
90 SET(MED_LIBRARIES ${MED_LIBRARIES} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
91 SET(MED_INCLUDE_DIRS ${MED_INCLUDE_DIRS} ${MPI_INCLUDE_PATH})
92 ENDIF(${HDF5_IS_PARALLEL})
96 SET(MED_INCLUDE_DIR ${MED_INCLUDE_DIRS})