From 918ff9f30bf36f67b365780795a6ee3ded6e2c66 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 19 Oct 2019 21:11:49 -0700 Subject: [PATCH] Detect libsystemd and automatically enable the MPRIS plugin if it exists. --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22a60eab5..d91789a73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,6 +153,22 @@ endif() # end gross taglib detection stuff +# systemd / MPRIS detection + +if (NOT ENABLE_MPRIS MATCHES "false") + find_library(LIB_SYSTEMD NAMES systemd) + if (NOT LIB_SYSTEMD MATCHES "LIB_SYSTEMD-NOTFOUND") + message(STATUS "[mpris] systemd found at " ${LIB_SYSTEMD}) + message(STATUS "[mpris] setting ENABLE_MPRIS=true") + set(ENABLE_MPRIS "true") + else() + message(STATUS "[mpris] systemd *not* found. MPRIS plugin not enabled") + set(ENABLE_MPRIS "false") + endif() +endif() + +#end systemd / MPRIS detection + add_dependencies(musikcube musikcore taglibreader nullout server httpdatastream stockencoders) add_dependencies(musikcubed musikcube)