summaryrefslogtreecommitdiffstats
path: root/cmake/FindSensorfw.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindSensorfw.cmake')
-rw-r--r--cmake/FindSensorfw.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/FindSensorfw.cmake b/cmake/FindSensorfw.cmake
new file mode 100644
index 00000000..c6238a92
--- /dev/null
+++ b/cmake/FindSensorfw.cmake
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+ pkg_check_modules(Sensorfw sensord-qt5 IMPORTED_TARGET)
+ if (NOT TARGET PkgConfig::Sensorfw)
+ set(Sensorfw_FOUND 0)
+ endif()
+else()
+ message("Sensorfw pkg not found. Looking for library")
+ find_library(Sensorfw sensorfw)
+endif()