<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-10-12 17:28 GMT+02:00 Konstantin Tokarev <span dir="ltr"><<a href="mailto:annulen@yandex.ru" target="_blank">annulen@yandex.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
In my cmake project I need to use system version of libxml2 on macOS (/usr/lib/libxml2.dylib), however in case it is installed in MacPorts the latter version is picked by find_package. On the other hand I'd like to avoid hardcoding absolute path, just in case Apple changes some path or file name in future OS version.<br>
<br>
I've tried<br>
<br>
find_package(LibXml2 2.8.0 REQUIRED PATHS "/usr" NO_DEFAULT_PATH)<br>
<br>
however it fails to find anything at all. Any ideas?<br></blockquote><div><br></div><div>My guess is that your find_package call end up in "Module mode"  because there is a FindLibXml2.cmake module bundled with cmake does not honor all options of the find_package when in this mode.</div><div><br></div><div>So I bet FindLibXml2.cmake does not handle the given </div><div>"PATHS "/usr" NO_DEFAULT_PATH" part.</div><div><br></div><div>Which are handled by find_package when running in "Config mode".</div><div><br></div><div>I suggest you to try patch and update the FindLibXml2.cmake module.</div><div>Or simply craft your own</div><div><br></div><div>find_library(...) call.if you only need the libxml2.</div><div>Eric</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
--<br>
Regards,<br>
Konstantin<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/<wbr>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/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>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/<wbr>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/<wbr>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/<wbr>mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div>
</div></div>