Hi,
the CMake toolchain file currently sets CMAKE_FIND_ROOT_PATH_MODE_INCLUDE and
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY to BOTH. As an effect, CMake finds some
dependencies of my host system, which are incompatible with Android.
I have appended a patch that sets those variables to ONLY. In addition,
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE is set to ONLY.
I have tested the changes with
"-DCMAKE_PREFIX_PATH:PATH=/home/daniel/Qt5.6.1/5.6/android_armv7".
There should be a nicer way. Should the Qt path be added to
CMAKE_FIND_ROOT_PATH somehow?
Cheers, Daniel
From 7d45acc6ea768a1437449f5ea3e7b6beb03c6cc6 Mon Sep 17 00:00:00 2001
From: Daniel Pfeifer <[email protected]>
Date: Thu, 7 Jul 2016 10:24:32 +0200
Subject: [PATCH] Android Toolchain: Don't find dependencies on the host system
---
toolchain/Android.cmake | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake
index 20e65f8..f6d0c04 100644
--- a/toolchain/Android.cmake
+++ b/toolchain/Android.cmake
@@ -147,10 +147,11 @@ link_directories(${CMAKE_SYSTEM_LIBRARY_PATH})
set(CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-gcc")
set(CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-g++")
-SET(CMAKE_FIND_ROOT_PATH ${ANDROID_NDK})
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
+set(CMAKE_FIND_ROOT_PATH ${ANDROID_NDK})
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_EXE_LINKER_FLAGS "${GNUSTL_SHARED} -Wl,-rpath-link,${ANDROID_LIBRARIES_PATH} -llog -lz -lm -ldl -lc -lgcc" CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "")
--
2.9.0
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem