MantisBT - CMake
View Issue Details
0014955CMakeCMakepublic2014-06-04 16:072016-06-10 14:31
mwoehlke 
Kitware Robot 
normalfeatureN/A
closedmoved 
 
 
0014955: Support install of external projects, with component-like selection
While considering ways to make a useful 'install' target for a superbuild-like project (Slicer), JC and I decided it would be nice if CMake had a mechanism similar to CPACK_INSTALL_CMAKE_PROJECTS.

We propose CMAKE_INSTALL_CMAKE_PROJECTS, a list of sets of three values: build directory, project name, install prefix. If set, when the install script is generated, it would include the install script of each such project (i.e. "include(<build_dir>/cmake_install.cmake)") after first modifying the install prefix as specified. (An empty or relative prefix would be relative to the parent install prefix.) A system for selecting project(s) to install, similar to selecting component(s) to install, would be provided.

We could then modify external project support (e.g. this would probably happen first in Artichoke) to have a command like:

  ExternalProject_Install(<name> [DESTINATION <path>] [CPACK_COMPONENT <component>])

...which would set both CMAKE_INSTALL_CMAKE_PROJECTS and, if a CPACK_COMPONENT is specified, CPACK_INSTALL_CMAKE_PROJECTS.
No tags attached.
Issue History
2014-06-04 16:07mwoehlkeNew Issue
2014-06-04 16:19Brad KingStatusnew => backlog
2014-06-04 17:32Jean-Christophe Fillion-RobinNote Added: 0036118
2014-06-04 18:08mwoehlkeNote Added: 0036120
2016-06-10 14:29Kitware RobotNote Added: 0042558
2016-06-10 14:29Kitware RobotStatusbacklog => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0036118)
Jean-Christophe Fillion-Robin   
2014-06-04 17:32   
Few clarifications:

* The signature of "ExternalProject_Install" could be changed to accept "COMPONENT" instead of "CPACK_COMPONENT". That would be consistent with the existing "install()" command

* The function "ExternalProject_Install" would set a variable named "EP_INSTALL_CMAKE_PROJECTS" that would be used to configure the main sub project using:
   -DCMAKE_INSTALL_CMAKE_PROJECTS:STRING=${EP_INSTALL_CMAKE_PROJECTS}

* Support for "make install" in the top level project would then done by "forwarding" and executing the install target in the main subproject.
(0036120)
mwoehlke   
2014-06-04 18:08   
> The signature of "ExternalProject_Install" could be changed to accept "COMPONENT" instead of "CPACK_COMPONENT.

For clarification, my original reasoning was to make it clear that this is only relevant to CPACK.

Another possibility is if the subproject install overrides the install component of the subproject, which may or may not be desirable.... further discussion may be needed.

> The function "ExternalProject_Install" would set a variable named "EP_INSTALL_CMAKE_PROJECTS" that would be used to configure the main sub project using '-DCMAKE_INSTALL_CMAKE_PROJECTS:STRING=${EP_INSTALL_CMAKE_PROJECTS}'

I wouldn't do this (directly), as it forces a particular workflow (inner project produces the package). I would instead have ExternalProject_Install set CMAKE_INSTALL_CMAKE_PROJECTS, and have e.g. ExternalProject_Add_Main that would forward as described and then unset CMAKE_INSTALL_CMAKE_PROJECTS. This could also do other useful things, e.g. set up the install forward target.
(0042558)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.