summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-03 13:31:19 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-03 11:36:22 +0000
commit28306fc1ed11c6502e3883bb180ce7eda298b106 (patch)
tree05b13fb967c39990119e4f9f98881ae01a28cb5c /cmake
parent4c31ce68d5367a6ec4dd3cf2f55e4b226add876d (diff)
Fix cmake generate step when cross-compilation against Android
We have find module wrappers for various system libs that use FindPkgConfig. The _FOUND variable will be set to 1 if pkg-config --exists returned true, but the imported target will not be created when for example the provided library paths or header include paths are outside of the sysroot - a good sanity check by cmake. We require the targets for use though, so therefore we must unset the _FOUND variable if we can't locate the targets. Change-Id: Ia0dea657684a1847148664521265c42585890645 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindLibproxy.cmake4
-rw-r--r--cmake/FindLibsystemd.cmake4
-rw-r--r--cmake/FindLibudev.cmake4
-rw-r--r--cmake/FindMtdev.cmake4
4 files changed, 16 insertions, 0 deletions
diff --git a/cmake/FindLibproxy.cmake b/cmake/FindLibproxy.cmake
index 611a8bd7d5..95d86d1617 100644
--- a/cmake/FindLibproxy.cmake
+++ b/cmake/FindLibproxy.cmake
@@ -1,3 +1,7 @@
find_package(PkgConfig)
pkg_check_modules(Libproxy libproxy-1.0 IMPORTED_TARGET)
+
+if (NOT TARGET PkgConfig::Libproxy)
+ set(Libproxy_FOUND 0)
+endif()
diff --git a/cmake/FindLibsystemd.cmake b/cmake/FindLibsystemd.cmake
index 9c0082fd39..09c6452932 100644
--- a/cmake/FindLibsystemd.cmake
+++ b/cmake/FindLibsystemd.cmake
@@ -1,3 +1,7 @@
find_package(PkgConfig)
pkg_check_modules(Libsystemd systemd IMPORTED_TARGET)
+
+if (NOT TARGET PkgConfig::Libsystemd)
+ set(Libsystemd_FOUND 0)
+endif()
diff --git a/cmake/FindLibudev.cmake b/cmake/FindLibudev.cmake
index 7eeb800e09..637c7c6d88 100644
--- a/cmake/FindLibudev.cmake
+++ b/cmake/FindLibudev.cmake
@@ -1,3 +1,7 @@
find_package(PkgConfig)
pkg_check_modules(Libudev libudev IMPORTED_TARGET)
+
+if (NOT TARGET PkgConfig::Libudev)
+ set(Libudev_FOUND 0)
+endif()
diff --git a/cmake/FindMtdev.cmake b/cmake/FindMtdev.cmake
index 39d9823207..c852a77c1c 100644
--- a/cmake/FindMtdev.cmake
+++ b/cmake/FindMtdev.cmake
@@ -1,3 +1,7 @@
find_package(PkgConfig)
pkg_check_modules(Mtdev mtdev IMPORTED_TARGET)
+
+if (NOT TARGET PkgConfig::MtDev)
+ set(Mtdev_FOUND 0)
+endif()