forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindOCC.cmake
34 lines (28 loc) · 1.23 KB
/
FindOCC.cmake
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
# - Try to find OpenCASCADE libraries
### Does not test what version has been found,though
### that could be done by parsing Standard_Version.hxx
# Once done, this will define
# OCC_FOUND - true if OCC has been found
# OCC_INCLUDE_DIR - the OCC include dir
# OCC_LIBRARIES (not cached) - full path of OCC libraries
set(_occdirs ${CASROOT} ${CASS_DIR} $ENV{CASROOT} /opt/occ)
find_path(OCC_INCLUDE_DIR
NAMES Standard_Real.hxx
HINTS ${_occdirs} /usr/include/opencascade /usr/include/oce
PATH_SUFFIXES inc
DOC "Specify the directory containing Standard_Real.hxx")
foreach(_libname ${OCC_FIND_COMPONENTS})
list(APPEND OCC_REQUIRED_LIBRARIES OCC_${_libname}_LIBRARY)
find_library(OCC_${_libname}_LIBRARY $
NAMES ${_libname}
HINTS ${_occdirs}
PATH_SUFFIXES lib)
if(OCC_${_libname}_LIBRARY)
list(APPEND OCC_LIBRARIES ${OCC_${_libname}_LIBRARY})
endif()
endforeach()
# handle the QUIETLY and REQUIRED arguments and set OCC_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OCC DEFAULT_MSG OCC_INCLUDE_DIR ${OCC_REQUIRED_LIBRARIES})
mark_as_advanced(OCC_INCLUDE_DIR ${OCC_REQUIRED_LIBRARIES})