summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-05-29 13:23:22 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-05-29 13:23:22 +0200
commitb444aa3839cfe9a4ccb14e5740c4ea7b865c8b61 (patch)
treefb52d6b28cb956377c45292bce85de0704331873
parent169e26a2971429fa3bea866fa179ea4cf06598bc (diff)
downloadmakefile-b444aa3839cfe9a4ccb14e5740c4ea7b865c8b61.tar.gz
makefile-b444aa3839cfe9a4ccb14e5740c4ea7b865c8b61.tar.bz2
Modify PKG_CONFIG_PATH only when needed
-rw-r--r--cmake/CompizFusion.cmake18
1 files changed, 11 insertions, 7 deletions
diff --git a/cmake/CompizFusion.cmake b/cmake/CompizFusion.cmake
index d132f91..42c0a4c 100644
--- a/cmake/CompizFusion.cmake
+++ b/cmake/CompizFusion.cmake
@@ -75,13 +75,17 @@ endif (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MI
set (CMAKE_SKIP_RPATH On)
-# add install prefix to pkgconfig search path
-if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
- set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
-else ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
- set (ENV{PKG_CONFIG_PATH}
- "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
-endif ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
+set (PKGCONFIG_REGEX ".*${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig.*")
+
+# add install prefix to pkgconfig search path if needed
+if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
+ if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
+ set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
+ else ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
+ set (ENV{PKG_CONFIG_PATH}
+ "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
+ endif ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
+endif (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
include (FindPkgConfig)