[cmake-developers] [CMake] Debugging find_package() search behavior?

Robert Dailey rcdailey.lists at gmail.com
Tue Aug 29 11:58:49 EDT 2017


On Tue, Aug 29, 2017 at 10:54 AM, Brad King <brad.king at kitware.com> wrote:
> On 08/29/2017 11:50 AM, Robert Dailey wrote:
>> Wow even if I set ZLIB_ROOT, FindZLIB.cmake *still* won't find my zlib
>> over the one provided by the Android NDK...
>>
>> Although I was able to get this working fine on Windows, it does not
>> work with the NDK's toolchain file.
>
> That's because the CMAKE_FIND_ROOT_PATH settings re-root all search
> paths to look only inside the NDK.  This is one reason toolchain files
> should not be monolithic and should only be authored locally for the
> current machine.

But the documentation[1] says it's a list, so if I add my own
directory to that list, it should search there right?

[1]: https://cmake.org/cmake/help/v3.6/variable/CMAKE_FIND_ROOT_PATH.html


More information about the cmake-developers mailing list