Salome HOME
1) Add new *.cmake files from the SALOME modules in the CONFIGURATION repository.
[tools/configuration.git] / cmake / FindMESHGEMS.cmake
1 # Copyright (C) 2013-2016  CEA/DEN, EDF R&D
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 # - Find MESHGEMS
21 # Sets the following variables:
22 #   MESHGEMS_INCLUDE_DIRS - path to the MESHGEMS include directory
23 #   MESHGEMS_LIBRARIES    - path to the MESHGEMS libraries to be linked against
24
25 # ------
26
27 MESSAGE(STATUS "Check for MESHGEMS ...")
28
29 # ------
30
31 SET(MESHGEMS_ROOT_DIR $ENV{MESHGEMS_ROOT_DIR})
32
33 IF(MESHGEMS_ROOT_DIR)
34   LIST(APPEND CMAKE_PREFIX_PATH "${MESHGEMS_ROOT_DIR}")
35 ENDIF(MESHGEMS_ROOT_DIR)
36
37 FIND_PATH(MESHGEMS_INCLUDE_DIRS meshgems/cadsurf.h PATH_SUFFIXES include)
38
39 IF(MACHINE_IS_64)
40   SET(_suff "_64")
41 ELSE()
42   SET(_suff)
43 ENDIF(MACHINE_IS_64)
44 IF(WIN32)       
45   SET(_plt WinXP${_suff}_VC9 WinXP${_suff}_VC10)
46 ELSE()
47   SET(_plt Linux${_suff})
48 ENDIF(WIN32)
49
50 FIND_LIBRARY(MESHGEMS_LIBRARY_mg-cadsurf NAMES mg-cadsurf PATH_SUFFIXES ${_plt})
51 FIND_LIBRARY(MESHGEMS_LIBRARY_mg-precad NAMES mg-precad PATH_SUFFIXES ${_plt})
52 FIND_LIBRARY(MESHGEMS_LIBRARY_meshgems NAMES meshgems PATH_SUFFIXES ${_plt})
53
54 # TODO: search all components
55 SET(MESHGEMS_LIBRARIES)
56 SET(MESHGEMS_LIBRARIES ${MESHGEMS_LIBRARIES} ${MESHGEMS_LIBRARY_mg-cadsurf})
57 SET(MESHGEMS_LIBRARIES ${MESHGEMS_LIBRARIES} ${MESHGEMS_LIBRARY_mg-precad})
58 IF(MESHGEMS_LIBRARY_meshgems)
59   SET(MESHGEMS_LIBRARIES ${MESHGEMS_LIBRARIES} ${MESHGEMS_LIBRARY_meshgems})
60 ENDIF(MESHGEMS_LIBRARY_meshgems)
61
62 INCLUDE(FindPackageHandleStandardArgs)
63 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MESHGEMS REQUIRED_VARS MESHGEMS_INCLUDE_DIRS MESHGEMS_LIBRARIES)