2019-05-08 12:33:58 +00:00
|
|
|
# DBus1 is buggy and breaks PKG_CONFIG environment.
|
|
|
|
# Work around that:-/
|
2019-05-10 15:50:51 +00:00
|
|
|
# See https://gitlab.freedesktop.org/dbus/dbus/issues/267 for more information
|
|
|
|
|
2020-06-10 09:37:55 +00:00
|
|
|
# When doing top-level static Qt builds, we need to protect against double creation of the dbus
|
|
|
|
# target.
|
|
|
|
if(DBus1_FOUND OR WrapDBus1_FOUND OR TARGET dbus-1)
|
|
|
|
set(WrapDBus1_FOUND 1)
|
2020-02-06 09:34:48 +00:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2019-05-10 15:50:51 +00:00
|
|
|
if(DEFINED ENV{PKG_CONFIG_DIR})
|
|
|
|
set(__qt_dbus_pcd "$ENV{PKG_CONFIG_DIR}")
|
|
|
|
endif()
|
|
|
|
if(DEFINED ENV{PKG_CONFIG_PATH})
|
|
|
|
set(__qt_dbus_pcp "$ENV{PKG_CONFIG_PATH}")
|
|
|
|
endif()
|
|
|
|
if(DEFINED ENV{PKG_CONFIG_LIBDIR})
|
|
|
|
set(__qt_dbus_pcl "$ENV{PKG_CONFIG_LIBDIR}")
|
|
|
|
endif()
|
2019-05-08 12:33:58 +00:00
|
|
|
|
2020-08-04 15:24:17 +00:00
|
|
|
find_package(DBus1 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} QUIET)
|
2019-05-10 15:50:51 +00:00
|
|
|
|
|
|
|
if(DEFINED __qt_dbus_pcd)
|
|
|
|
set(ENV{PKG_CONFIG_DIR} "${__qt_dbus_pcd}")
|
|
|
|
else()
|
|
|
|
unset(ENV{PKG_CONFIG_DIR})
|
|
|
|
endif()
|
|
|
|
if(DEFINED __qt_dbus_pcp)
|
|
|
|
set(ENV{PKG_CONFIG_PATH} "${__qt_dbus_pcp}")
|
|
|
|
else()
|
|
|
|
unset(ENV{PKG_CONFIG_PATH})
|
|
|
|
endif()
|
|
|
|
if(DEFINED __qt_dbus_pcl)
|
|
|
|
set(ENV{PKG_CONFIG_LIBDIR} "${__qt_dbus_pcl}")
|
|
|
|
else()
|
|
|
|
unset(ENV{PKG_CONFIG_LIBDIR})
|
|
|
|
endif()
|
2019-09-27 11:50:29 +00:00
|
|
|
|
|
|
|
if(DBus1_FOUND)
|
|
|
|
set(WrapDBus1_FOUND 1)
|
|
|
|
endif()
|
2020-06-26 16:32:53 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-08-04 15:24:17 +00:00
|
|
|
find_package_handle_standard_args(WrapDBus1 REQUIRED_VARS
|
|
|
|
DBus1_LIBRARY DBus1_INCLUDE_DIR WrapDBus1_FOUND
|
|
|
|
VERSION_VAR DBus1_VERSION)
|