All of our systemd detection logic was in keydb/CMakeLists.txt because
only keyd actually cares about it. However that then means we don't
correctly update build-config.h with HAVE_SYSTEMD and so we link against
it, but don't correctly do socket activation. Split out the detection
into the main CMakeLists.txt so we correctly set the define.
CHECK_SYMBOL_EXISTS(nettle_get_secp_521r1 "nettle/ecc-curve.h" HAVE_NETTLE_GET_SECP_521R1)
endif()
+# keyd will use this for socket activation, if it's available
+pkg_check_modules(SYSTEMD libsystemd)
+if (SYSTEMD_FOUND)
+ set(HAVE_SYSTEMD true)
+endif()
+
# Build files that have substitutions in them
include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
configure_file("${CMAKE_SOURCE_DIR}/build-config.h.in"
target_compile_definitions(keydctl PRIVATE
CONFIGDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
- pkg_check_modules(SYSTEMD libsystemd)
if (SYSTEMD_FOUND)
- set(HAVE_SYSTEMD true)
target_include_directories(keyd SYSTEM PUBLIC
${SYSTEMD_INCLUDE_DIRS})
target_link_libraries(keyd ${SYSTEMD_LIBRARIES})