[CMake] CMake toolchain file changing shared library loading name
m.hergarden
m.hergarden at euphoria-it.nl
Fri Jul 19 04:52:35 EDT 2013
On 07/19/2013 10:41 AM, ??????? ?????????? wrote:
> Hello.
> I have a strange issue when cross compiling with CMake.
> When i compile for host, in the resulting binary i have:
>
> readelf -d ./test
> ...
> 0x00000001 (NEEDED) Shared library: [libfoo.so]
> 0x0000000f (RPATH) Library rpath: [$ORIGIN/../../lib/]
> ...
>
> When i use CMake toolchain file (cmake -DCMAKE_TOOLCHAIN_FILE=arm_
> test.cmake .) i have:
> readelf -d ./test
> ...
> 0x00000001 (NEEDED) Shared library:
> [/home/mgh/proj/test/lib/libfoo.so]
> 0x0000000f (RPATH) Library rpath: [$ORIGIN/../../lib/]
> ...
>
> My toolchain file is very simple:
>
> set( CMAKE_SYSTEM_NAME armLinux )
>
> set( CMAKE_C_COMPILER arm-linux-gnueabi-gcc )
> set( CMAKE_CXX_COMPILER arm-linux-gnueabi-g++ )
> set( CMAKE_FIND_ROOT_PATH /home/mgh/toolchains/arm-linux-gnueabi/bin )
>
> So my question is why path to libfoo.so has been changed in executable
> after
> cross compiling? Thank you.
>
>
> --
>
> 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
Are you using find_library to locate the library? Setting the
CMAKE_FIND_ROOT_PATH influences the way libraries are found for
crosscompilation, but you may need to set
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY as well, to make sure the right
library is found.
Regards,
Micha Hergarden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130719/264181ac/attachment.htm>
More information about the CMake
mailing list