Skip to content
Snippets Groups Projects

Change how optional dependencies are handled in downstream projects

Merged Marco Clemencic requested to merge clemenci/Gaudi:split-pub-priv-deps into master

The rationale of the original implementation of GaudiDependencies.cmake was that an optional dependency enabled at build time becomes a required dependency when Gaudi is used in downstream projects.

In CMake optional usually means that not finding the dependency is not a problem and we can build anyway, while for Gaudi we decided that optional means that the dependency can be turned off (but if it is on and we do not find it is a fatal error).

The original approach is not always correct as we have

  • required dependencies (like ROOT or Boost)
  • optional dependencies that are required downstream if enabled (AIDA)
  • optional dependencies that are not required downstream (IntelAmplifier, gpertools, ...)
  • optional build time dependencies (CppUnit, Doxygen)

(I ignore required build time dependencies as I do not have any in Gaudi)

As we are using CMake FeatureSummary a better logic is to consider REQUIRED everything we look for at build time (given that when we turn off a dependency we do not look for it), but ignore some dependencies in downstream projects (like CppUnit and Doxygen), while demoting others to RECOMMENDED (like IntelAmplifier and gperftools). Like this, we still do the lookup downstream for runtime dependencies that we may decide not use when we run the application (like the profilers).

An even better approach would be to reorganize the dependencies in features and report about the enabled and disabled features, but I do not have the time for it at the moment.

Edited by Marco Clemencic

Merge request reports

Pipeline #2440081 passed

Pipeline passed for 0a7a46c5 on clemenci:split-pub-priv-deps

Approved by

Merged by Marco ClemencicMarco Clemencic 3 years ago (Apr 19, 2021 12:06pm UTC)

Merge details

  • Changes merged into master with 098bc7e2.
  • Deleted the source branch.

Pipeline #2509600 failed

Pipeline failed for 098bc7e2 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading