Hi Alexander, <br><br>Assuming the subproject are CMakeified:<br><br>  1) Set the INSTALL command of each External project to an empty string<br>  2 ) In yout CPack file, you could use a syntax similar to the one reported below:<br>

<font size="1"><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if(EXISTS &quot;${VTK_DIR}/CMakeCache.txt&quot;)</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">  set(CPACK_INSTALL_CMAKE_PROJECTS &quot;${CPACK_INSTALL_CMAKE_PROJECTS};${VTK_DIR};VTK;RuntimeLibraries;/&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">endif()</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if(EXISTS &quot;${ITK_DIR}/CMakeCache.txt&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  set(CPACK_INSTALL_CMAKE_PROJECTS &quot;${CPACK_INSTALL_CMAKE_PROJECTS};${ITK_DIR};ITK;RuntimeLibraries;/&quot;)</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">endif()<br><br><br></span></font><br><div class="gmail_quote">For more details: <a href="http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/SlicerCPack.cmake?revision=16507&amp;view=markup">http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/SlicerCPack.cmake?revision=16507&amp;view=markup</a><br>

<br>Hth<br>Jc<br><br>On Wed, May 11, 2011 at 3:07 PM, Alexander Neundorf <span dir="ltr">&lt;<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi,<br>
<br>
I&#39;d like to set up a kind of meta super project, which builds a bunch of<br>
subprojects, which contains executable and shared libraries.<br>
These subprojects come from different repositories, mostly git repositories.<br>
<br>
AFAIK I can basically do this using the ExternalProject_add() feature of<br>
cmake, it will get the sources, configure and build them.<br>
<br>
So far so good.<br>
<br>
<br>
Now, what do I do with installing ?<br>
Usually the external projects are installed at the end of their build step at<br>
make-time, and usually somewhere in the build tree.<br>
<br>
But finally I&#39;d like to have these projects installed into a proper system-<br>
wide directory.<br>
<br>
If I simply do install(DIRECTORY ... ) in the &quot;superproject&quot;, stuff which<br>
depends on CMAKE_INSTALL_PREFIX, like e.g. RPATH will be wrong after the final<br>
install step (since the RPATHs will still point to the install locations in<br>
the build tree).<br>
<br>
If I put the final install location as install location in the<br>
ExternalProject_Add() call, I will have to build with permissions to install<br>
into the final install directory, which is generally not the case. E.g. to<br>
install in /opt/ I would basically have to build as root (or change the<br>
permissions of /opt/, but that&#39;s not possible on a standard system).<br>
<br>
I could maybe also setuid cmake root (ugly too).<br>
<br>
Always set a relative RPATH always using $ORIGIN ?<br>
(but this will be kind of hard to enforce)<br>
<br>
Any other ideas ?<br>
Am I missing something ?<br>
Any ideas how support for this could be added in a clean way ?<br>
<br>
Alex<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br><br>