Thanks Michael<br><br>Doing the following ends up working ... <br><br><font style="font-family: courier new,monospace;" size="1">IF(UNIX)<br> # If the faster 'gold' linker is used, to avoid complaints about undefined symbol<br>
# '_gfortran_concat_string', '_gfortran_pow_i4_i4', ... , let's link against gfortran libraries.<br> # These errors happen while linking against VTK static built with R support<br> SET(CMAKE_FIND_LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) # Backup<br>
LIST(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".so.3")<br>
FIND_LIBRARY(GFortran_LIBRARY gfortran)<br> SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAVED}) # Restore<br> LIST(APPEND EXTRA_LIBRARIES ${GFortran_LIBRARY})<br>ENDIF()<br><br>Thanks<br>Jc<br></font><br>
<br><div class="gmail_quote">On Wed, Apr 13, 2011 at 4:08 PM, Michael Hertling <span dir="ltr"><<a href="mailto:mhertling@online.de" target="_blank">mhertling@online.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On 04/13/2011 09:26 PM, Brad King wrote:<br>
> On 04/13/2011 02:44 PM, Jean-Christophe Fillion-Robin wrote:<br>
>> Is there a solution to find a library having a revision number ?<br>
><br>
> You can specify the actual library file name "libgfortran.so.3".<br>
<br>
</div>AFAIK, this is not sufficient because FIND_LIBRARY() only looks for<br>
library files - specified literally or not - which end with a suffix<br>
mentioned in FIND_LIBRARY_SUFFIXES. See the following CMakeLists.txt:<br>
<br>
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)<br>
PROJECT(XYZ NONE)<br>
SET(CMAKE_VERBOSE_MAKEFILE ON)<br>
FILE(WRITE ${CMAKE_BINARY_DIR}/libxyz.so.3 "")<br>
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so.3")<br>
FIND_LIBRARY(XYZ libxyz.so.3 PATHS ${CMAKE_BINARY_DIR} NO_DEFAULT_PATH)<br>
MESSAGE("XYZ: ${XYZ}")<br>
<br>
First, ${CMAKE_BINARY_DIR}/libxyz.so.3 is found, but if you remove the<br>
SET(CMAKE_FIND_LIBRARY_SUFFIXES ...) command and unset the XYZ cache<br>
entry, you'll probably see libxyz.so.3 not being found anymore. It is<br>
cmFindLibraryHelper::SetName() that implements this behaviour, if I'm<br>
not mistaken. So, a possible workaround is to temporarily add ".so.3"<br>
or whatever is desired to CMAKE_FIND_LIBRARY_SUFFIXES before calling<br>
FIND_LIBRARY(), cf. [1].<br>
<br>
Regards,<br>
<br>
Michael<br>
<br>
[1] <a href="http://www.mail-archive.com/cmake@cmake.org/msg35219.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg35219.html</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br><br>