[CMake] How to use INSTALL( ... COMPONENT ... )?

Christian Convey christian.convey at gmail.com
Wed Aug 8 10:04:27 EDT 2007


On 8/8/07, Eric Noulard <eric.noulard at gmail.com> wrote:
> Hi list,
>
> Can anybody here explain how the COMPONENT option of
> the INSTALL CMake MACRO
> works?

I think of it as a way to give a name to different subsets of your
installable files, so that you can install the subset of choice using
"make install".

When I'm creating Debian packages, I use COMPONENTS to specify which
files should end up in each Debian package.  So each Debian package
has a corresponding install component.

When I go to build by n different Debian packages, I end up basically
running 'make install' n different times, having specified a different
install component each time.  (Note that components and "make install"
have little to do with Debian packaging.  It just has to do with the
particular technique I use to create my packages.)

Also, note that if you want to specify *at the time you run 'make
install'* which component will be installed, you need to do a little
trick using 'cmake -P ...'.  Otherwise you can only specify the
install component at the time you're configuring your project.

HTH,
Christian


More information about the CMake mailing list