Files
CMake/Modules
Haibo Huang cbc51a8be3 Android: restructure android search paths
1. Set CMAKE_FIND_ROOT_PATH unconditionally.

Revise the implementation from commit a7f41a7ee4 (Android: Fix find_*
search order within NDK for unified toolchains, 2020-10-13).  In the old
implementation, if people set CMAKE_FIND_ROOT_PATH, CMAKE_ANDROID_NDK
won't be added to find root. And all paths added to CMAKE_SYSTEM_*_PATH
below will be rerooted to the user specified root.

2. Add api level specific library path to CMAKE_SYSTEM_PREFIX_PATH.

As the discussion in [1], some people want the paths added by
UnixPaths.cmake. They install their libraries according to
GNUInstallDirs [2].

As a result, we cannot clear CMAKE_SYSTEM_PREFIX_PATH. It includes /usr
so no matter what we specify in CMAKE_SYSTEM_LIBRARY_PATH,
/usr/lib/<arch> will be searched first.

The author also pointed out a way to solve this issue [3]. In addition
to other paths, CMake also searches <root>/<prefix> [4]. So we can add
the API specific lib path to the beginning of CMAKE_SYSTEM_PREFIX_PATH,
to have it searched first.

[1] https://android-review.googlesource.com/c/platform/ndk/+/1486800
[2] https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
[3] https://github.com/android/ndk/issues/1179#issuecomment-613435081
[4] 11425041f0/Source/cmSearchPath.cxx (L202)
2020-11-09 08:15:46 -05:00
..
2020-11-02 09:39:36 -05:00
2020-09-30 08:05:50 -04:00
2020-11-06 08:01:41 -05:00
2020-07-02 00:37:34 +05:30
2020-11-02 09:39:36 -05:00
2020-07-02 00:38:40 +05:30
2020-07-02 00:43:40 +05:30
2020-07-07 09:22:28 -04:00
2020-11-06 08:02:30 -05:00
2020-10-13 15:11:40 -04:00
2020-07-02 00:40:09 +05:30
2020-07-01 10:55:32 -04:00
2020-07-02 00:44:08 +05:30
2020-10-02 16:17:36 +02:00
2020-07-27 10:43:55 -04:00

See the "Find Modules" section of the cmake-developer(7) manual page.

For more information about how to contribute modules to CMake, see this page:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/dev/Module-Maintainers