<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Sep 19, 2008 at 9:15 PM, Tanguy Krotoff <span dir="ltr"><<a href="mailto:tkrotoff@gmail.com">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;">
Hi everybody<br>
<br>
I would like to change the directory layout generated by CPack given<br>
the generator used.<br>
In a way, I would like a more fine-grained control about what CPack<br>
generates and after reading the different docs I don't know if it is<br>
possible.<br>
<br>
I have a pretty complex multiplatform program with plugins, internal<br>
libraries... here are the different layouts I would like to achieve:</blockquote><div>FIrst of all, there are a couple of discussions about using CPACK_SET_DESTDIR, install prefixes and co in this list which are about same problems: directory layout depends on generator used.<br>
Next, cmake_install files (which contain install rules) are generated at cmake time and it may be possible to code some variables there, which then can be passed through cpack. <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>
/app.exe<br>
/internal_lib1.dll<br>
/internal_lib2.dll<br>
/plugins/plugin1.dll<br>
/plugins/plugin2.dll<br>
<br>
** DEB / RPM:<br>
/usr/bin/app<br>
/usr/lib/app/internal_lib1.so<br>
/usr/lib/app/internal_lib2.so<br>
/usr/lib/app/plugins/plugin1.so<br>
/usr/lib/app/plugins/plugin2.so<br>
<br>
** TGZ / ZIP (same as NSIS):<br>
/app<br>
/app.sh (does a export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./app)<br>
/internal_lib1.so<br>
/internal_lib2.so<br>
/plugins/plugin1.so<br>
/plugins/plugin2.so<br>
<br>
** If no generator is used, make install should give the same layout<br>
as with NSIS / TGZ / NSIS<br>
This way I just have to go to my build directory and run app.sh or<br>
app.exe directly:<br>
this simplifies the compile/test procedure since there is no need for<br>
the install step (i.e compile/install/test).<br>
<br>
<br>
So I have this code in my root CMakeLists.txt:<br>
<br>
if (LINUX)<br>
set(INSTALL_TARGETS_DEFAULT_ARGS<br>
RUNTIME DESTINATION bin<br>
LIBRARY DESTINATION lib/myapp<br>
)<br>
set(INSTALL_PLUGINS_DEFAULT_ARGS<br>
RUNTIME DESTINATION bin<br>
LIBRARY DESTINATION lib/myapp/plugins<br>
)<br>
endif<br>
<br>
if (WIN32)<br>
set(INSTALL_TARGETS_DEFAULT_ARGS<br>
RUNTIME DESTINATION .<br>
LIBRARY DESTINATION .<br>
)<br>
set(INSTALL_PLUGINS_DEFAULT_ARGS<br>
RUNTIME DESTINATION .<br>
LIBRARY DESTINATION .<br>
)<br>
endif<br>
<br>
As you see it does not depend on the generator invoked but on the<br>
platform instead<br>
I you would to change it to something like this:<br>
<br>
if (CPACK_GENERATOR == "DEB,RPM")<br>
set(INSTALL_TARGETS_DEFAULT_ARGS<br>
RUNTIME DESTINATION bin<br>
LIBRARY DESTINATION lib/myapp<br>
)<br>
set(INSTALL_PLUGINS_DEFAULT_ARGS<br>
RUNTIME DESTINATION bin<br>
LIBRARY DESTINATION lib/myapp/plugins<br>
)<br>
endif<br>
<br>
if (CPACK_GENERATOR == "TGZ,ZIP,NSIS")<br>
set(INSTALL_TARGETS_DEFAULT_ARGS<br>
RUNTIME DESTINATION .<br>
LIBRARY DESTINATION .<br>
)<br>
set(INSTALL_PLUGINS_DEFAULT_ARGS<br>
RUNTIME DESTINATION .<br>
LIBRARY DESTINATION .<br>
)<br>
endif<br>
<br>
if (NOT CPACK_GENERATOR)<br>
set(INSTALL_TARGETS_DEFAULT_ARGS<br>
RUNTIME DESTINATION .<br>
LIBRARY DESTINATION .<br>
)<br>
set(INSTALL_PLUGINS_DEFAULT_ARGS<br>
RUNTIME DESTINATION .<br>
LIBRARY DESTINATION .<br>
)<br>
endif<br>
<br>
<br>
Do you know if this king of things are possible?<br>
<br>
Thanks in advance,<br>
<font color="#888888"><br>
--<br>
Tanguy Krotoff <<a href="mailto:tkrotoff@gmail.com">tkrotoff@gmail.com</a>><br>
+33 6 68 42 70 24<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</font></blockquote></div><br></div>