[CMake] Does find_library check that a found library does in fact link?

Clifford Yapp cliffyapp at gmail.com
Wed Sep 28 19:30:00 EDT 2011


On Wed, Sep 28, 2011 at 2:47 AM, Michael Wild <themiwi at gmail.com> wrote:

>
> Only if your installation is broken ;-) If the symlink is broken, I
> consider this to be a user-error. Period. OTOH, CMake /could/ check
> whether the library is a symlink, and if it is, check that it is valid.
>

Oh, no question the installation is broken.  I'd just expect find_library to
do whatever minimal validation it can easily do and not return invalid cases
it can spot - checking for symlink and whether it's valid would catch one
general class of error, and perhaps a quick check to see if the file is a
binary or a text file would be another.   Not perfect, but such tests should
be relatively simple and would improve the utility of find_library.


> But how do you test whether a library is "linkable"?
>

Not sure - autoconf has some sort of test that works in at least some cases
in their AC_CHECK_LIB macro, but I'm not really clear on what it does.  Even
if such a test wouldn't catch all cases, mightn't it be useful to fail when
available tests do detect a problem?

Cheers,
CY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110928/cb15cb53/attachment.htm>


More information about the CMake mailing list