[CMake] Controlling what "install" does at make-time ?

Brandon Van Every bvanevery at gmail.com
Thu Jul 26 12:48:02 EDT 2007


On 7/26/07, Christian Convey <christian.convey at gmail.com> wrote:
> On 7/26/07, Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
> > On Thursday 26 July 2007 11:58, Christian Convey wrote:
> > > Hi Alex,
> > >
> > > Wouldn't the command:
> > > cmake -DCMAKE_INSTALL_COMPONENT=Headers -P cmake_install.cmake
> > >
> > > overwrite the very makefiles that are executing that command?  If so,
> >
> > No, -P means cmake will just execute the given cmake script, i.e. it will not
> > generate makefiles or project files etc.
>
> OK, so "-P" means that cmake won't produce a new Makefile.
>
> But don't I *need* to create a new Makefile?  I thought the goal was
> to produce a new Makefile whose "install" target has been affected by
> the "-DCMAKE_INSTALL_COMPONENT=Headers" argument.
>
> If "-P" prevents the creation of a new Makefile, it sounds like we're
> discarding the very Makefile that we're trying to create.
>
> Would you mind clarifying?

The CMake generator creates your Makefile and a bunch of other support
files and scripts, including cmake_install.cmake.  If you choose to
manually execute cmake_install.cmake via a custom command, you're
merely using what the generator already created, and invoking it the
same way the Makefile does.  By default, the script would just install
everything.  By passing -DCMAKE_INSTALL_COMPONENT=Headers, you're
getting a different behavior out of it.  Nothing will explode because
it's all code the generator produced anyways.

Cheers,
Brandon Van Every


More information about the CMake mailing list