Ignore host libs/includes/cmakeconfig files in Android toolchain

Authored by kossebau on Dec 11 2016, 8:42 PM.

Description

Ignore host libs/includes/cmakeconfig files in Android toolchain

Summary:
Currently (since 123d0d14017a25fb387efd8fe3c2c1323f9c3815) any
find_library() and find_path() calls look both at the host and the toolchain
paths, which often results in includes and/or libraries wrongly being picked
up from the host system, which then results in a failed build.
CMake config files have always been also looked for on the host, which
most often also is not wanted and resulting in a failed build.

This patch fixes that by changing the mode for finding libraries,
includes & packages to ONLY (again), as also recommended in the
cmake-toolchains documentation.

While before CMAKE_PREFIX_PATH was recommended to let cmake e.g.
discover the Qt5 for Android libs, this patch wants a custom
variable ECM_ADDITIONAL_FIND_ROOT_PATH to be used instead.
Reason is that CMAKE_PREFIX_PATH would be subject to the root
handling, while here instead the root paths themselves are
wanted.
This patch does not add backward compatibility for still passing
the Qt5 install prefix via CMAKE_PREFIX_PATH, as there are not
that many users known yet and the old code did not work for many
anyway, so the extra code hassle is not worth it. Instead the few
build instructions would need to be updated (and should ask to use
latest ECM in any case).

Test Plan:
Building Marble now works without trying to use stuff from the
host system.

Reviewers: Frameworks, GCompris, Minuet, mutlaqja, sandsmark, cordlandwehr, nienhueser, apol

Reviewed By: cordlandwehr, nienhueser, apol

Differential Revision: https://phabricator.kde.org/D3646

Details