1
From: Rolf Eike Beer <eike@sf-mail.de>
2
Date: Fri, 13 Apr 2012 08:50:49 +0200
3
Subject: FindPkgConfig.cmake: fix documented output variable not set
4
Origin: backport, commit:3ea850a5023060b84dcc0e6f0098c32c28b15807
5
Bug: http://public.kitware.com/Bug/view.php?id=13125
6
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=669627
7
Applied-Upstream: 2.8.9
9
The real fix is from Yury G. Kudryashov while I added the surrounding cleanups.
10
An additional hint to really get this fixed came from Rex Dieter.
12
--- a/Modules/FindPkgConfig.cmake
13
+++ b/Modules/FindPkgConfig.cmake
15
# When the 'QUIET' argument is set, no status messages will be printed.
17
# It sets the following variables:
18
-# PKG_CONFIG_FOUND ... true if pkg-config works on the system
19
+# PKG_CONFIG_FOUND ... if pkg-config executable was found
20
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
21
# PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
23
-# PKG_CONFIG_FOUND ... if pkg-config executable was found
25
# For the following variables two sets of values exist; first one is the
26
# common one and has the given PREFIX. The second set contains flags
27
@@ -104,6 +103,11 @@ find_package_handle_standard_args(PkgCon
28
REQUIRED_VARS PKG_CONFIG_EXECUTABLE
29
VERSION_VAR PKG_CONFIG_VERSION_STRING)
31
+# This is needed because the module name is "PkgConfig" but the name of
32
+# this variable has always been PKG_CONFIG_FOUND so this isn't automatically
34
+set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}")
36
# Unsets the given variables
37
macro(_pkgconfig_unset var)
38
set(${var} "" CACHE INTERNAL "")
39
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
40
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
41
@@ -71,7 +71,7 @@ endmacro(check_version_string)
44
foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL
45
- JASPER LIBXML2 LIBXSLT PERL PostgreSQL TIFF ZLIB)
46
+ JASPER LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB)
47
check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
50
@@ -82,4 +82,3 @@ endforeach(VTEST)
52
check_version_string(PYTHONINTERP PYTHON_VERSION_STRING)
53
check_version_string(SUBVERSION Subversion_VERSION_SVN)
54
-check_version_string(PKGCONFIG PKG_CONFIG_VERSION_STRING)