File: FindOPENCASCADE.cmake

package info (click to toggle)
deal.ii 9.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 181,876 kB
  • sloc: cpp: 265,739; ansic: 52,054; python: 1,507; perl: 645; sh: 506; xml: 437; makefile: 73
file content (81 lines) | stat: -rw-r--r-- 2,638 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
## ---------------------------------------------------------------------
##
## Copyright (C) 2012 - 2017 by the deal.II authors
##
## This file is part of the deal.II library.
##
## The deal.II library is free software; you can use it, redistribute
## it, and/or modify it under the terms of the GNU Lesser General
## Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## The full text of the license can be found in the file LICENSE at
## the top level of the deal.II distribution.
##
## ---------------------------------------------------------------------


#
# Try to find the OpenCASCADE (OCC) library. This scripts supports the
# OpenCASCADE Community Edition (OCE) library, which is a cmake based
# OCC library. You might try the original OpenCASCADE library, but your
# mileage may vary.
#
# This module exports:
#
#   OPENCASCADE_DIR
#   OPENCASCADE_INCLUDE_DIRS
#   OPENCASCADE_LIBRARIES
#   OPENCASCADE_VERSION
#


SET(OPENCASCADE_DIR "" CACHE PATH "An optional hint to a OpenCASCADE installation")
SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{OPENCASCADE_DIR}")
SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{OCC_DIR}")
SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{OCE_DIR}")
SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{CASROOT}")


DEAL_II_FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
  HINTS ${OPENCASCADE_DIR}
  PATH_SUFFIXES include include/oce include/opencascade inc
  )

IF(EXISTS ${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx)
  FILE(STRINGS "${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx" OPENCASCADE_VERSION
    REGEX "#define OCC_VERSION_COMPLETE "
    )
  STRING(REGEX REPLACE
    "#define OCC_VERSION_COMPLETE.*\"(.*)\"" "\\1"
    OPENCASCADE_VERSION "${OPENCASCADE_VERSION}"
    )
ENDIF()

# These seem to be pretty much the only required ones.
SET(_opencascade_libraries
  TKBO TKBool TKBRep TKernel TKFeat TKFillet TKG2d TKG3d TKGeomAlgo
  TKGeomBase TKHLR TKIGES TKMath TKMesh TKOffset TKPrim TKShHealing TKSTEP
  TKSTEPAttr TKSTEPBase TKSTEP209 TKSTL TKTopAlgo TKXSBase
  )

SET(_libraries "")
FOREACH(_library ${_opencascade_libraries})
  LIST(APPEND _libraries OPENCASCADE_${_library})
  DEAL_II_FIND_LIBRARY(OPENCASCADE_${_library}
    NAMES ${_library}
    HINTS ${OPENCASCADE_DIR}
    PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib mac64/clang/lib mac32/clang/lib lin64/gcc/lib lin32/gcc/lib
    )
ENDFOREACH()


DEAL_II_PACKAGE_HANDLE(OPENCASCADE
  LIBRARIES
    REQUIRED ${_libraries}
  INCLUDE_DIRS
    REQUIRED OPENCASCADE_INCLUDE_DIR
  USER_INCLUDE_DIRS
    REQUIRED OPENCASCADE_INCLUDE_DIR
  CLEAR
    _opencascade_libraries ${_libraries}
  )