2011/5/5 Judicaël Bedouet <[email protected]>:
> Hi,
Hi Judicaël,
> I use install(SCRIPT...) to make links during installation. It works with a
> normal installation (make install) but the script seems not to be executed
> by CPack or CPack RPM (I have not tested other generators). I could solve
> the problem by making a specific RPM spec but the post-install code would be
> duplicated in two files.
>
> Is it intended that CPack doesn't execute install(SCRIPT...) ?
In fact it does but you did not see what happened.
Your install script:
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink file link
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/TestLink
)
does not support DESTDIR, which is used by CPack in order to install locally
(inside build/_CPack_Packages ... )
before packaging.
You should use:
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink file link
WORKING_DIRECTORY $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/TestLink
)
and this should work in both cases (make install and CPack run).
> Is there a better way to create links between files ?
>From a "pure" RPM perspective you should write an RPM post install script
and
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "your-script.sh")
now I understand you want to have a single script for all package format
so the INSTALL(SCRIPT ...) should work for all of them as soon as
symlinks are supported (which may not be the case on Windows).
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake