comparison cmake/FindOCC.cmake @ 624:01e01777ff50

CMake: initial import of CMake modules, closes #720
author David Demelier <markand@malikania.fr>
date Fri, 20 Oct 2017 14:18:37 +0200
parents
children
comparison
equal deleted inserted replaced
623:2081e695bfbd 624:01e01777ff50
1 # FindOCC
2 # -------
3 #
4 # Find vanilla OpenCascade libraries. It has *not* been tested with OpenCascade
5 # community edition.
6 #
7 # This modules defines:
8 # OCC_INCLUDE_DIRS, where to find OSD.hxx
9 # OCC_LIBRARIES, where to find components libraries
10 # OCC_FOUND, if it is found
11 #
12 # This module understand components. Just pass the library name to
13 # the components variable and the following variables will
14 # be defined:
15 #
16 # e.g find_package(OCC COMPONENTS TKbool)
17 #
18 # OCC_Xxx_LIBRARY where to find the library
19 # OCC_Xxx_FOUND if the variable is found
20 #
21 # The OCC_LIBRARIES is automatically filled with all components.
22
23 include(FindPackageMessage)
24
25 # find OSD.hxx
26 find_path(
27 OCC_INCLUDE_DIR OSD.hxx
28 PATH_SUFFIXES
29 OpenCASCADE
30 inc
31 )
32
33 foreach (c ${OCC_FIND_COMPONENTS})
34 find_library(
35 OCC_${c}_LIBRARY ${c}
36 PATH_SUFFIXES
37 win32/vc11/lib
38 )
39
40 if (OCC_${c}_LIBRARY)
41 set(OCC_${c}_FOUND TRUE)
42 list(APPEND OCC_LIBRARIES ${OCC_${c}_LIBRARY})
43 mark_as_advanced(OCC_${c}_LIBRARY)
44 endif ()
45 endforeach ()
46
47 include(FindPackageHandleStandardArgs)
48
49 find_package_handle_standard_args(
50 OCC
51 HANDLE_COMPONENTS
52 REQUIRED_VARS OCC_INCLUDE_DIR
53 )
54
55 if (OCC_FOUND)
56 set(OCC_INCLUDE_DIRS ${OCC_INCLUDE_DIR})
57 endif ()
58
59 mark_as_advanced(OCC_INCLUDE_DIR OCC_LIBRARIES)