Salome HOME
Updated copyright comment
[tools/configuration.git] / cmake / FindMESHGEMS.cmake
1 # Copyright (C) 2013-2024  CEA, EDF, 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, 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_CADSURF_LIBRARY   - paths to the MESHGEMS libraries to be linked against
24 #   MESHGEMS_HEXA_LIBRARY
25 #   MESHGEMS_HYBRID_LIBRARY
26 #   MESHGEMS_TETRA_LIBRARY
27 #   MESHGEMS_TETRA_HPC_LIBRARY
28
29 # ------
30
31 MESSAGE(STATUS "Check for MESHGEMS ...")
32
33 # ------
34
35 SET(MESHGEMS_ROOT_DIR $ENV{MESHGEMS_ROOT_DIR})
36
37 IF(MESHGEMS_ROOT_DIR)
38 IF(WIN32)
39   LIST(APPEND CMAKE_PREFIX_PATH "${MESHGEMS_ROOT_DIR}/Products")
40 ELSE()
41   LIST(APPEND CMAKE_PREFIX_PATH "${MESHGEMS_ROOT_DIR}")
42 ENDIF()
43 ENDIF(MESHGEMS_ROOT_DIR)
44
45 FIND_PATH(MESHGEMS_INCLUDE_DIRS meshgems/cadsurf.h PATH_SUFFIXES include)
46
47 IF(MACHINE_IS_64)
48   SET(_suff "_64")
49 ELSE()
50   SET(_suff)
51 ENDIF(MACHINE_IS_64)
52 IF(WIN32)
53   SET(_plt Win7${_suff}_VC9 Win7${_suff}_VC10 Win7${_suff}_VC14 WinXP${_suff}_VC9 WinXP${_suff}_VC10)
54 ELSE()
55   SET(_plt Linux${_suff})
56 ENDIF(WIN32)
57
58 FIND_LIBRARY(MESHGEMS_LIB_meshgems       NAMES meshgems       PATH_SUFFIXES ${_plt})
59 FIND_LIBRARY(MESHGEMS_LIB_meshgems_stubs NAMES meshgems_stubs PATH_SUFFIXES ${_plt})
60 FIND_LIBRARY(MESHGEMS_CADSURF_LIBRARY    NAMES mg-cadsurf     PATH_SUFFIXES ${_plt})
61 FIND_LIBRARY(MESHGEMS_HEXA_LIBRARY       NAMES mg-hexa        PATH_SUFFIXES ${_plt})
62 FIND_LIBRARY(MESHGEMS_HYBRID_LIBRARY     NAMES mg-hybrid      PATH_SUFFIXES ${_plt})
63 FIND_LIBRARY(MESHGEMS_TETRA_LIBRARY      NAMES mg-tetra       PATH_SUFFIXES ${_plt})
64 FIND_LIBRARY(MESHGEMS_TETRA_HPC_LIBRARY  NAMES mg-tetra_hpc   PATH_SUFFIXES ${_plt})
65 FIND_LIBRARY(MESHGEMS_CVM_LIBRARY        NAMES mg-cvm         PATH_SUFFIXES ${_plt})
66
67 # TODO: search all components
68 IF(MESHGEMS_LIB_meshgems)
69   SET(MESHGEMS_LIBRARY_meshgems  ${MESHGEMS_LIB_meshgems}  ${MESHGEMS_LIB_meshgems_stubs})
70
71   SET(MESHGEMS_CADSURF_LIBRARY   ${MESHGEMS_CADSURF_LIBRARY}   ${MESHGEMS_LIBRARY_meshgems})
72   SET(MESHGEMS_HEXA_LIBRARY      ${MESHGEMS_HEXA_LIBRARY}      ${MESHGEMS_LIBRARY_meshgems})
73   SET(MESHGEMS_HYBRID_LIBRARY    ${MESHGEMS_HYBRID_LIBRARY}    ${MESHGEMS_LIBRARY_meshgems})
74   SET(MESHGEMS_TETRA_LIBRARY     ${MESHGEMS_TETRA_LIBRARY}     ${MESHGEMS_LIBRARY_meshgems})
75   SET(MESHGEMS_TETRA_HPC_LIBRARY ${MESHGEMS_TETRA_HPC_LIBRARY} ${MESHGEMS_LIBRARY_meshgems})
76   SET(MESHGEMS_CVM_LIBRARY       ${MESHGEMS_CVM_LIBRARY}       ${MESHGEMS_LIBRARY_meshgems})
77 ENDIF(MESHGEMS_LIB_meshgems)
78
79 INCLUDE(FindPackageHandleStandardArgs)
80 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MESHGEMS REQUIRED_VARS MESHGEMS_INCLUDE_DIRS MESHGEMS_CADSURF_LIBRARY MESHGEMS_HEXA_LIBRARY MESHGEMS_HYBRID_LIBRARY MESHGEMS_TETRA_LIBRARY MESHGEMS_TETRA_HPC_LIBRARY)