[CMake] COMPONENT question

Dave Flogeras dflogeras2 at gmail.com
Mon Oct 31 14:10:22 EDT 2016


Iosif, that's exactly it, I was not paying attention to the [ ] in the
docs!  Thanks for your help.

On Mon, Oct 31, 2016 at 2:57 PM, iosif neitzke <
iosif.neitzke+cmake at gmail.com> wrote:

> Try something like:
> INSTALL( TARGETS foo ARCHIVE DESTINATION lib COMPONENT bar
>                      RUNTIME DESTINATION bin COMPONENT bar
>                      LIBRARY DESTINATION bin COMPONENT bar )
>
> The nesting of brackets "[]" in docs [0], requires a COMPONENT keyword
> and argument (should you choose to use components) for each kind of
> target file keyword (ARCHIVE, RUNTIME, LIBRARY, etc..) you use.
>
> I believe you get the puzzling behavior varying with STATIC versus
> SHARED library type because of the way the command is parsed.  When
> building a STATIC library, there is only an ARCHIVE, which has no
> COMPONENT listed, so you get "Unspecified" when listing components.
> When building a SHARED library on non-DLL platforms, the binary is a
> LIBRARY target, which has the COMPONENT "bar" listed.
>
> Each kind of target file keyword (ARCHIVE, RUNTIME, LIBRARY, etc..) has
> its own list of subsequent properties.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161031/a66aba8b/attachment.html>


More information about the CMake mailing list