When I search for a given library, specifying multiple possible names and
multiple hints for paths...

FIND_LIBRARY( FINDME_LIB
        NAMES name1 name2 name3
        HINTS path1 path2 path3
        DOC "Library to find")

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.

I would prefer to have a preference for path1, no matter the name.  Try for
all names in path1, then move to path2, etc.

Is there a way to toggle this behavior?

Rob


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.

I'm targeting the case where a version of this library is installed on the
system, but I want to use my own copy.

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.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to