musikcube/.cmake/AddOsSpecificPlugins.cmake

51 lines
1.8 KiB
CMake
Raw Normal View History

# libopenmpt detection
find_library(LIBOPENMPT NAMES openmpt)
if ("${LIBOPENMPT}" STREQUAL "LIBOPENMPT-NOTFOUND")
message(STATUS "[libopenmpt] *not* found! plugin will not be built.")
else()
message(STATUS "[libopenmpt] enabled = true; found library at ${LIBOPENMPT}")
add_subdirectory(src/plugins/libopenmptdecoder)
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()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_subdirectory(src/plugins/alsaout)
add_subdirectory(src/plugins/pulseout)
if (${ENABLE_PIPEWIRE} MATCHES "true")
add_subdirectory(src/plugins/pipewireout)
endif()
if (${ENABLE_MPRIS} MATCHES "true")
add_subdirectory(src/plugins/mpris)
endif()
if (${ENABLE_SNDIO} MATCHES "true")
add_subdirectory(src/plugins/sndioout)
endif()
elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
add_subdirectory(src/plugins/sndioout)
if (${ENABLE_PULSEAUDIO} MATCHES "true")
add_subdirectory(src/plugins/pulseout) # disabled by default
endif()
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
add_subdirectory(src/plugins/sndioout)
if (${ENABLE_PULSEAUDIO} MATCHES "true")
add_subdirectory(src/plugins/pulseout) # disabled by default
endif()
if (${ENABLE_ALSA} MATCHES "true")
add_subdirectory(src/plugins/alsaout) # disabled by default
endif()
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_subdirectory(src/plugins/coreaudioout)
add_subdirectory(src/plugins/macosmediakeys)
endif()