Hi,

I have set up a toolchain file [1] to enable cross-compiling a project. In
my current setup, both the host and target environments are
binary-compatible (both are x86 and are using gcc's with compatible ABIs).
When I generate a cross-compiled executable and run ldd, the paths to
libraries such as libc, libc++, and m show up rooted at /lib. I was
expecting something more in the line of ${CMAKE_FIND_ROOT_PATH}/lib.
Conversely, the external dependencies I explicitly added using
find_libraries appear rooted at ${CMAKE_FIND_ROOT_PATH}, which is what I
expected.

Is this behavior correct, or did I misunderstood something along the way?

In case it helps, my toolchain file looks something like this:

# Target system label
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i586)


# Specify the cross compiler
set(CMAKE_C_COMPILER   /path/to/i586-unknown-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER  /path/to/ii586-unknown-linux-gnu-g++)

# Target environment location
set(CMAKE_FIND_ROOT_PATH  /my/root/path)


# Search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# Search for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)


Cheers,

-- 
Adolfo Rodríguez Tsouroukdissian

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to