forked from OpenNavigationSurface/BAG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindBAG.cmake
80 lines (62 loc) · 1.61 KB
/
FindBAG.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
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
# Distributed under the OSI-approved BSD 3-Clause License. See LICENSE
# file accompanying BAG source for details.
#[=======================================================================[.rst:
FindBAG
-------
Finds the BAG library.
Imported Targets
^^^^^^^^^^^^^^^^
This module provides the following imported targets, if found:
The baglib library
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``BAG_FOUND``
True if the system has the BAG library.
``BAG_VERSION``
The version of the BAG library which was found.
``BAG_INCLUDE_DIRS``
Include directories needed to use BAG.
``BAG_LIBRARIES``
Libraries needed to link to BAG.
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``BAG_INCLUDE_DIR``
The directory containing ``bag_dataset.h``.
``BAG_LIBRARY``
The path to the BAG library.
#]=======================================================================]
find_package(PkgConfig)
pkg_check_modules(PC_BAG QUIET BAG)
find_path(BAG_INCLUDE_DIR
NAMES bag_dataset.h
PATHS ${PC_BAG_INCLUDE_DIRS}
PATH_SUFFIXES
include
include/bag
include/BAG
include/baglib
)
find_library(BAG_LIBRARY
NAMES baglib
PATHS ${PC_BAG_LIBRARY_DIRS}
)
set(BAG_VERSION ${PC_BAG_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BAG
FOUND_VAR BAG_FOUND
REQUIRED_VARS
BAG_LIBRARY
BAG_INCLUDE_DIR
VERSION_VAR BAG_VERSION
)
if(BAG_FOUND)
set(BAG_LIBRARIES ${BAG_LIBRARY})
set(BAG_INCLUDE_DIRS ${BAG_INCLUDE_DIR})
set(BAG_DEFINITIONS ${PC_BAG_CFLAGS_OTHER})
endif()
mark_as_advanced(
BAG_INCLUDE_DIR
BAG_LIBRARY
)