summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2019-03-14 10:57:48 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2019-03-14 10:57:48 +0000
commit82e0847936be83eeb74d41ff58faf008e7aaf0b3 (patch)
tree3ce63c9c376ea5eb568dd111ee3f9d90459f1e13
parent09b969e6ac4048a59ecfbe65a1b4b5485ada3859 (diff)
parent3525cc045d4c683dfc6048f5be795cc372c323a3 (diff)
downloaddbus-82e0847936be83eeb74d41ff58faf008e7aaf0b3.tar.gz
Merge branch 'cal-fix-cmake-pkgconfig' into 'master'
cmake: Avoid overwriting PKG_CONFIG_PATH env var See merge request dbus/dbus!96 Reviewed-by: @rhabacker
-rw-r--r--cmake/DBus1Config.pkgconfig.in27
1 files changed, 27 insertions, 0 deletions
diff --git a/cmake/DBus1Config.pkgconfig.in b/cmake/DBus1Config.pkgconfig.in
index 7e090aa5..8c0a25e4 100644
--- a/cmake/DBus1Config.pkgconfig.in
+++ b/cmake/DBus1Config.pkgconfig.in
@@ -10,12 +10,39 @@
get_filename_component(DBus1_PKGCONFIG_DIR "${CMAKE_CURRENT_LIST_DIR}/../../pkgconfig" ABSOLUTE)
find_package(PkgConfig)
+if(DEFINED ENV{PKG_CONFIG_DIR})
+ set(_dbus_pkgconfig_dir "$ENV{PKG_CONFIG_DIR}")
+endif()
+if(DEFINED ENV{PKG_CONFIG_PATH})
+ set(_dbus_pkgconfig_path "$ENV{PKG_CONFIG_PATH}")
+endif()
+if(DEFINED ENV{PKG_CONFIG_LIBDIR})
+ set(_dbus_pkgconfig_libdir "$ENV{PKG_CONFIG_LIBDIR}")
+endif()
set(ENV{PKG_CONFIG_DIR})
set(ENV{PKG_CONFIG_PATH} ${DBus1_PKGCONFIG_DIR})
set(ENV{PKG_CONFIG_LIBDIR} ${DBus1_PKGCONFIG_DIR})
# for debugging
#set(ENV{PKG_CONFIG_DEBUG_SPEW} 1)
pkg_check_modules(PC_DBUS1 QUIET dbus-1)
+if(DEFINED _dbus_pkgconfig_dir)
+ set(ENV{PKG_CONFIG_DIR} "${_dbus_pkgconfig_dir}")
+else()
+ unset(ENV{PKG_CONFIG_DIR})
+endif()
+if(DEFINED _dbus_pkgconfig_path)
+ set(ENV{PKG_CONFIG_PATH} "${_dbus_pkgconfig_path}")
+else()
+ unset(ENV{PKG_CONFIG_PATH})
+endif()
+if(DEFINED _dbus_pkgconfig_libdir)
+ set(ENV{PKG_CONFIG_LIBDIR} "${_dbus_pkgconfig_libdir}")
+else()
+ unset(ENV{PKG_CONFIG_LIBDIR})
+endif()
+unset(_dbus_pkgconfig_dir)
+unset(_dbus_pkgconfig_path)
+unset(_dbus_pkgconfig_libdir)
set(DBus1_DEFINITIONS ${PC_DBUS1_CFLAGS_OTHER})
# find the real stuff and use pkgconfig variables as hints