[CMake] CMAKE_SYSROOT

Nils Gladitz nilsgladitz at gmail.com
Tue Jul 3 09:11:00 EDT 2018


On Tue, Jul 3, 2018 at 3:06 PM dbegun via CMake <cmake at cmake.org> wrote:

> I am cross-compiling some code for ARM on an x86 host with cmake 3.5.1.
> The code has multiple dependencies, and I placed relevant cross-compiled
> libraries in /home/dev/arm_build. I was hoping that
> specifying CMAKE_SYSROOT=/home/dev/arm_build in my CMAKE_TOOLCHAIN_FILE
> would prefix it to the search path of the find_* commands, so I won't have
> to modify existing Find*.cmake files. However, when I do that, cmake is
> unable to locate the compiler's libc files (my compiler also resides in
> /home/dev/arm_build) and is unable to compile a test program, not finding
> crt1.o, crti.o etc. Without specifying CMAKE_SYSROOT things work, it's just
> that I have to edit the Find*.cmake files. I can live with that, but any
> suggestions?
>

It sounds like what you'd want is:
https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_ROOT_PATH.html

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180703/2bdb0464/attachment.html>


More information about the CMake mailing list