summaryrefslogtreecommitdiff
path: root/cmake/systemd.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/systemd.cmake')
-rw-r--r--cmake/systemd.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake
index f7365066ef6..fc36d7cefbf 100644
--- a/cmake/systemd.cmake
+++ b/cmake/systemd.cmake
@@ -20,10 +20,12 @@ MACRO(CHECK_SYSTEMD)
SET(WITH_SYSTEMD "auto" CACHE STRING "Enable systemd scripts and notification support")
IF(WITH_SYSTEMD STREQUAL "yes" OR WITH_SYSTEMD STREQUAL "auto")
IF(PKG_CONFIG_FOUND)
- IF(WITH_SYSTEMD STREQUAL "yes")
- pkg_search_module(LIBSYSTEMD REQUIRED libsystemd libsystemd-daemon)
- ELSE()
- pkg_search_module(LIBSYSTEMD libsystemd libsystemd-daemon)
+ IF (NOT DEFINED LIBSYSTEMD_FOUND)
+ IF(WITH_SYSTEMD STREQUAL "yes")
+ pkg_search_module(LIBSYSTEMD REQUIRED libsystemd libsystemd-daemon)
+ ELSE()
+ pkg_search_module(LIBSYSTEMD libsystemd libsystemd-daemon)
+ ENDIF()
ENDIF()
IF(HAVE_DLOPEN)
SET(LIBSYSTEMD ${LIBSYSTEMD_LIBRARIES})