<div dir="ltr">When I search for a given library, specifying multiple possible names and multiple hints for paths...<div><br></div><div><div>FIND_LIBRARY( FINDME_LIB</div><div>        NAMES name1 name2 name3</div><div>        HINTS path1 path2 path3</div>
<div>        DOC "Library to find")</div></div><div><br></div><div>CMake seems to have a preference for name1, and it first searches all HINTS for name1.  If it doesn't find name1, it moves to name2 and then searches all HINTS for name2, etc.</div>
<div><br></div><div>I would prefer to have a preference for path1, no matter the name.  Try for all names in path1, then move to path2, etc.</div><div><br></div><div>Is there a way to toggle this behavior?</div><div><br></div>
<div>Rob</div><div><br></div><div><br></div><div>Background...  Basically, I am using ExternalProject_Add to build a library.  However, to make it possible to use the system-library instead, this is optional.  I use a FindThelib.cmake so the main project works seamlessly either way.</div>
<div><br></div><div>I'm targeting the case where a version of this library is installed on the system, but I want to use my own copy.</div><div><br></div><div>The name of the library depends on build options and platform, so controlling on the name is a little fragile.  However, I have explicitly built it in a known directory, so having preference for the known directory is desirable.</div>
</div>