summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-13 15:47:47 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-13 15:51:17 +0800
commita2506424799e139154f1e50154afa7dfac33bec2 (patch)
tree4bbe9b46bbb8476af27cb7a53fd0a00d919bfb9e /CMakeLists.txt
parenta58cd3eb1395f87ecfe396f6ff42952a56aef257 (diff)
downloadsubsurface-a2506424799e139154f1e50154afa7dfac33bec2.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
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)