<div dir="ltr"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-10 2:38 GMT+03:00 Walter Gray <span dir="ltr"><<a href="mailto:chrysalisx@gmail.com" target="_blank">chrysalisx@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hey all,<br>
I'm working on a module that will allow me to automatically copy all
the required .dll files as defined by well-formed import library
targets to the appropriate location (same folder for windows,
Frameworks folder for OSX bundle, ect). I've got the code that
scans an executable's INTERFACE_LINK_LIBRARIES property recursively
to find all such shared library, however I'm running into a small
problem. I really like using file globbing in higher level source
directories to add all appropriate sub-directories, but this means
that sometimes a dependency will not be fully defined yet. This is
normally fine since these things are usually resolved at
*generation* time, but since I'm doing a manual traversal of the
list of link libraries at config time that's not really acceptable.
I realize I could just not do the globbing and just make sure the
directories were setup in the correct order, but I really don't like
making the add_subdirectory calls order dependent.<br>
<br>
One solution I've come up with is to add the targets I want to do
this to to a global list, then iterate over that list as the last
step in my top-level cmake lists file, but that has the issue that I
can no longer use add_custom_command on those targets at that
point. I'm wondering 3 things:<br>
<br>
1)What is the reasoning behind not allowing add_custom_command on
targets not defined in the current directory? Especially now that
SOURCE can be modified, the restriction seems very arbitrary.<br>
<br>
2)How stupid would it be to reserve the command using something like
<br>
<font face="Courier New, Courier, monospace"> <font size="-1">add_custom_command(TARGET
${target} POST_BUILD COMMAND
$<TARGET_PROPERTY:COPY_SHARED_LIBS_COMMAND>)</font></font><br>
then use set_property(TARGET ${target} APPEND PROPERTY
COPY_SHARED_LIBS_COMMAND to add more copy steps to the command?<br>
<br>
3) Am I completely missing something and there's already a totally
well supported way of making sure that an executable's shared
library dependencies end up in the correct directory? I couldn't
find a really satisfactory answer on stack overflow or the archives.<br>
<br>
Thanks!<br>
</div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Best Regards,<br>Sergei Nikulov</div>
</div>