Let's say I have many different potential names for a library and the
following filesystem
/usr/lib/libnspr4.so
${CMAKE_CURRENT_SOURCE_DIR}/libnspr4a.so
find_library(TEST_LIBRARY
NAMES nspr4 nspr4a
HINTS ${CMAKE_CURRENT_SOURCE_DIR}
)
I'm somewhat surprised that the following code finds /usr/lib/libnspr4.so
instead of the alternate name for it (libnspr4a.so). This tells me that the
loop is backwards. Shouldn't the find_library() command be iterating the
list of library names across each directory. For example, the above should
search:
First ${CMAKE_CURRENT_SOURCE_DIR}...
${CMAKE_CURRENT_SOURCE_DIR}/libnspr4.so
${CMAKE_CURRENT_SOURCE_DIR}/libnspr4a.so
Then the system directories...
(system paths)/lib/libnspr4.so
(system paths)/lib/libnspr4a.so
Etc.
The system is actually searching
${CMAKE_CURRENT_SOURCE_DIR}/libnspr4.so
/usr/lib/libnspr4.so
${CMAKE_CURRENT_SOURCE_DIR}/libnspr4a.so
/usr/lib/libnspr4a.so
This is with CMake 2.8.2
--
Philip Lowman
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake