summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPkgConfig.cmake14
1 files changed, 13 insertions, 1 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 02f7fb4..4d29f45 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -425,13 +425,19 @@ macro(_pkg_set_path_internal)
unset(_pkgconfig_path)
endif()
- # Tell pkg-config not to strip any -L paths so we can search them all.
+ # Tell pkg-config not to strip any -I or -L paths so we can search them all.
if(DEFINED ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS})
set(_pkgconfig_allow_system_libs_old "$ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}")
else()
unset(_pkgconfig_allow_system_libs_old)
endif()
set(ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS} 1)
+ if(DEFINED ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS})
+ set(_pkgconfig_allow_system_cflags_old "$ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS}")
+ else()
+ unset(_pkgconfig_allow_system_cflags_old)
+ endif()
+ set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} 1)
endmacro()
macro(_pkg_restore_path_internal)
@@ -445,6 +451,12 @@ macro(_pkg_restore_path_internal)
else()
unset(ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS})
endif()
+ if(DEFINED _pkgconfig_allow_system_cflags_old)
+ set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} "${_pkgconfig_allow_system_cflags_old}")
+ unset(_pkgconfig_allow_system_cflags_old)
+ else()
+ unset(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS})
+ endif()
unset(_extra_paths)
unset(_pkgconfig_path_old)