[CMake] Custom install target to install only files

Michael Wild themiwi at gmail.com
Thu May 24 11:59:23 EDT 2012


On 05/24/2012 03:43 PM, vivek goel wrote:
> I have a project with 10 binary files.
> and I am installing custom 15 bash files using
> 
> install(PROGRAMS
>           <file-list>
>          DESTINATION /bin        
>           )
> 
> Is there a way to have custom install target like
> make install script which will install only required script files with
> building source code for binary files?
> 
> regards
> Vivek Goel

Add the "COMPONENT scripts" option to the install() command and then
install the scripts like this:

cmake -DCOMPONENT=scripts -P cmake_install.cmake

Note that the -D option must be *before* the -P option, otherwise it is
ignored.

HTH

Michael


More information about the CMake mailing list