[CMake] Trying to set up a "superbuild" with external project and install it...

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Wed May 11 15:21:01 EDT 2011


Hi Alexander,

Assuming the subproject are CMakeified:

  1) Set the INSTALL command of each External project to an empty string
  2 ) In yout CPack file, you could use a syntax similar to the one reported
below:


if(EXISTS "${VTK_DIR}/CMakeCache.txt")
  set(CPACK_INSTALL_CMAKE_PROJECTS
"${CPACK_INSTALL_CMAKE_PROJECTS};${VTK_DIR};VTK;RuntimeLibraries;/")
endif()

if(EXISTS "${ITK_DIR}/CMakeCache.txt")
  set(CPACK_INSTALL_CMAKE_PROJECTS
"${CPACK_INSTALL_CMAKE_PROJECTS};${ITK_DIR};ITK;RuntimeLibraries;/")
endif()



For more details:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/SlicerCPack.cmake?revision=16507&view=markup

Hth
Jc

On Wed, May 11, 2011 at 3:07 PM, Alexander Neundorf <a.neundorf-work at gmx.net
> wrote:

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



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110511/10b1de65/attachment.htm>


More information about the CMake mailing list