-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFindEvents.cmake
More file actions
76 lines (60 loc) · 1.8 KB
/
Copy pathFindEvents.cmake
File metadata and controls
76 lines (60 loc) · 1.8 KB
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
#[=======================================================================[
FindEvents
------------
Find the Events event loop library.
Imported Targets
^^^^^^^^^^^^^^^^
This module defines the following imported targets:
EVENTS::LOOP
The events tls library, if found.
Result Variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``EVENTS_FOUND``
System has the events library.
``EVENTS_INCLUDE_DIR``
The events include directory.
``EVENTS_LIBRARY``
The events library.
``EVENTS_VERSION``
This is set to $major.$minor.$revision (e.g. 2.6.8).
Hints
^^^^^
Set EVENTS_ROOT_DIR to the root directory of an events installation.
]=======================================================================]
# Find TLS Library
find_library(events_LIBRARY
NAMES
events
libevents
)
mark_as_advanced(events_LIBRARY)
# Find Include Path
find_path(events_INCLUDE_DIR
NAMES events.h
)
mark_as_advanced(events_INCLUDE_DIR)
include (FindPackageHandleStandardArgs)
# Set Find Package Arguments
find_package_handle_standard_args(events
FOUND_VAR events_FOUND
REQUIRED_VARS EVENTS_LIBRARY EVENTS_INCLUDE_DIR
VERSION_VAR EVENTS_VERSION
HANDLE_COMPONENTS
FAIL_MESSAGE
"Could NOT find events, try setting the path to events using the EVENTS_ROOT_DIR environment variable"
)
set(EVENTS_FOUND ${events_FOUND})
set(EVENTS_LIBRARY ${EVENTS_LIBRARY})
# events Found
if(EVENTS_FOUND)
set(EVENTS_INCLUDE_DIRS ${EVENTS_INCLUDE_DIR})
set(EVENTS_LIBRARIES ${EVENTS_LIBRARY})
if(NOT TARGET EVENTS::LOOP)
add_library(EVENTS::LOOP UNKNOWN IMPORTED)
set_target_properties(EVENTS::LOOP PROPERTIES
IMPORTED_LOCATION "${EVENTS_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${EVENTS_INCLUDE_DIRS}"
)
endif()
endif(EVENTS_FOUND)