<div dir="ltr">I've hurried a bit when I was writing previous message.<br><br><div class="gmail_quote">On Sat, Sep 20, 2008 at 8:12 PM, Tanguy Krotoff <span dir="ltr"><<a href="mailto:tkrotoff@gmail.com" target="_blank">tkrotoff@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>> FIrst of all, there are a couple of discussions about using<br>
> CPACK_SET_DESTDIR, install prefixes and co in this list which are about same<br>
> problems: directory layout depends on generator used.<br>
<br>
</div>From what I've read, CPACK_SET_DESTDIR and<br>
CPACK_PACKAGING_INSTALL_PREFIX only deal with the install prefix.<br>
I've read this: <a href="http://www.mail-archive.com/cmake@cmake.org/msg11163.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg11163.html</a><br>
I think changing the install prefix is not enough for allowing this:</blockquote><div>Some part of discussion at the issue <a href="http://public.kitware.com/Bug/view.php?id=7000">http://public.kitware.com/Bug/view.php?id=7000</a> (see Brad's comments).<br>
Now you can still play with prefixes and set them or not during cpack run, for example for ZIP/TAR generator set this prefix to empty, while when using rpm/deb, set it to /usr.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
** NSIS:<br>
/myapp.exe<br>
/internal_lib1.dll<br>
/plugins/plugin1.dll<br>
---> No install prefix<br>
<br>
** DEB / RPM:<br>
/usr/Bin/myapp<br>
/usr/Lib/app/internal_lib1.so<br>
/usr/Lib/app/plugins/plugin1.so<br>
---> install prefix is /usr/bin and also /usr/lib/app for internal stuffs<br>
<div><br>
> Next, cmake_install files (which contain install rules) are generated at<br>
> cmake time and it may be possible to code some variables there, which then<br>
> can be passed through cpack.<br>
<br>
</div>I've checked the cmake_install.cmake files and I'm a bit lost, is<br>
there some examples/doc about how to modify them?</blockquote><div>I suppose it is possible to write install rules in the way they will contain placeholders for variables, somehow like this:<br>install(TARGETS myapp DESTINATION "\${MYPACKPREFIX}/bin")<br>
(note dollar sign escaping) which should result in<br>file(INSTALL <somethings> DESTINATION "${MYPACKPREFIX}/bin")<br>in cmake_install.cmake file.<br>When running cpack, define this variable (with -D, for example). CPack simply reads cmake_install.cmake files, so every variables expansions should take place. The main obstracle can be, if cmake will escape dollar signs when processing install statements of your CMakeLists.txt file.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
<br>
Also is it possible to know the list of files to be installed by CPack<br>
and modify this list?<br>
In this case it would be simple to a something like this:<br>
<br>
foreach (filepath, CPACK_LIST_OF_FILES_TO_BE_INSTALLED)<br>
if (CPACK_GENERATOR == "DEB" OR "RPM")<br>
if (filepath CONTAINS "plugins")<br>
file(REPLACE filepath "plugins" "/usr/lib/app/plugins")<br>
list(APPEND new_list_of_files_to_be_installed filepath)<br>
endif()<br>
elseif()<br>
#do nothing, keep the list of files as it is<br>
endif()<br>
endforeach()<br>
<br>
set(CPACK_LIST_OF_FILES_TO_BE_INSTALLED new_list_of_files_to_be_installed)<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div>Tanguy Krotoff <<a href="mailto:tkrotoff@gmail.com" target="_blank">tkrotoff@gmail.com</a>><br>
+33 6 68 42 70 24<br>
</div></div></blockquote></div><br></div>