summaryrefslogtreecommitdiffstats
path: root/cmake/FindWrapDBus1.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindWrapDBus1.cmake')
-rw-r--r--cmake/FindWrapDBus1.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/FindWrapDBus1.cmake b/cmake/FindWrapDBus1.cmake
index ee856e1de5..e2a58790c4 100644
--- a/cmake/FindWrapDBus1.cmake
+++ b/cmake/FindWrapDBus1.cmake
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# DBus1 is buggy and breaks PKG_CONFIG environment.
# Work around that:-/
# See https://gitlab.freedesktop.org/dbus/dbus/issues/267 for more information
@@ -19,7 +22,7 @@ if(DEFINED ENV{PKG_CONFIG_LIBDIR})
set(__qt_dbus_pcl "$ENV{PKG_CONFIG_LIBDIR}")
endif()
-find_package(DBus1 QUIET)
+find_package(DBus1 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} QUIET)
if(DEFINED __qt_dbus_pcd)
set(ENV{PKG_CONFIG_DIR} "${__qt_dbus_pcd}")
@@ -42,4 +45,6 @@ if(DBus1_FOUND)
endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(WrapDBus1 DEFAULT_MSG WrapDBus1_FOUND)
+find_package_handle_standard_args(WrapDBus1 REQUIRED_VARS
+ DBus1_LIBRARY DBus1_INCLUDE_DIR WrapDBus1_FOUND
+ VERSION_VAR DBus1_VERSION)