<div dir="ltr">Mind you 'install' doesn't have to be '/usr' or 'program files/whatever' but could be 'output' which will be relative to ${CMAKE_BINARY_DIR} if not absolute<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 9, 2014 at 4:15 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This sounds more like an install phase... to bring the whole package together in one appropriate place.<div><br></div><div>if( WIN32 )</div><div>INSTALL( TARGET <target> RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib )</div><div class="gmail_extra">else( WIN32 )</div><div class="gmail_extra">INSTALL( TARGET <target> RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib )<br></div><div class="gmail_extra">endif( WIN32 )</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Dec 9, 2014 at 3:38 PM, Walter Gray <span dir="ltr"><<a href="mailto:chrysalisx@gmail.com" target="_blank">chrysalisx@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">
  

    
  
  <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></div></div>--<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></div></div>
</blockquote></div><br></div>