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 5
5
find_package (PkgConfig REQUIRED )
6
6
7
7
function (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
+
8
26
get_target_property (include_directories ${target} INTERFACE_INCLUDE_DIRECTORIES )
9
27
if (include_directories )
10
28
list (REMOVE_ITEM include_directories -isystem )
@@ -25,7 +43,6 @@ macro(cross_pkg_check_modules prefix)
25
43
pkg_check_modules (${prefix} ${ARGN} )
26
44
endif ()
27
45
28
- # A workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/20652.
29
46
if (CMAKE_VERSION VERSION_LESS 3.17.3 AND TARGET PkgConfig::${prefix} )
30
47
remove_isystem_from_include_directories_internal (PkgConfig::${prefix} )
31
48
endif ()
You can’t perform that action at this time.
0 commit comments