See also the BundleUtilities module.<br><br>Work in CVS CMake recently has extended the "fixup_bundle" function so that it works on Windows/Linux as well as on a Mac. And what you are looking for is exactly what it does. If executed in an install script, fixup_bundle will analyze a given executable and then copy/fixup any required non-system shared libraries making it easy to depend on third party dlls without adding a bunch of explicit copy steps yourself...<br>
<br>The prime example of its use is still Mac-only, though: grep for CompleteBundle in the ParaView source tree for the canonical example.<br><br>HTH,<br>David<br><br><br><div class="gmail_quote">On Fri, Aug 28, 2009 at 4:44 AM, Michael Wild <span dir="ltr"><<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</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>
You could use CMAKE_RUNTIME_OUTPUT_DIRECTORY or the RUNTIME_OUTPUT_DIRECTORY target property to specify where CMake should put all the produced runtime stuff (on Windows, AFAIK this is *.exe and *.dll), so you don't have to copy them around manually.<br>
If the dll's are not built by you, you might want to have a look at the GetPrerequisites and InstallRequiredSystemLibraries modules.<br><font color="#888888">
<br>
Michael</font><div><div></div><div class="h5"><br>
<br>
On 28. Aug, 2009, at 10:12, Müller Michael 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;">
Hi Michael,<br>
<br>
Thanks for your repsonse but I need the required DLLs to copy them in a post-build step. So I need the information which libaries are required for executing something. E.g., in your example<br>
<br>
add_library(a ${A_SRCS})<br>
add_library(b ${B_SRCS})<br>
target_link_libraries(b a)<br>
add_executable(c ${C_SRCS})<br>
target_link_libraries(c b)<br>
<br>
I`d like to have something like<br>
GET_TARGET_PROPERTY(LIBS c IMPORTED_LINK_DEPENDENT_LIBRARIES) and then LIBS would contain "C:\project\a.dll;C:\project\b.dll". I also tried it with IMPORTED_LINK_DEPENDENT_LIBRARIES but that gives me an empty variable.<br>
<br>
Hopefully, this made my problem clearer.<br>
<br>
Michael<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: Michael Wild [mailto:<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>]<br>
Gesendet: Freitag, 28. August 2009 09:30<br>
An: Müller Michael<br>
Cc: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
Betreff: Re: [CMake] Get all required shared libs from a target<br>
<br>
<br>
On 28. Aug, 2009, at 8:29, Müller Michael 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;">
Hi guys,<br>
<br>
is it possible to "investigate" a target for all required shared<br>
libs (transitively). That means i dont which libraries where set<br>
with TARGET_LINK_LIBRARIES and somewhere in my CMakeLists.txt i want<br>
to find it out again.<br>
<br>
Thank you<br>
Michael<br>
</blockquote>
<br>
<br>
Hi<br>
<br>
You don't need this (for the case you described). CMake remembers for<br>
you:<br>
<br>
<br>
add_library(a ${A_SRCS})<br>
add_library(b ${B_SRCS})<br>
target_link_libraries(b a)<br>
add_executable(c ${C_SRCS})<br>
target_link_libraries(c b)<br>
<br>
<br>
As you see in the last line, c is mentioned to link against b. CMake,<br>
however, remembers that b also links against a, and consequently also<br>
adds a to the list of libraries to link against.<br>
<br>
<br>
HTH<br>
<br>
Michael<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>
<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>
</div></div></blockquote></div><br>