Creating a symlink when installing

Brad King brad.king at kitware.com
Tue Mar 28 17:28:59 CEST 2006


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

That's because that page documents the latest official CMake release and
not the CVS version.  Try

   cmake --help-command INSTALL

> 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?

The INSTALL(SCRIPT ...) command will do what you need.

-Brad



More information about the Kde-buildsystem mailing list