[CMake] find_library setting search path order

vivek goel goelvivek2011 at gmail.com
Wed Jun 6 13:35:29 EDT 2012


sorry for typo it was path.
but still it doesn't work
find_library(PCRE_LIBRARY pcre
HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib
PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib
)

again output is /usr/lib/x86_64-linux-gnu/libpcre.so

regards
Vivek Goel



On Wed, Jun 6, 2012 at 10:52 PM, Andreas Pakulat <apaku at gmx.de> wrote:

> Hi,
>
> On Wed, Jun 6, 2012 at 5:40 PM, vivek goel <goelvivek2011 at gmail.com>wrote:
>
>> I am using following command to find pcre library
>>
>> SET(CMAKE_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib")
>> All compiled library are located in
>> ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib
>>
>> find_library(PCRE_LIBRARY
>> pcre
>> PATH
>> ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib}
>>
>> But every-time it is searching at
>> /usr/lib/x86_64-linux-gnu/libpcre.so. How can I change order for library
>> search path ?
>>
>
> See the documentation for the function:
> http://cmake.org/cmake/help/v2.8.8/cmake.html#command:find_library
>
> As you can see 'PATH' is an unknown parameter for the function anyway. You
> probably want to provide HINTS. The exact logic of finding the libraries is
> explained there too.
>
> Andreas
>
>
>>
>>
>>
>>
>>
>> regards
>> Vivek Goel
>>
>>
>> --
>>
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120606/0e0869bb/attachment.htm>


More information about the CMake mailing list