[CMake] INSTALL( COMPONENT

Brad King brad.king at kitware.com
Mon Oct 2 11:47:53 EDT 2006


Filipe Sousa wrote:
> I don't understand how COMPONENT works. From the INSTALL manual the
> "COMPONENT argument specifies an installation component name with which
> the install rule is associated, such as "runtime" or "development".
> During component-specific installation only install rules associated
> with the given component name will be executed.  During a full
> installation all components are installed"
> 
> This expample is from CMake/Tests/SimpleInstall
> 
> INSTALL(TARGETS SimpleInstall test1 test2 test3
>   RUNTIME DESTINATION MyTest/bin  COMPONENT Runtime     # .exe, .dll
>   LIBRARY DESTINATION MyTest/lib  COMPONENT Runtime     # .so, mod.dll
>   ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib
>   )
> 
> How can I install only the runtime files? "make install" installs
> everything.

This is part of CPack's API.  There is no API in the make system to use
this feature.

You have to run "make preinstall" to prepare the installation and then
run "cmake -DCOMPONENT=Runtime -P cmake_install.cmake" to do the
component-specific installation.

-Brad


More information about the CMake mailing list