set(ARCHEUS_LIBDBUS_DBUS_SOURCES packages/linux/dbus/libdbus/dbus.c packages/linux/dbus/libdbus/helpers.c ) function(libdbus_check_and_init_needed _ARCHEUS_SOURCES _ARCHEUS_INCLUDE_DIRECTORIES _ARCHEUS_LINK_LIBRARIES ARCHEUS_DBUS_BACKEND) #add matching files for the selected backends if(${ARCHEUS_DBUS_BACKEND} STREQUAL "LIBDBUS") find_package(PkgConfig REQUIRED) pkg_check_modules(DBUS REQUIRED dbus-1) list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_LIBDBUS_DBUS_SOURCES}) #add to include directories list(APPEND ${_ARCHEUS_INCLUDE_DIRECTORIES} PUBLIC ${DBUS_INCLUDE_DIRS} ) list(APPEND ${_ARCHEUS_LINK_LIBRARIES} PUBLIC ${DBUS_LIBRARIES} ) endif() set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE) set(${_ARCHEUS_INCLUDE_DIRECTORIES} ${${_ARCHEUS_INCLUDE_DIRECTORIES}} PARENT_SCOPE) set(${_ARCHEUS_LINK_LIBRARIES} ${${_ARCHEUS_LINK_LIBRARIES}} PARENT_SCOPE) endfunction()