[CMake] `cmake -P cmake_install.cmake` vs `make install`

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Apr 17 12:16:04 EDT 2007


On 4/17/07, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2007/4/16, Mathieu Malaterre <mathieu.malaterre at gmail.com>:
> > 'lo
> >
> >   I am trying to figure out what is the slight difference between :
> >
> > make install
> >
> >   and
> >
> > cmake -P cmake_install.cmake
> >
> >   After reading the Makefile I need to run the `preinstall` target. So
> > my question is how do I do that ?
> >
> >   Right now I have:
> >
> >   ADD_CUSTOM_TARGET(deb_destdir_install
> >     COMMAND DESTDIR=${CMAKE_BINARY_DIR}/debian_package cmake -P
> > cmake_install.cmake
> >     DEPENDS ${CMAKE_BINARY_DIR}/cmake_install.cmake
> >     COMMENT "Building debian_package directory with DESTDIR"
> >   )
> >   #ADD_DEPENDENCIES(deb_destdir_install preinstall) # does not work
>
> May be you could just launch "make install" ?
> Something like:
>
> ADD_CUSTOM_TARGET(deb_destdir_install
>      COMMAND DESTDIR=${CMAKE_BINARY_DIR}/debian_package
> ${CMAKE_MAKE_COMMAND}  install
>      COMMENT "Building debian_package directory with DESTDIR"
> )

Hum...people with kdevelop will not be very happy with that :(
Anyway I am using make...

> this way you may use DESTDIR and you don't need to describe dependencies
> since make install will respawn cmake if needed.
>
>
> A s a side note when you use 'cmake' or 'make' command in your CUSTOM_whatever
> you should use
>
> ${CMAKE_CMAKE_COMMAND} for 'cmake'
> and
> ${CMAKE_MAKE_COMMAND} for 'make'

s/CMAKE_CMAKE_COMMAND/CMAKE_COMMAND/g
s/CMAKE_MAKE_COMMAND/CMAKE_MAKE_PROGRAM/g

> this way you should get the commands initially discovered by cmake itself
> and avoid facing mix & match version problem.
> I did face the problem for 'make' where both gmake and make were installed...

Ok thanks !

-Mathieu


More information about the CMake mailing list