[CMake] Loop expansion in find_library() seems backwards
Michael Wild
themiwi at gmail.com
Wed Sep 8 02:38:12 EDT 2010
On 8. Sep, 2010, at 8:25 , Philip Lowman wrote:
> 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
Oh, no! This topic haunts the list ;-) See
http://www.mail-archive.com/cmake@cmake.org/msg30602.html
http://www.mail-archive.com/cmake@cmake.org/msg28946.html
http://www.mail-archive.com/cmake@cmake.org/msg27838.html
http://www.mail-archive.com/cmake@cmake.org/msg24565.html
Michael
--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100908/70141287/attachment.pgp>
More information about the CMake
mailing list