Fix DBus detection for Cmake < 3.6
From Saikrishan Arcot
This commit is contained in:
parent
b69055ffca
commit
fe3a27450f
2 changed files with 17 additions and 4 deletions
CMakeModules
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue