Thanks for that link Michael. It doesn't please me, but I can confirm that it does work :-) It's a nice hack around a deficiency in cmake. I ended up using this code:<br><br># First create a dummy library to hang the pthreads <br>
# dependency on via the IMPORTED_LINK_INTERFACE_LIBRARIES property.<br>file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pthreads_dummy.c "")<br>add_library(pthreads_dummy STATIC ${CMAKE_CURRENT_BINARY_DIR}/pthreads_dummy.c)<br>
<br># make sure the dummy library gets built<br>add_dependencies(systemc pthreads_dummy)<br><br># export the dummy library so we can include it as an imported target<br>export(TARGETS pthreads_dummy NAMESPACE imported FILE importedpthreads_dummy.cmake)<br>
include(${CMAKE_CURRENT_BINARY_DIR}/importedpthreads_dummy.cmake)<br><br># use the imported target to add pthread dependency for the DEBUGPTHREADS config<br>set_target_properties(importedpthreads_dummy <br> PROPERTIES <br>
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUGPTHREADS ${PTHREADS_LIBRARIES})<br><br>target_link_libraries(myLib importedpthreads_dummy)<br><br>which is a lot of extra lines when all I really want is something like this:<br>
<br>target_link_libraries(myLib CONFIG DebugPthreads pthreads)<br><br>--<br>Glenn<br><br><br><div class="gmail_quote">On 26 April 2011 15:15, Michael Hertling <span dir="ltr"><<a href="mailto:mhertling@online.de">mhertling@online.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">
<br>
</div></div>There is a possibility with an intermediate empty static library which<br>
gets reimported into the project and equipped with the target property<br>
IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>, but I don't know if that<br>
approach will please you... ;) Anyway, see [1] for the details.<br>
<br>
Regards,<br>
<br>
Michael<br>
<br>
[1] <a href="http://www.mail-archive.com/cmake@cmake.org/msg34680.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg34680.html</a><br>
<br>
PS: Empty static libraries aren't allowed on Windows; use<br>
<br>
FILE(WRITE ${CMAKE_BINARY_DIR}/dummy.c "")<br>
ADD_LIBRARY(dummy STATIC dummy.c)<br>
<br>
to satisfy the Visual Studio tools.<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>