[CMake] How to extract the directory path from find_library ?
Witold E Wolski
wewolski at gmail.com
Fri Dec 14 08:44:06 EST 2012
Hi Eike,
Thx for the good advice.
Witold
On 14 December 2012 14:32, Rolf Eike Beer <eike at sf-mail.de> wrote:
> Am , schrieb Witold E Wolski:
>
> Hi,
>>
>> I am using
>>
>> FIND_LIBRARY(CPPUNIT_LIBRARY NAMES cppunit HINTS
>> ${CPPUNIT_INCLUDE_DIR}/../lib)
>>
>>
>> to find library locations. But what I am needing is the directory
>> containing the lib and not the full path.
>> How do I get it?
>>
>
> cmake --help-command get_filename_component
>
> And if you think about using that for linking: all you need is the full
> path. Just pass that to target_link_libraries. Don't even think about
> messing around with link_directories().
>
> Eike
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<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<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>
--
Witold Eryk Wolski
Triemlistrasse 155
8047 Zuerich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121214/07899abf/attachment.htm>
More information about the CMake
mailing list