Hi Eric,<br><br>&gt; You should use:<br>&gt; execute_process(<br>&gt;  COMMAND ${CMAKE_COMMAND} -E create_symlink file link<br>&gt;  WORKING_DIRECTORY $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/TestLink<br>&gt;  )<br><br>Thanks, it works fine.<br>
<br>&gt; so the INSTALL(SCRIPT ...) should work for all of them as soon as symlinks are supported (which may not be the case on Windows).<br><br>Indeed, I have read a lot of CMake posts about create_symlink under Windows, but for the moment, our software is only installed under Linux, so it should be sufficient but I would better put a warning in the script...<br>
<br>Thanks,<br><br>J. Bedouet<br><br><br><br><div class="gmail_quote">2011/5/5 Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/5/5 Judicaël Bedouet &lt;<a href="mailto:j.bedouet@infonie.fr">j.bedouet@infonie.fr</a>&gt;:<br>
&gt; Hi,<br>
<br>
Hi Judicaël,<br>
<div class="im"><br>
&gt; I use install(SCRIPT...) to make links during installation. It works with a<br>
&gt; normal installation (make install) but the script seems not to be executed<br>
&gt; by CPack or CPack RPM (I have not tested other generators). I could solve<br>
&gt; the problem by making a specific RPM spec but the post-install code would be<br>
&gt; duplicated in two files.<br>
&gt;<br>
&gt; Is it intended that CPack doesn&#39;t execute install(SCRIPT...) ?<br>
<br>
</div>In fact it does but you did not see what happened.<br>
Your install script:<br>
<br>
execute_process(<br>
  COMMAND ${CMAKE_COMMAND} -E create_symlink file link<br>
  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/TestLink<br>
  )<br>
<br>
does not support DESTDIR, which is used by CPack in order to install locally<br>
(inside build/_CPack_Packages ... )<br>
before packaging.<br>
<br>
You should use:<br>
execute_process(<br>
  COMMAND ${CMAKE_COMMAND} -E create_symlink file link<br>
  WORKING_DIRECTORY $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/TestLink<br>
  )<br>
<br>
and this should work in both cases (make install and CPack run).<br>
<div class="im"><br>
&gt; Is there a better way to create links between files ?<br>
<br>
</div>From a &quot;pure&quot; RPM perspective you should write an RPM post install script<br>
and<br>
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE &quot;your-script.sh&quot;)<br>
now I understand you want to have a single script for all package format<br>
so the INSTALL(SCRIPT ...) should work for all of them as soon as<br>
symlinks are supported (which may not be the case on Windows).<br>
<font color="#888888"><br>
<br>
--<br>
Erk<br>
Membre de l&#39;April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
<br>
</font></blockquote></div><br>