Salome HOME
little bug
[modules/med.git] / adm_local_without_kernel / cmake_files / FindMEDFile.cmake
1 # Copyright (C) 2007-2013  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.
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
22 MESSAGE(STATUS "Check for medfile ...")
23
24 # ------
25
26 SET(MEDFILE_ROOT_DIR $ENV{MEDFILE_ROOT_DIR} CACHE PATH "Path to the MEDFile.")
27 IF(MEDFILE_ROOT_DIR)
28   LIST(APPEND CMAKE_PREFIX_PATH "${MEDFILE_ROOT_DIR}")
29 ENDIF(MEDFILE_ROOT_DIR)
30
31 FIND_PATH(MEDFILE_INCLUDE_DIRS med.h)
32 #FIND_PROGRAM(MDUMP mdump)
33 FIND_LIBRARY(MEDFILE_C_LIBRARIES libmedC.so medC)
34 FIND_LIBRARY(MEDFILE_F_LIBRARIES libmed.so med)
35 IF(MEDFILE_F_LIBRARIES)
36   SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES} ${MEDFILE_F_LIBRARIES})
37 ELSE(MEDFILE_F_LIBRARIES)
38     SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES})
39 ENDIF(MEDFILE_F_LIBRARIES)
40
41 INCLUDE(FindPackageHandleStandardArgs)
42 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MEDFile REQUIRED_VARS MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES)