<table><tr><td style="">kossebau created this revision.<br />kossebau added reviewers: Frameworks, GCompris, Minuet, apol, cordlandwehr, mutlaqja, sandsmark, nienhueser.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D3646" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Currently (since <a href="https://phabricator.kde.org/R240:123d0d14017a25fb387efd8fe3c2c1323f9c3815" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">123d0d14017a25fb387efd8fe3c2c1323f9c3815</a>) any<br />
find_library() and find_path() calls look both at the host and the toolchain<br />
paths, which often results in includes and/or libraries wrongly being picked<br />
up from the host system, which then results in a failed build.<br />
CMake config files have always been also looked for on the host, which<br />
most often also is not wanted and resulting in a failed build.</p>
<p>This patch fixes that by changing the mode for finding libraries,<br />
includes & packages to ONLY (again), as also recommended in the<br />
cmake-toolchains documentation.</p>
<p>While before CMAKE_PREFIX_PATH was recommended to let cmake e.g.<br />
discover the Qt5 for Android libs, this patch wants a custom<br />
variable ECM_ANDROID_ROOT_PATH to be used instead.<br />
Reason is that CMAKE_PREFIX_PATH would be subject to the root<br />
handling, while here instead the root paths themselves are<br />
wanted.<br />
This patch does not add backward compatibility for still passing<br />
the Qt5 install prefix via CMAKE_PREFIX_PATH, as there are not<br />
that many users known yet and the old code did not work for many<br />
anyway, so the extra code hassle is not worth it. Instead the few<br />
build instructions would need to be updated (and should ask to use<br />
latest ECM in any case).</p>
<p>Separate commit also untangles setting up paths & Co for<br />
includes, libraries, Qt, into own sections, for improved readability.</p>
<p>And the bogus call</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM "${ANDROID_TOOLCHAIN_ROOT}")</pre></div>
<p>is removed.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Building Marble now works without trying to use stuff from the<br />
host system.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R240 Extra CMake Modules</div></div></div><br /><div><strong>BRANCH</strong><div><div>avoidHostLibsIncludesinAndroidToolchain</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3646" rel="noreferrer">https://phabricator.kde.org/D3646</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>toolchain/Android.cmake</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>kossebau, Frameworks, GCompris, Minuet, apol, cordlandwehr, mutlaqja, sandsmark, nienhueser<br /></div>