From dc91f19f30604cbaff90bc4b509457c664190b93 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 16 Jul 2018 01:20:29 +0200 Subject: [PATCH] Just use PkgConfig to find dbus - dbus was not found on debian based distros, because they had the library in a different location - Not sure why I added the find package cmake file in the first place, will fix it and readd it if this causes problems --- CMakeLists.txt | 4 ++-- cmake/FindDBus.cmake | 43 ------------------------------------------- 2 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 cmake/FindDBus.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ea5eab5c..7da44fb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,10 +84,10 @@ find_package(Protobuf REQUIRED) find_library(PROTOBUF_STATIC_LIBRARY libprotobuf.a libprotobuf) if(LINUX) find_package(ALSA REQUIRED) - find_package(DBus REQUIRED) + pkg_check_modules(DBUS REQUIRED dbus-1) else(LINUX) find_package(ALSA) - find_package(DBus) + pkg_check_modules(DBUS dbus-1) endif(LINUX) if(ALSA_FOUND) set(HAVE_ALSA ON) diff --git a/cmake/FindDBus.cmake b/cmake/FindDBus.cmake deleted file mode 100644 index 4d41242a..00000000 --- a/cmake/FindDBus.cmake +++ /dev/null @@ -1,43 +0,0 @@ -if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR) - # Already in cache, be silent - set(DBUS_FIND_QUIETLY TRUE) -endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR) - -set(DBUS_LIBRARY) -set(DBUS_INCLUDE_DIR) -set(DBUS_ARCH_INCLUDE_DIR) - -FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h - /usr/include - /usr/include/dbus-1.0 - /usr/local/include - /usr/local/include/dbus-1.0 -) - -FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h - /usr/lib/include - /usr/lib/dbus-1.0/include - /usr/lib64/include - /usr/lib64/dbus-1.0/include - /usr/local/lib/include - /usr/local/lib/dbus-1.0/include - /usr/local/lib64/include - /usr/local/lib64/dbus-1.0/include -) - -FIND_LIBRARY(DBUS_LIBRARY NAMES dbus-1 dbus - PATHS - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 -) - -if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR) - MESSAGE(STATUS "D-Bus found: includes in ${DBUS_INCLUDE_DIR}, library in ${DBUS_LIBRARY}") - set(DBUS_FOUND TRUE) -else(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR) - MESSAGE(STATUS "D-Bus not found") -endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR) - -MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_LIBRARY DBUS_ARCH_INCLUDE_DIR)