<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 2, 2014 at 10:20 AM, Magnus Therning <span dir="ltr">&lt;<a href="mailto:magnus@therning.org" target="_blank">magnus@therning.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Thu, Jan 02, 2014 at 12:14:38AM -0500, Matt Wilbur wrote:<br>

&gt; With a bit of thought and source code reading, I sorted this out.<br>
&gt; Let me know if you&#39;d like me to post my answer to my own question.<br>
<br>
</div>Yes, please do.<br>
<br>
I&#39;m sure you&#39;ve found yourself in the very irritating situation where<br>
you&#39;re looking for the answer to some question, but all you can find<br>
is other people asking the same question in various fora.  By<br>
answering your own question you&#39;ll help other people avoid that<br>
irritating situation when they are looking around for an answer to<br>
this particular question. :)<br></blockquote><div><br></div><div>Very good point.</div><div><br></div><div>So, the flaw in my understanding was that the ONLY_CMAKE_FIND_ROOT_PATH | NO_CMAKE_FIND_ROOT_PATH | CMAKE_FIND_ROOT_PATH_BOTH had no effect if NO_DEFAULTS is used.</div>
<div><br></div><div>NO_DEFAULTS only affects the construction of the list of paths to be searched.  i.e. NO_DEFAULTS means the list of paths to be searched consists only of the paths specified by the PATHS argument (maybe others - haven&#39;t looked into that one).  Point is, all the find_XXX commands construct a list of paths to be searched, consisting of what is specified in the command plus maybe some other paths.</div>
<div><br></div><div>The effect of ONLY_CMAKE_FIND_ROOT_PATH | NO_CMAKE_FIND_ROOT_PATH | CMAKE_FIND_ROOT_PATH_BOTH (and, similarly CMAKE_FIND_ROOT_PATH_MODE_*) is to determine how that list of search paths is further processed to create the final list of paths searched by CMake.<br>
</div><div><br></div><div>Call the initial list of paths to be searched InitialSearchPaths.  Call RerootedSearchPaths the result of prepending each element of CMAKE_FIND_ROOT to each element of InitialSearchPaths.  In Clojure (since I&#39;ve been playing with it in my personal time and it succinctly captures the list processing):</div>
<div><br></div>(flatten (for [r CMAKE_FIND_ROOT] (map #(str r %) InitialSearchPaths)))</div><div class="gmail_quote"><br><div>The actual list of search paths, SearchPaths would be one of</div><div><br></div><div>IntitalSearchPaths </div>
<div>RerootedSearchPaths</div><div>(concat RerootedSearchPaths  IntitalSearchPaths)</div><div><br></div></div></div></div>