summaryrefslogtreecommitdiffstats
path: root/cmake/FindWrapDBus1.cmake
blob: 55f9757c45ce83d48f4a04f31b23dc18f737a1a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# DBus1 is buggy and breaks PKG_CONFIG environment.
# Work around that:-/
# See https://gitlab.freedesktop.org/dbus/dbus/issues/267 for more information

if(DBus1_FOUND OR WrapDBus1_FOUND)
    return()
endif()

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()

find_package(DBus1)

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()

if(DBus1_FOUND)
    set(WrapDBus1_FOUND 1)
endif()