Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8444

Export cmake targets into own namespace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.08/00, 6.04/18, 6.06/08
    • Fix Version/s: 6.10/00
    • Component/s: Build System
    • Labels:
      None
    • Environment:

      Any system

      Description

      Dear ROOT team,

      we are developing an experiment-independent tracking software (called ACTS) which depends (at least in parts) on the ROOT framework. We are using cmake as build system and this works very nicely with the cmake configuration provided by ROOT. Our CMakeLists.txt files have a structure similar to the following (only relevant parts are shown as pseudo-code):

      find_package (ROOT 6.04.06 QUIET COMPONENTS Geom)
      add_library (ACTSTGeoPlugin SHARED ...)
      target_link_libraries (ACTSTGeoPlugin PUBLIC Geom)

      Unfortunately, the ROOT cmake targets are exported directly and not into a namespace. This can (and in our specific case does) lead to name clashes between cmake targets. Probably the most prominent candidate being 'Core' which is a quiet common name for cmake target in many projects, I believe. This leads to the slightly annoying fact that whenever we use the cmake configuration provided by ROOT, we have to make sure that our cmake target names to not collide with anything already defined by ROOT (which are quite a few).
      Therefore our question whether you have considered exporting the cmake targets into a separate namespace (probably ROOT: to avoid these conflicts?
      I believe this would be a trivial change at this line

      https://root.cern.ch/gitweb/?p=root.git;a=blob;f=cmake/modules/RootNewMacros.cmake;h=9726ed2830eee373354bdcaf8ea06ecc29846f9b;hb=HEAD#l463

      Thanks,
      Christian (for the ACTS team)

        Attachments

          Activity

            People

            Assignee:
            mato Pere Mato Vila
            Reporter:
            cgumpert Christian Gumpert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: