dlib_httpclient and dlib are both static libraries.<br><br>So yes, that&#39;s what I did :-). I just thought it was worth mentioning it because it wasn&#39;t a logical result of the command.<br><br><br>Grtz,<br>Steven<br><br>
<div class="gmail_quote">2009/2/25 Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Why, then, don&#39;t you simply list the libraries in the correct order in the target_link_libraries command? The add_dependencies command only has an effect on targets, not external libraries. If indeed, they are targets (which doesn&#39;t become clear from your code) you should do:<br>

<br>
target_link_libraries( dlib_httpclient dlib )<br>
<br>
target_link_libraries( ${PROJECT_NAME} dlib_httpclient )<br>
<br>
<br>
Although, the libraries are static, CMake the remembers that dlib_httpclient depends on dlib and in the last link-command you only have to specify the dlib_httpclient library and CMake will do the rest for you.<br>
<br>
HTH<br><font color="#888888">
<br>
Michael</font><div><div></div><div class="h5"><br>
<br>
On 25. Feb, 2009, at 15:22, Steven Van Ingelgem wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, it has to do something with it...<br>
Because at least when linking under Linux, if I added dlib BEFORE<br>
dlib_httpclient (as is now the case), dlib_httpclient will complain about<br>
undefined symbols.<br>
<br>
That&#39;s where the add_dependencies would come into play in my honest opinion.<br>
CMake should calculate the order in which to place the libraries to link<br>
with to honour all the calls made in the project. So in my case, place dlib<br>
behind dlib_httpclient.<br>
<br>
What you are refering to is not a dependency in linkage, but a dependency in<br>
compilation. This is fine of course, but is not enough when compiling<br>
libraries.<br>
<br>
<br>
Greetings,<br>
Steven<br>
<br>
<br>
2009/2/25 Michael Wild &lt;<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>&gt;<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think you misunderstand add_dependencies. The command adds a dependency<br>
of dlib_httpclient on dlib, i.e. dlib_httplclient DEPENDS ON dlib. It has<br>
nothing to do with the order the libraries appear on the command line when<br>
you link ${PROJECT_NAME}.<br>
<br>
HTH<br>
<br>
Michael<br>
<br>
<br>
On 25. Feb, 2009, at 14:15, Steven Van Ingelgem wrote:<br>
<br>
I have:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
add_dependencies(dlib_httpclient dlib)<br>
<br>
But in my cmakelists I have:<br>
TARGET_LINK_LIBRARIES(${PROJECT_NAME} dlib dlib_httpclient)<br>
<br>
Conclusion: it will change itself to &quot;bin/libdlib.a<br>
bin/libdlib_httpclient.a&quot;<br>
instead I would expect &quot;bin/libdlib_httpclient.a bin/libdlib.a&quot; as I told<br>
it<br>
to add the dependency.<br>
<br>
<br>
Greetings,<br>
Steven<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<br>
<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:<br>
<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>
<br>
</blockquote>
<br>
<br>
</blockquote></blockquote>
<br>
</div></div></blockquote></div><br>