[CMake] FIND_LIBRARY bug?

Eric Bolz ebolz at mitre.org
Fri Oct 22 16:56:08 EDT 2004


A better solution is to search in a different order.  If the user knows 
enough to specify the exact places where s/he wants FIND_LIBRARY() to 
look, who is cmake to say otherwise. 

I suggest the following order:
1)  path passed into FIND_LIBRARY command
2)  CMAKE_LIBRARY_PATH  // environment variable
3)  PATH  // environment variable

Eric

Lars Pechan wrote:

> Perhaps I'm pointing out the obvious here but maybe FIND_LIBRARY 
> should have the option 'NO_SYSTEM_PATH' like FIND_PROGRAM does?
>
> /Lars
>
> On 23/10/2004, at 6:54 AM, William A. Hoffman wrote:
>
>> CMake looks in the following places for FIND_LIBRARY:
>>
>> CMAKE_LIBRARY_PATH  // environment variable
>> PATH  // environment variable
>> path passed into FIND_LIBRARY command
>>
>> So, it is finding it because /usr/local/bin must be in PATH.
>> Currently, the only way to get around this problem would be
>> to set the environment variable CMAKE_LIBRARY_PATH.
>>
>> -Bill
>>
>>
>> At 01:44 PM 10/22/2004, Eric Bolz wrote:
>>
>>> I'm do the following in cmake 2.0.3
>>> FIND_LIBRARY (MY_LIB    NAMES Xpm      PATHS /my/path)
>>> MESSAGE( "MY_LIB is ${MY_LIB}")
>>>
>>> MY_LIB gets set to /usr/local/bin.  Why?
>>> Sure, it exists there but I don't want that one. I did not tell 
>>> cmake to look there.
>>> If cmake wants to look there then it should look there last.
>>> I even took /usr/local/bin out of my LD_LIBRARY_PATH and get the 
>>> same result.
>>> I see no way to get FIND_LIBRARY to look in the specified PATHS first.
>>>
>>> Eric
>>>
>>>
>>> _______________________________________________
>>> CMake mailing list
>>> CMake at www.cmake.org
>>> http://www.cmake.org/mailman/listinfo/cmake
>>
>>
>> _______________________________________________
>> CMake mailing list
>> CMake at www.cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>
>



More information about the CMake mailing list