<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-10-12 18:04 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"><br>
<br>
12.10.2016, 18:48, "Eric Noulard" <<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>>:<br>
<span class="gmail-">> 2016-10-12 17:28 GMT+02:00 Konstantin Tokarev <<a href="mailto:annulen@yandex.ru">annulen@yandex.ru</a>>:<br><br>
><br>
> 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.<br>
><br>
> So I bet FindLibXml2.cmake does not handle the given<br>
> "PATHS "/usr" NO_DEFAULT_PATH" part.<br>
><br>
> Which are handled by find_package when running in "Config mode".<br>
><br>
> I suggest you to try patch and update the FindLibXml2.cmake module.<br>
<br>
</span>Could anyone point me to module example that handles NO_DEFAULT_PATH correctly?<br></blockquote><div><br></div><div>Wait for other answers but from my understanding the "Module" mode does not handle such find_package parameter.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> Or simply craft your own<br>
><br>
> find_library(...) call.if you only need the libxml2.<br>
<br>
</span>That's not an elegant solution as I need to find include dir as well, and also do the same for libxslt which is in the same boat.<br></blockquote><div><br></div><div>I see.</div><div>Then provided that module mode does not handle the "NO_DEFAULT_PATH" you may need to do something similar to whats is done</div><div>by the FindZLIB.cmake module:</div><div><br></div><div><div># A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this</div><div># module where to look.</div><div><br></div><div>set(_ZLIB_SEARCHES)</div><div><br></div><div># Search ZLIB_ROOT first if it is set.</div><div>if(ZLIB_ROOT)</div><div>  set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)</div><div>  list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)</div><div>endif()</div></div><div><br></div></div><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>