<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-03-23 10:21 GMT+01:00 Mario Emmenlauer <span dir="ltr"><<a href="mailto:mario@emmenlauer.de" target="_blank">mario@emmenlauer.de</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>
Thanks PF, I think this makes more sense now! I was assuming that<br>
cmake always prefers CMAKE_PREFIX_PATH over builtin paths. But as you<br>
clarified, that only applies to libraries that provide find_package<br>
support.<br>
<br>
This is actually quite unfortunate. Then I don't see an easy way to<br>
enforce usage of specific libs. As an example, if I want to enforce a<br>
patched libtiff (that does not itself provide find_package support)<br>
the only "safe" way is to replace the system libtiff. Otherwise any<br>
package might just find the system version first without me even<br>
knowing.<br></blockquote><div><br></div><div>You can always ship your own/patched version of Find<Whatever>.cmake module with your</div><div>project source and build the 'local' override logic in it for every project/lib that does not provide a find_package.</div><div><br></div><div>Be sure to APPEND your local cmake module path (CMAKE_MODULE_PATH)</div><div><br></div><div>something like:</div><div> list(APPEND CMAKE_MODULE_PATH ${AFS_SOURCE_DIR}/cmake)</div></div><div class="gmail_extra"><br></div>before using find_package etc...</div><div class="gmail_extra"><br></div><div class="gmail_extra">I find it a "safer" solution than system lib replacement.</div><div class="gmail_extra">My opinion though.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div>
</div></div>