blob: 1a3e40f50d12a0849ed43aa1abd25e431678f7d5 (
plain)
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
|
#[=======================================================================[.rst:
FindSystemd
-----------
Find the systemd library
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``SYSTEMD_INCLUDE_DIRS``
where to find systemd/sd-daemon.h, etc.
``SYSTEMD_LIBRARIES``
the libraries to link against to use libsystemd.
``SYSTEMD_FOUND``
TRUE if found
#]=======================================================================]
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_Systemd QUIET libsystemd)
endif()
find_path(Systemd_INCLUDE_DIR NAMES systemd/sd-daemon.h
HINTS
${PC_Systemd_INCLUDE_DIRS}
)
mark_as_advanced(Systemd_INCLUDE_DIR)
find_library(Systemd_LIBRARY NAMES systemd
HINTS
${PC_Systemd_LIBRARY_DIRS}
)
mark_as_advanced(Systemd_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Systemd
REQUIRED_VARS
Systemd_LIBRARY Systemd_INCLUDE_DIR
)
if(Systemd_FOUND)
set(SYSTEMD_INCLUDE_DIRS ${Systemd_INCLUDE_DIR})
set(SYSTEMD_LIBRARIES ${Systemd_LIBRARY})
endif()
|