aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorilya-fedin <[email protected]>2022-04-26 04:32:01 +0400
committerGitHub <[email protected]>2022-04-25 17:32:01 -0700
commit2ea5bb91686ee1a7350672bf15b7b63649dbf111 (patch)
treef7533a3eab98d141d4af02f42f41273cd7286b4d /CMakeLists.txt
parentc1c63a27de66cd44ef756b190a73bfa8bc6dbbab (diff)
Fallback to pkg-config for dbus (#689)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2edb30a4..d52754c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -679,12 +679,21 @@ set(CORE_OBJS
set(HAVE_RTKIT 0)
option(ALSOFT_REQUIRE_RTKIT "Require RTKit/D-Bus support" FALSE)
find_package(DBus1 QUIET)
-if(DBus1_FOUND)
+if(NOT DBus1_FOUND AND PkgConfig_FOUND)
+ pkg_check_modules(DBUS dbus-1)
+endif()
+if(DBus1_FOUND OR DBUS_FOUND)
option(ALSOFT_RTKIT "Enable RTKit support" ON)
if(ALSOFT_RTKIT)
set(HAVE_RTKIT 1)
set(CORE_OBJS ${CORE_OBJS} core/dbus_wrap.cpp core/dbus_wrap.h core/rtkit.cpp core/rtkit.h)
- if(WIN32 OR HAVE_DLFCN_H)
+ if(NOT DBus1_FOUND)
+ set(INC_PATHS ${INC_PATHS} ${DBUS_INCLUDE_DIRS})
+ set(CPP_DEFS ${CPP_DEFS} ${DBUS_CFLAGS_OTHER})
+ if(NOT WIN32 AND NOT HAVE_DLFCN_H)
+ set(EXTRA_LIBS ${EXTRA_LIBS} ${DBUS_LINK_LIBRARIES})
+ endif()
+ elseif(WIN32 OR HAVE_DLFCN_H)
set(INC_PATHS ${INC_PATHS} ${DBus1_INCLUDE_DIRS})
set(CPP_DEFS ${CPP_DEFS} ${DBus1_DEFINITIONS})
else()