Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
D
dune-common
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 69
    • Issues 69
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 44
    • Merge Requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Core Modules
  • dune-common
  • Issues
  • #246

Closed
Open
Created Feb 08, 2021 by Santiago Ospina De Los Ríos@santiago.ospinaDeveloper

Use CMake components when installing

Description

While modernising my CMake, I realised that dune-common dumps all the installation files into the same bucket. While this is practical because one does not have to think what to install and what not, it is much cleaner to split installation in different components. This way, the user has much more control over the objects that get installed on its system or package. Doing this is simple: Adding a COMPONENT argument to every install CMake call.

Proposal

My proposal would be to have 4 components:

Component Description Example
Runtime Final scripts or binaries product of the module Executables from application modules
Development Header files and build system mandatory to continue downstream development Header files, cmake macros
Library Objects needed for both Development and Runtime usage in downstream modules libraries for UGGrid or libdunecommon
Documentation Documentation files man pages, Doxygen

In CMake, objects not assigned to any component are set to Unspecified (current behaviour). With the proposed setting, nothing should be in this bucket.

Usage

Assuming components are set, installation of files in a given component is as simple as:

# User doesn't want to develop, just to link a final application
cmake --install . --component Library

# User wants to develop a downstream module
cmake --install . --component Library --component Development

# User wants to use final binaries
cmake --install . --component Library --component Runtime

# User wants to use everything (current behaviour)
cmake --install .

Is this backwards compatible?

Yes! If no component is given on the command line (current usage), all components are installed. This means that the change is backwards compatible with any installation script out there.

What next?

Discussion... If there seems to be agreement/interest, I can push a MR.

Edited Feb 24, 2021 by Santiago Ospina De Los Ríos
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None