[CMake] Run commands after "make install"

Michael Biebl mbiebl at gmail.com
Tue Apr 11 16:47:28 EDT 2006


On 4/11/06, Filipe Sousa <filipe at ipb.pt> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Michael Biebl wrote:
> > Hi,
> >
> > after a successfull "make install" run I want to display some messages
> > and execute a command. With automake I used a install-data-hook in the
> > toplevel Makefile.am for this, so the commands were processed at the
> > end of the install run.
> > How can I do this with cmake? I tried to add a custom target which
> > executes this commands and used ADD_DEPENDENCIES(install
> > post_install). But this does not work as install is not recognized as
> > a target.
> >
> >  Any ideas?
>
> You can either use SET_TARGET_PROPERTIES or INSTALL(SCRIPT) (cvs only)

I tried something like that. The first problem is, that this script is
not run at the end but somewhere in between the toplevel install rules
and the subdirectory install rules.
The second, that I need ${CMAKE_SOURCE_DIR} in the install script,
because I have to execute as bash script which resides in
${CMAKE_SOURCE_DIR}/tools but the value of ${CMAKE_SOURCE_DIR} is the
same as ${CMAKE_BINARY_DIR} in the  install script (tested with
MESSAGE(${CMAKE_SOURCE_DIR}...).

Do I have to use CONFIGURE_FILE to set the correct paths in the
install script? Seems to be a lot of effort for this simple task.

Michael


More information about the CMake mailing list