1
0
Fork 0

Fix DBus detection for Cmake < 3.6

From Saikrishan Arcot
This commit is contained in:
James Turner 2020-04-27 08:56:10 +01:00
parent b69055ffca
commit fe3a27450f
2 changed files with 17 additions and 4 deletions

View file

@ -19,7 +19,12 @@ else()
include(FindPkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(DBUS IMPORTED_TARGET dbus-1)
# FIXME : clean this up once we requrie CMake 3.6
if(CMAKE_VERSION VERSION_LESS 3.6)
pkg_check_modules(DBUS dbus-1)
else()
pkg_check_modules(DBUS IMPORTED_TARGET dbus-1)
endif()
endif (PKG_CONFIG_FOUND)
if(DBUS_FOUND)

View file

@ -31,9 +31,17 @@ function(setup_fgfs_libraries target)
target_link_libraries(${target} DBus)
endif()
# PkgCOnfig::DBUS target
if(TARGET PkgConfig::DBUS)
target_link_libraries(${target} PkgConfig::DBUS)
# PkgConfig::DBUS target
if(CMAKE_VERSION VERSION_LESS 3.6)
if(DBUS_FOUND)
target_link_libraries(${target} ${DBUS_LDFLAGS})
endif()
else()
# PkgConfig::DBUS target
if(TARGET PkgConfig::DBUS)
target_link_libraries(${target} PkgConfig::DBUS)
endif()
endif()
if(FG_HAVE_GPERFTOOLS)