<div dir="ltr"><div><div>Hello again,<br><br></div>the problem was that the static version of the METIS library must be linked with the MATH library (libm). After adding:<br><br>SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} /path/to/math/library )<br><br></div><div>it seems that all works fine.<br><br></div><div>Best regards,<br></div><div>Víctor.<br></div><div><br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-10 11:02 GMT+01:00 victor sv <span dir="ltr"><<a href="mailto:victorsv@gmail.com" target="_blank">victorsv@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hello all,<br><br></div>I'm a newbie using CMake and I'm trying to migrate the compilation of a fortran project to CMake.<br><br></div>I'm trying to detect the METIS library with find_library(). Inside my FindMETIS.cmake I want to check the existence of some functions to set the library version with:<br><br><blockquote>CHECK_LIBRARY_EXISTS(metis METIS_SetDefaultOptions /path/to/metis VARIABLE_NAME)<br></blockquote><br></div>If /path/to/metis contains the METIS shared library (libmetis.so) it works as expected, but if /path/to/metis only contains the static version of the library (libmetis.a) CHECK_LIBRARY_EXISTS cannot found this function...<br><br></div><div>I check that the library contains this function with the following result:<br><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div>$ nm libmetis.a  | grep -i setdefaultoptions<br><div style="margin-left:40px">0000000000000210 T metis_setdefaultoptions<br>0000000000000220 T metis_setdefaultoptions_<br>0000000000000230 T metis_setdefaultoptions__<br>                             U METIS_SetDefaultOptions<br>0000000000000200 T METIS_SETDEFAULTOPTIONS<br>                             U METIS_SetDefaultOptions<br>0000000000000030 T METIS_SetDefaultOptions</div></div></blockquote><div><br>I don't know if this the expected behaviour of this macro, but anyway I need to do this check in both, shared and static library. How can I do this?<br><br></div>Any help would be appreciated. <br><br></div>Thanks,<br></div>Víctor.<br></div>
</blockquote></div><br></div>