<div dir="ltr"><span style="font-size:12.8px">I believe you can install and assign multiple targets in different subdirectories to a single export:</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">/foo/CMakeLists.txt:</div><div style="font-size:12.8px">    install(TARGETS foo EXPORT mylib-targets ...)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">/bar/CMakeLists.txt</div><div style="font-size:12.8px">    install(TARGETS bar EXPORT mylib-targets ...)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">/CMakeLists.txt</div><div style="font-size:12.8px">    install(EXPORT mylib-targets ...)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 12:26 AM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Documentation states, that to export a file that imports your targets,<br>
you must do roughly:<br>
<br>
install(TARGETS fubar EXPORT fubar-targets)<br>
install(EXPORT fubar-targets DESTINATION lib/cmake/fubar)<br>
<br>
Why is this done in two steps? Based on reading the install()<br>
documentation, I don't see how the install(TARGETS) command is useful<br>
without the corresponding install(EXPORT).<br>
<br>
Can someone explain why these are separate commands instead of 1<br>
complete command? Thanks in advance.<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>