<div dir="ltr">Hello,<div><br></div><div>Use ExternalProject to build libpcap as part of your project. Make sure you use $ORIGIN in rpath everywhere. Install your application (and your bundled libpcap) to /opt to avoid polluting the system.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 19, 2015 at 10:37 PM, Zac Bergquist <span dir="ltr"><<a href="mailto:zbergquist99@gmail.com" target="_blank">zbergquist99@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you for your reply, Guillaume.<div><br></div><div>I understand that this is the expected behavior.  I even linked to the documentation that says this is the expected behavior.  What I don't understand is how to resolve it.  Are you saying it is not possible to create a relocatable package unless all dependencies are also using CMake?  That doesn't seem right.</div><div><br></div><div>Should I be trying to write a package config file for libpcap, or is there a better way to approach this?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 17, 2015 at 8:19 AM, Guillaume Dumont <span dir="ltr"><<a href="mailto:dumont.guillaume@gmail.com" target="_blank">dumont.guillaume@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What you are seeing is the expected behavior. You can get a relocatable package if all your dependencies (in your case libcap) have themselves relocatable package config files with exported targets. Then you package should make use of find_dependency macro.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Oct 16, 2015 at 4:56 PM, Zac Bergquist <span dir="ltr"><<a href="mailto:zbergquist99@gmail.com" target="_blank">zbergquist99@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">I've created a sample project to replicate my issue in hopes that it would make it easier to troubleshoot.<div><br></div><div>Thanks for any help,</div><div>Zac<br><div><br></div><div><a href="https://github.com/zmb3/cmaketest" target="_blank">https://github.com/zmb3/cmaketest</a><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 8:53 AM, Zac Bergquist <span dir="ltr"><<a href="mailto:zbergquist99@gmail.com" target="_blank">zbergquist99@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I'm trying to fix a project so that its output is relocatable.  The project is a library that itself depends on libpcap.  My goal is to be able to import the library into my CMake application and have CMake automatically link libpcap with it.</div><div><br></div><div>I'm using a toolchain file that invokes an ARM cross compiler, sets CMAKE_INSTALL_PREFIX and appends it to CMAKE_FIND_ROOT_PATH.  This all seems to work well.</div><div><br></div><div>What I'm seeing is that the exported files that get installed to CMAKE_INSTALL_PREFIX contain absolute paths to libpcap on my machine, which make them useless to other team members.</div><div><br></div><div>The first thing I changed was to use CONFIGURE_PACKAGE_CONFIG_FILE instead of CONFIGURE_FILE.  This got rid of absolute paths in the generated CMake config file.</div><div><div><br></div><div>However, I still have absolute paths in the CMake target import file that gets generated.  The IMPORTED_LINK_INTERFACE_LIBRARIES target property has an absolute path instead of one relative to CMAKE_INSTALL_PREFIX.</div><div><br></div><div>I've read the "Creating Relocatable Packages" [1] section of the CMake packages documentation. I'm pretty sure this is what I'm running into, but I don't quite understand how to solve it.  The documentation says that I should be using imported targets, but I'm not sure how to do so.  The library is just using its own FindPCAP.cmake file to locate libpcap.</div></div><div><br></div><div>Does anyone know of an example of a CMake package that imports other libraries?  I could also try to create a minimal example project with this setup if it would be helpful.</div><div><br></div><div>Thanks,</div><div>Zac</div><div><br></div><div>[1]: <a href="https://cmake.org/cmake/help/v3.3/manual/cmake-packages.7.html#creating-relocatable-packages" target="_blank">https://cmake.org/cmake/help/v3.3/manual/cmake-packages.7.html#creating-relocatable-packages</a></div><div><br></div></div>
</blockquote></div><br></div>
<br></div></div>--<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/CMake_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/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.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/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><span><font color="#888888"><br></font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Guillaume Dumont<br>=========================<br><a href="mailto:dumont.guillaume@gmail.com" target="_blank">dumont.guillaume@gmail.com</a></div>
</font></span></div>
</blockquote></div><br></div>
</div></div><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/CMake_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/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.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/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Pau Garcia i Quiles<br><a href="http://www.elpauer.org" target="_blank">http://www.elpauer.org</a><br>(Due to my workload, I may need 10 days to answer)</div>
</div>