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

CMakeList.txt environment cleanup inaccurate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Build System
    • Labels:
      None
    • Environment:

      all ...

    • Development:

      Description

      On line 38+ of CMakeList.txt we have:

      # Before setting ROOTSYS, make sure that the environment isn't polluted by a different
      # ROOT build. This is significant e,g. for roottest, which will otherwise have libraries
      # of a different ROOT build available / visible / reachable.
      if(NOT $ENV{ROOTSYS} STREQUAL "")
        string(REPLACE "$ENV{ROOTSYS}/bin" "" ENV_PATH "$ENV{PATH}")
        string(REPLACE "$ENV{ROOTSYS}/lib" "" ENV_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}")
        string(REPLACE "$ENV{ROOTSYS}/lib" "" ENV_PYTHONPATH "$ENV{PYTHONPATH}")
        string(REPLACE "$ENV{ROOTSYS}" "" ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
        set(ENV{PATH} "${ENV_PATH}")
        set(ENV{LD_LIBRARY_PATH} "${ENV_LD_LIBRARY_PATH}")
        set(ENV{PYTHONPATH} "${ENV_PYTHONPATH}")
        set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}")
        set(ENV{"ROOTSYS"} ${CMAKE_BINARY_DIR})
      endif()
      

      If LD_LIBRARY_PATH contains anything 'prefixed' by $ENV

      {ROOTSYS}

      /lib it gets only partially replaced. Notably when we have (to allow use of builtin xrootd):

      ...:${ROOTSYS}/lib:${ROOTSYS}/lib64:...
      

      we end up with:

      ...::64:...
      

      which beside being odd make it harder to work around ROOT-10535

        Attachments

          Activity

            People

            Assignee:
            oshadura Oksana Shadura
            Reporter:
            pcanal Philippe Canal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: