Let me take another shot at this -- I created a gist that highlights the problem: <a href="https://gist.github.com/3789287">https://gist.github.com/3789287</a><div><br></div><div>I am supporting cross-compile for the Raspberry Pi Arm target in my project, but I also build regularly on plain 'ol x86 linux so I can test w/o having to go to the target. The Pi is awful slow at compilation, so I want to do cross-compile also on Linux x86.</div>
<div><br></div><div>I am using 3rd party libraries from <a href="http://zeromq.org">http://zeromq.org</a> -- I have already compiled them on the target hardware and checked them in to my project repo directory structure:</div>
<div><br></div><div><div>Same libraries, compiled for different targets, stored in different paths in my project directory structure.</div><div><br></div><div>I created a Toolchain file to cross-compile. So far that works fine, until I want to go linking against the zeromq libraries. </div>
<div><br></div><div>Compiling for Linux/x86 works fine, and even compiling for Mac OS X but when I run my Toolchain to cross-compile, it complains that it cannot find the libraries for the target. I run the toolchain like this:</div>
<div><br></div><div><div><pre style="margin-top:15px;margin-bottom:15px;padding:6px 10px;font-size:13px;line-height:19px;font-family:Monaco,'Courier New','DejaVu Sans Mono','Bitstream Vera Sans Mono',monospace;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="nv" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,128,128)">$ </span>cmake -DCMAKE_TOOLCHAIN_FILE<span class="o" style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span>../Toolchain-raspberrypi-arm.cmake ..
Using Raspberry Pi Tools found in /home/davis/git/raspberrypi/tools
<span class="nv" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,128,128)">CMAKE_CROSSCOMPILING</span> <span class="o" style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span>> TRUE
<span class="nv" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,128,128)">CMAKE_SYSTEM_NAME</span> <span class="o" style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span>> Linux, <span class="nv" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,128,128)">PROJECT_SOURCE_DIR</span> <span class="o" style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span>> /home/davis/git/ebike-firmware
CMAKE_CROSSCOMPILING is true...doing find_library <span class="k" style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">for </span>ZeroMQ...
CMake Error: The following variables are used in this project, but they are <span class="nb" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,134,179)">set </span>to NOTFOUND.
Please <span class="nb" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,134,179)">set </span>them or make sure they are <span class="nb" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(0,134,179)">set </span>and tested correctly in the CMake files:
CZMQ_LIB
linked by target <span class="s2" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(221,17,68)">"Runtime"</span> in directory /home/davis/git/ebike-firmware/src
ZEROMQ_LIB
linked by target <span class="s2" style="margin:0px;padding:0px;line-height:1.4em;color:rgb(221,17,68)">"Runtime"</span> in directory /home/davis/git/ebike-firmware/src
-- Configuring incomplete, errors occurred!</pre></div></div><div>The libraries, are indeed there. I thought using the <span style="background-color:rgb(255,255,255);color:rgb(221,17,68);font-family:'Bitstream Vera Sans Mono',Courier,monospace;font-size:12px;line-height:16.78333282470703px;white-space:pre">CMAKE_FIND_ROOT_PATH_MODE_LIBRARY </span>and the <span style="background-color:rgb(255,255,255);color:rgb(221,17,68);font-family:'Bitstream Vera Sans Mono',Courier,monospace;font-size:12px;line-height:16.78333282470703px;white-space:pre">CMAKE_FIND_ROOT_PATH</span> would force CMake to use an explicit path to try to resolve libraries when you execute find_library, but even though the files are there, it fails with NOTFOUND. Does it somehow inspect the binary and consider its current architecture -- if it isn't a match, it reports fail / NOTFOUND -- if so, how can I work around this?</div>
<div><br></div><div>Is there a better way to do what I'm trying to do??</div><div><br></div><br><div class="gmail_quote">On Mon, Sep 24, 2012 at 5:38 PM, Davis Ford <span dir="ltr"><<a href="mailto:davisford@gmail.com" target="_blank">davisford@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote></div></div>