File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 55find_package (PkgConfig REQUIRED)
66
77function (remove_isystem_from_include_directories_internal target )
8+   #[=[ 
9+   A workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/20652. 
10+ 
11+   When the pkg-config provides CFLAGS with -isystem options, for instance: 
12+ 
13+     $ pkg-config --cflags-only-I libzmq 
14+     -isystem /usr/include/mit-krb5 -I/usr/include/pgm-5.3 -I/usr/include/libxml2 
15+ 
16+   an old CMake fails to parse them properly and the INTERFACE_INCLUDE_DIRECTORIES 
17+   property contains "-isystem" as a separated element: 
18+ 
19+     -isystem;/usr/include/mit-krb5;/usr/include/pgm-5.3;/usr/include/libxml2 
20+ 
21+   which ends with an error "Imported target includes non-existent path". 
22+ 
23+   Fixing by removing the "-isystem" element from the INTERFACE_INCLUDE_DIRECTORIES. 
24+   ]=] 
25+ 
826  get_target_property (include_directories  ${target}  INTERFACE_INCLUDE_DIRECTORIES )
927  if (include_directories )
1028    list (REMOVE_ITEM include_directories  -isystem)
@@ -25,7 +43,6 @@ macro(cross_pkg_check_modules prefix)
2543    pkg_check_modules(${prefix}  ${ARGN} )
2644  endif ()
2745
28-   # A workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/20652. 
2946  if (CMAKE_VERSION  VERSION_LESS  3.17.3 AND  TARGET  PkgConfig::${prefix} )
3047    remove_isystem_from_include_directories_internal(PkgConfig::${prefix} )
3148  endif ()
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments