mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 15:32:37 +00:00
cmake: support sd-bus fallback implementations
* elogind: https://github.com/elogind/elogind * basu: https://github.com/emersion/basu Relates https://github.com/clangen/musikcube/issues/365 Fixes https://github.com/clangen/musikcube/issues/456 Signed-off-by: Robert Günzler <r@gnzler.io>
This commit is contained in:
parent
e2574cc1f4
commit
aa12ef18bb
@ -154,21 +154,6 @@ else()
|
|||||||
add_dependencies(musikcube ffmpegdecoder)
|
add_dependencies(musikcube ffmpegdecoder)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# 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(musikcube musikcore taglibreader nullout server httpdatastream stockencoders)
|
||||||
add_dependencies(musikcubed musikcube)
|
add_dependencies(musikcubed musikcube)
|
||||||
|
@ -2,8 +2,23 @@ set (mpris_SOURCES
|
|||||||
mpris.cpp
|
mpris.cpp
|
||||||
dbus.cpp)
|
dbus.cpp)
|
||||||
|
|
||||||
|
if (USE_ELOGIND MATCHES "true")
|
||||||
|
ensure_library_exists(elogind >= 239.3)
|
||||||
|
set(SDBUS "libelogind >= 239.3")
|
||||||
|
|
||||||
|
elseif (USE_BASU MATCHES "true")
|
||||||
|
ensure_library_exists(basu)
|
||||||
|
set(SDBUS "basu")
|
||||||
|
|
||||||
|
else()
|
||||||
|
ensure_library_exists(systemd)
|
||||||
|
set(SDBUS "libsystemd")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "[mpris] plugin enabled")
|
||||||
|
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
pkg_check_modules (SYSTEMD REQUIRED libsystemd)
|
pkg_check_modules(SDBUS REQUIRED IMPORTED_TARGET ${SDBUS})
|
||||||
|
|
||||||
add_library(mpris SHARED ${mpris_SOURCES})
|
add_library(mpris SHARED ${mpris_SOURCES})
|
||||||
target_link_libraries(mpris ${musikcube_LINK_LIBS} systemd)
|
target_link_libraries(mpris ${musikcube_LINK_LIBS} PkgConfig::SDBUS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user