1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 18:18:10 +00:00
transmission/cmake/FindSYSTEMD.cmake

20 lines
572 B
CMake

if(UNIX)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
endif()
find_path(SYSTEMD_INCLUDE_DIR NAMES systemd/sd-daemon.h HINTS ${PC_SYSTEMD_INCLUDE_DIRS})
find_library(SYSTEMD_LIBRARY NAMES systemd HINTS ${PC_SYSTEMD_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SYSTEMD
REQUIRED_VARS
SYSTEMD_LIBRARY
SYSTEMD_INCLUDE_DIR
)
mark_as_advanced(SYSTEMD_INCLUDE_DIR SYSTEMD_LIBRARY)
set(SYSTEMD_INCLUDE_DIRS ${SYSTEMD_INCLUDE_DIR})
set(SYSTEMD_LIBRARIES ${SYSTEMD_LIBRARY})