[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Why is target installation done in 2 separate steps?
From:       Tamás Kenéz <tamas.kenez () gmail ! com>
Date:       2016-07-20 20:26:52
Message-ID: CAPB8=n-LrCRw02dpA25GFdgYCCp90+4C1fJ+4kxXgWx4V7cH+Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I believe you can install and assign multiple targets in different
subdirectories to a single export:

/foo/CMakeLists.txt:
    install(TARGETS foo EXPORT mylib-targets ...)

/bar/CMakeLists.txt
    install(TARGETS bar EXPORT mylib-targets ...)

/CMakeLists.txt
    install(EXPORT mylib-targets ...)

On Mon, Jul 11, 2016 at 12:26 AM, Robert Dailey <rcdailey.lists@gmail.com>
wrote:

> Documentation states, that to export a file that imports your targets,
> you must do roughly:
>
> install(TARGETS fubar EXPORT fubar-targets)
> install(EXPORT fubar-targets DESTINATION lib/cmake/fubar)
>
> Why is this done in two steps? Based on reading the install()
> documentation, I don't see how the install(TARGETS) command is useful
> without the corresponding install(EXPORT).
>
> Can someone explain why these are separate commands instead of 1
> complete command? Thanks in advance.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>

[Attachment #5 (text/html)]

<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">&lt;<a href="mailto:rcdailey.lists@gmail.com" \
target="_blank">rcdailey.lists@gmail.com</a>&gt;</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&#39;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>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic