From a2506424799e139154f1e50154afa7dfac33bec2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 13 Nov 2018 15:47:47 +0800 Subject: Android: find Qt cmake modules With a recent change to the qt-android-cmake project we are now using the toolchain file bundled with the NDK, and that forces all cmake modules to be part of the NDK tree - which breaks the way we find our Qt installation. This is a hack to work around this as it undoes this setting, which I'm sure is well intentioned to prevent host system issues in this cross build scenario. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index caec2fbe2..a36b61f07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,6 +225,12 @@ if(BTSUPPORT) list(APPEND QT_EXTRA_LIBRARIES Qt5::Bluetooth) endif() +if(ANDROID) + # when building for Android, the toolchain file requires all cmake modules + # to be inside the CMAKE_FIND_ROOT_PATH - which prevents cmake from finding + # our Qt installation. This is ugly, but it works. + set(CMAKE_FIND_ROOT_PATH "/;${CMAKE_FIND_ROOT_PATH}") +endif() find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network Svg Test QuickTest LinguistTools Positioning Quick Location ${QT_EXTRA_COMPONENTS}) set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Svg Qt5::Positioning Qt5::Quick Qt5::Location ${QT_EXTRA_LIBRARIES}) set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test Qt5::QuickTest) -- cgit v1.2.3-70-g09d2