[CMake] RPM packages and install(SCRIPT...)

Judicaël Bedouet j.bedouet at infonie.fr
Thu May 5 11:48:54 EDT 2011


Hi,

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...) ? Is there a
better way to create links between files ?

Thanks,

J. Bedouet

P.S. My little test below


mkdir build
/opt/cmake-2.8.4/bin/cmake -D CMAKE_INSTALL_PREFIX=../install ..
make install

ls -l ../install/share/TestLink/
total 4
-rw-r--r-- 1 xxxxxxxx xxxx 16 May  5 17:18 file
lrwxrwxrwx 1 xxxxxxxx xxxx  4 May  5 17:31 link -> file

cpack -G RPM

rpm -qlp TestLink-0.1.1-Linux.rpm
/usr/share/TestLink/file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110505/27a73deb/attachment.htm>
-------------- next part --------------
cmake_minimum_required(VERSION 2.6)

project(TestLink)

install(FILES file DESTINATION share/TestLink)
install(SCRIPT script)

include(CPack)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file
Type: application/octet-stream
Size: 15 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110505/27a73deb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: script
Type: application/octet-stream
Size: 151 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110505/27a73deb/attachment-0001.obj>


More information about the CMake mailing list