Skip to content
  • Roman Gilg's avatar
    Ignore system standard path when prepending environment variables · 9d977859
    Roman Gilg authored
    Summary:
    Ignore /usr as prefix or kdedir when prepending environment variables to not
    overrule user setting of PKG_CONFIG_PATH.
    
    For me it was enough to fix my build with prepending CMAKE_PREFIX_PATH
    conditionally, but in theory the other environment variables should also only
    be prepended if it is not /usr to prepend.
    
    Test Plan:
    Compiled XCB 1.13 to /opt/xcb and have XCB 1.11 in /usr/.... Set
    PKG_CONFIG_PATH to /opt/xcb/lib/pkgconfig.
    
    Without this patch CMake, called by kdesrc-build, finds XCB 1.11 in
    /usr/lib/x86_64-linux-gnu according to its log, but sets as version number
    1.13 for some reason.
    
    On make this fails. It still uses the lib from /opt/xcb> but does not include
    the correct headers in opt/xcb/include.
    
    With the patch CMake directly finds the lib in /opt/xcb and build succeeds.
    
    Reviewers: bshah, mpyne
    
    Reviewed By: mpyne
    
    Subscribers:
    
    Tags:
    
    Differential Revision: https://phabricator.kde.org/D12739
    9d977859