1 # - Find MED file installation
3 # The following variable are set:
9 # The CMake (or environment) variable MEDFILE_ROOT_DIR can be set to
10 # guide the detection and indicate a root directory to look into.
12 ############################################################################
13 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
15 # This library is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU Lesser General Public
17 # License as published by the Free Software Foundation; either
18 # version 2.1 of the License, or (at your option) any later version.
20 # This library is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 # Lesser General Public License for more details.
25 # You should have received a copy of the GNU Lesser General Public
26 # License along with this library; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
34 MESSAGE(STATUS "Check for medfile ...")
38 SET(MEDFILE_ROOT_DIR $ENV{MEDFILE_ROOT_DIR} CACHE PATH "Path to the MEDFile.")
40 LIST(APPEND CMAKE_PREFIX_PATH "${MEDFILE_ROOT_DIR}")
41 ENDIF(MEDFILE_ROOT_DIR)
43 FIND_PATH(MEDFILE_INCLUDE_DIRS med.h)
44 #FIND_PROGRAM(MDUMP mdump)
45 FIND_LIBRARY(MEDFILE_C_LIBRARIES NAMES medC)
46 FIND_LIBRARY(MEDFILE_F_LIBRARIES NAMES med)
47 IF(MEDFILE_F_LIBRARIES)
48 SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES} ${MEDFILE_F_LIBRARIES})
49 ELSE(MEDFILE_F_LIBRARIES)
50 SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES})
51 ENDIF(MEDFILE_F_LIBRARIES)
53 INCLUDE(FindPackageHandleStandardArgs)
54 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MEDFile REQUIRED_VARS MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES)