<div dir="ltr"><div><a href="https://cmake.org/cmake/help/v3.0/command/find_path.html">https://cmake.org/cmake/help/v3.0/command/find_path.html</a><br></div><div><br></div><div>Please try to pass the NO_CMAKE_SYSTEM_PATH to find_path() and find_library(), but use the HINT to pass the path to thirdparty paths.</div><div><br></div><div>Of course use the CMAKE_VERBOSE_MAKEFILE to check the log.</div><div><br></div><div>At the last check the CMakeCache.txt to verify everything is okay.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 24, 2017 at 3:50 AM, Alan W. Irwin <span dir="ltr"><<a href="mailto:irwin@beluga.phys.uvic.ca" target="_blank">irwin@beluga.phys.uvic.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2017-12-23 10:47+0100 Andreas Naumann wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
your problem is hard to analyse. If you have a "minimal" example, which shows this behavior, we could test it. In your last mail, you wrote about building and installing libtiff using your own libjpeg. But than you write about a later build. So something must happen in the "later build".<br>
</blockquote>
<br></span>
@Mario:<br>
<br>
I second everything said here by Andreas. So I think, for example,<br>
that your next step should be to create a minimal example (e.g., a<br>
"hello, world" minimal test C executable that is [over-]linked to one<br>
of your libraries in a non-standard location). Then compare your<br>
"make VERBOSE=1" results for that simple example on your multiple<br>
platforms to see whether the linking is done with the library in the<br>
correct non-standard location rather than the system library.<br>
<br>
Furthermore you stated in your original post that for some of your<br>
platforms CMake use the -l linking option to link, and you thought<br>
that was an issue. Actually, that is fine if CMake also generates an<br>
-L option pointing to the correct non-standard location since linkers<br>
use the combination of -L and -l options to locate the library if it<br>
is not specified as an absolute path.<br>
<br>
So my guess from what you have said is you forgot about the -L option<br>
also generated by CMake, and, in fact, CMake is working correctly to<br>
link your code on all platforms. Anyway, if your "make VERBOSE=1"<br>
results prove that is the case, then your next step should be to<br>
configure your build system so that an -rpath option is used by the<br>
linker so that the system loader for your executable can find the<br>
library in its non-standard location at run time.<br>
<br>
My own linking experience (currently with CMake-3.6.2 and higher) is just limited to my Debian platform at this time, but I do successfully<br>
use some libraries that are installed in non-standard system<br>
locations. And my experience is a properly configured CMake-based<br>
build system links those libraries with the appropriate -rpath option<br>
with good results (using the library version in the non-standard<br>
location) both at link time and run time.<br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" rel="noreferrer" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state<br>
implementation for stellar interiors (<a href="http://freeeos.sf.net" rel="noreferrer" target="_blank">freeeos.sf.net</a>); the Time<br>
Ephemerides project (<a href="http://timeephem.sf.net" rel="noreferrer" target="_blank">timeephem.sf.net</a>); PLplot scientific plotting<br>
software package (<a href="http://plplot.sf.net" rel="noreferrer" target="_blank">plplot.sf.net</a>); the libLASi project<br>
(<a href="http://unifont.org/lasi" rel="noreferrer" target="_blank">unifont.org/lasi</a>); the Loads of Linux Links project (<a href="http://loll.sf.net" rel="noreferrer" target="_blank">loll.sf.net</a>);<br>
and the Linux Brochure Project (<a href="http://lbproject.sf.net" rel="noreferrer" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<div class="HOEnZb"><div class="h5"><br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMak<wbr>e_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/list<wbr>info/cmake</a><br>
</div></div></blockquote></div><br></div>