[CMake] Install targets and component

Lars laasunde at hotmail.com
Tue Aug 11 04:51:29 EDT 2015


Thank you Nils, that solved the issue. Cannot believe I missed that in the documentation.
 
Regards, Lars
 
> Date: Tue, 11 Aug 2015 09:41:22 +0200
> From: nilsgladitz at gmail.com
> To: laasunde at hotmail.com; cmake at cmake.org
> Subject: Re: [CMake] Install targets and component
> 
> On 08/11/2015 09:05 AM, Lars wrote:
> > Hello,
> >
> > The following cmake script appears to work but the target is associated
> > with "Unspecified" group according to cmake_install.cmake file.
> > INSTALL(
> >    TARGETS MyLib
> >    RUNTIME DESTINATION "${BIN_PATH}"
> >    LIBRARY DESTINATION "${LIB_PATH}"
> >    COMPONENT COMP_APP)
> >
> > By removing the following section the target is associated with COMP_APP
> > as expected.
> > LIBRARY DESTINATION "${LIB_PATH}"
> >
> > We are now using CMake 3.3. This worked great with CMake 2.8.12.
> 
> The behavior should be the same in 2.8.12 and 3.3.
> 
> Like DESTINATION the COMPONENT option is scoped by the RUNTIME, LIBRARY, 
> ARCHIVE etc. keywords.
> 
> The last of those in your call is LIBRARY hence the COMPONENT will apply 
> only to "LIBRARY" files installed by this command.
> 
> If you want COMPONENT to apply to all kinds of installed target files 
> list it before any of the scoping options e.g.
> 
> install(
>     TARGETS MyLib
>     COMPONENT COMP_APP
>     RUNTIME DESTINATION "${BIN_PATH}"
>     LIBRARY DESTINATION "${LIB_PATH}"
> )
> 
> or repeat it for each scope:
> 
> install(
>     TARGETS MyLib
> 
>     RUNTIME
>         DESTINATION "${BIN_PATH}"
>         COMPONENT COMP_APP
>     LIBRARY
>         DESTINATION "${LIB_PATH}"
>         COMPONENT COMP_APP
> )
> 
> Nils
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150811/6c5ada9d/attachment.html>


More information about the CMake mailing list