<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 07/19/2013 10:41 AM, Дмитрий
Дороговцев wrote:<br>
</div>
<blockquote
cite="mid:CANowdiwM0X+YoSy6Jvp65NB9K6xu7qHswqyXs6Xvpvavw0mcAg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hello.<br>
I have a strange issue when cross compiling with CMake.<br>
When i compile for host, in the resulting binary i have:<br>
<br>
readelf -d ./test<br>
...<br>
0x00000001 (NEEDED) Shared library: [libfoo.so]<br>
0x0000000f (RPATH) Library rpath:
[$ORIGIN/../../lib/]<br>
...<br>
<br>
When i use CMake toolchain file (cmake -DCMAKE_TOOLCHAIN_FILE=arm_
<div>test.cmake .) i have:<br>
readelf -d ./test<br>
...<br>
0x00000001 (NEEDED) Shared library:
[/home/mgh/proj/test/lib/libfoo.so]<br>
0x0000000f (RPATH) Library rpath:
[$ORIGIN/../../lib/]<br>
...<br>
<br>
My toolchain file is very simple:<br>
<br>
set( CMAKE_SYSTEM_NAME armLinux )<br>
<br>
set( CMAKE_C_COMPILER arm-linux-gnueabi-gcc )<br>
set( CMAKE_CXX_COMPILER arm-linux-gnueabi-g++ )<br>
set( CMAKE_FIND_ROOT_PATH
/home/mgh/toolchains/arm-linux-gnueabi/bin )<br>
<br>
So my question is why path to libfoo.so has been changed in
executable after<br>
cross compiling? Thank you.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">--
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></pre>
</blockquote>
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.<br>
<br>
Regards,<br>
Micha Hergarden<br>
<br>
</body>
</html>