Creating a symlink when installing

David Faure faure at kde.org
Tue Mar 28 13:05:47 CEST 2006


On Monday 27 March 2006 21:04, Alexander Neundorf wrote:
> On Monday 27 March 2006 20:04, William A. Hoffman wrote:
> > At 12:56 PM 3/27/2006, David Faure wrote:
> > >I can't find it on a quick glance in the cmake docs... how do I create a
> > > symlink on installing? (e.g. we need it for "ln -s crystalsvg
> > > default.kde").
> >
> > ${CMAKE_COMMAND} -E create_symlink old new
> 
> To do this during installing, I think an INSTALL(SCRIPT ...) is required, 
> which executes the above command.

What's INSTALL(SCRIPT...)? It's not on http://www.cmake.org/HTML/Documentation.html

I tried something like this:
if (UNIX)
   # write a cmake script file which creates the symlink
   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_icontheme_symlink.cmake "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink crystalsvg ${ICON_INSTALL_DIR}/default.kde\n")
   # and add it as post-install script to any of the installed targets, so it will be executed during "make install"
   set_target_properties(xxxx PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_icontheme_symlink.cmake)
endif (UNIX)

But I have nothing to put in "xxxx", there are no targets in those directories that only install icons, or do I miss something?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-buildsystem mailing list