[CMake] Cross compiling and rpath.

paul.chavent at fnac.net paul.chavent at fnac.net
Mon Jul 4 12:24:21 EDT 2011


Hi.

I'm currently facing problems with rpath and cross compiling.

I build a program (deployer-gnulinux) that need and external lib in a non standard path (lib/orocos/gnulinux/plugins).

Somewhere in the CMake procedure, there is a call to find_library with "PATH_SUFFIXES orocos/gnulinux/plugins". It find the library on my build system in the target sysroot. So if i read the rpath i have :

readelf -a builds/orocos-ocl-2.3.2/bin/deployer-gnulinux | grep rpath
[/BASE/sdk/work/pip22/builds/orocos-ocl-2.3.2/taskbrowser:
 /BASE/sdk/work/pip22/builds/orocos-ocl-2.3.2/deployment:
 /BASE/sdk/work/pip22/toolchain_root/opt/pip22/i686-pip22-linux-gnu/sys-root/usr/lib/orocos/gnulinux/plugins:]

When i install this file on my build system in the target sysroot, i have :

readelf -a /BASE/sdk/work/pip22/toolchain_root/opt/pip22/i686-pip22-linux-gnu/sys-root/usr/bin/deployer-gnulinux | grep rpath
[/usr/lib/orocos/gnulinux:
 /usr/lib:
 /BASE/sdk/work/pip22/toolchain_root/opt/pip22/i686-pip22-linux-gnu/sys-root/usr/lib/orocos/gnulinux/plugins]


My problem is that the last rpath has not been converted to a target path.

This kind of translation isn't automatic ?

Do you think i have some wrong parameters in my CMakelists.txt ?

Thank you for your help.

Paul.





More information about the CMake mailing list