[CMake] Cmake custom install target for a particular binary

Eric Noulard eric.noulard at gmail.com
Wed May 30 08:10:29 EDT 2012


2012/5/30 vivek goel <goelvivek2011 at gmail.com>:
> hi,
> I am having 10 binary inside my project.
> If I run make install DESTDIR=<> it builds all source code and install
> everything.
> Is there a way I can install a particular binary ?
> Like having custom target like
> make install.bin1 DESTDIR=<> which will install only particular binary ?

You can not do that this way, and there is some related (backloged)
feature request:
http://public.kitware.com/Bug/view.php?id=10531

What you can currenlty do is:

define COMPONENT in your CMake install(...) statement,
then you can use:
DESTDIR=/whatever/path cmake -DCOMPONENT="Whatever" -P cmake_install.cmake

and this should install the concerned component using DESTDIR.

This is not exactly what you want because you may not want to define
one component per target but at least it can be workaround.

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list