cmake_minimum_required(VERSION 3.0) project(dbus C) find_library(DBUS_LIBRARY dbus-1) find_library(PTHREAD_LIBRARY pthread) include_directories( /usr/include/dbus-1.0 /usr/lib64/dbus-1.0/include ) add_executable(dbus-test test.c) target_link_libraries(dbus-test ${DBUS_LIBRARY} ${PTHREAD_LIBRARY})