Salome HOME
Removing GL2PS build options, since it is not used anymore.
[tools/configuration.git] / cmake / FindMEDFile.cmake
1 # - Find MED file installation
2 #
3 # The following variable are set:
4 #   MEDFILE_INCLUDE_DIRS
5 #   MEDFILE_LIBRARIES
6 #   MEDFILE_C_LIBRARIES
7 #   MEDFILE_F_LIBRARIES
8 #
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.
11 #
12 ############################################################################
13 # Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
14 #
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.
19 #
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.
24 #
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
28 #
29 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
30 #
31
32 # ------
33
34 MESSAGE(STATUS "Check for medfile ...")
35
36 # ------
37
38 SET(MEDFILE_ROOT_DIR $ENV{MEDFILE_ROOT_DIR} CACHE PATH "Path to the MEDFile.")
39 IF(MEDFILE_ROOT_DIR)
40   LIST(APPEND CMAKE_PREFIX_PATH "${MEDFILE_ROOT_DIR}")
41 ENDIF(MEDFILE_ROOT_DIR)
42
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)
52
53 INCLUDE(FindPackageHandleStandardArgs)
54 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MEDFile REQUIRED_VARS MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES)