These seem like bugs to me. I'm pretty sure you're going to have similar luck across many find modules in CMake, however. I don't think static linking is that widely tested, unfortunately.<br><br>For libxml2's dependency on pthread you should be able to use FindThreads or FindPthreads. I'm not sure about xcb_get_request_sent, I would try libxcb?<br>
<br>Also, complicating this problem are questions about "optional" dependencies. CMake find modules don't know if libxml2 was built with or without pthreads support, for example.<br><br>I think if you're planning on doing static linking, you're probably going to have to resolve dependencies manually in a lot of cases at least with the way things currently are done.<br>
<br><br><div class="gmail_quote">On Tue, Nov 10, 2009 at 5:29 PM, <span dir="ltr"><<a href="mailto:olivier.pierard@cenaero.be">olivier.pierard@cenaero.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Dear all,<br>
<br>
For the compilation of my project, I want to provide a static or dynamic<br>
linked final executable (e.g.: linking preferentially with .a or .so<br>
libraries on Linux). For this, I set up a cache variable which enables to<br>
modify CMAKE_FIND_LIBRARY_SUFFIXES (".a;.so" or ".so;.a"). By the way, I<br>
don't know if that's the good way ?<br>
<br>
In a find module that I wrote myself, I call FindX11.cmake and<br>
FindXml2.cmake (provided by my distribution - suse 10.3). Everything works<br>
perfectly for dynamically linked libraries but fails at final link when<br>
using static link. Among the numerous errors, I can find things like<br>
-<br>
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libX11.a(xcb_lock.o):<br>
In function `_XPutXCBBuffer':<br>
(.text+0xd9): undefined reference to `xcb_get_request_sent'<br>
-<br>
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libxml2.a(threads.o):<br>
In function `xmlInitThreads':<br>
(.text+0x3a): undefined reference to `pthread_key_create'<br>
<br>
I guess it means that a static library is missing in the final link. But<br>
such dependencies shouldn't be taken by the corresponding find Module ? In<br>
that case, could you provide me a reference site where I can find reliable<br>
find modules. Or Am I missing something in my own find module ?<br>
<br>
Thanks for your help !<br>
<br>
Olivier<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>Philip Lowman<br>