Bug 812188 - FindPkgConfig.cmake not setting PKG_CONFIG_FOUND
FindPkgConfig.cmake not setting PKG_CONFIG_FOUND
Product: Fedora
Classification: Fedora
Component: cmake (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Orion Poplawski
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-04-12 22:33 EDT by Rich Mattes
Modified: 2012-04-14 21:44 EDT (History)
5 users (show)

See Also:
Fixed In Version: cmake-2.8.8-0.4.rc2.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-14 18:09:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rich Mattes 2012-04-12 22:33:17 EDT
Description of problem:
A few of my packages use pkg-config from within CMake to resolve build dependencies, using the FindPkgConfig.cmake module shipped with CMake.  According to the comments in rawhide's FindPkgConfig.cmake:

# It sets the following variables:
#   PKG_CONFIG_FOUND          ... true if pkg-config works on the system
#   PKG_CONFIG_EXECUTABLE     ... pathname of the pkg-config program
#   PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
#                                 (since CMake 2.8.8)
#   PKG_CONFIG_FOUND          ... if pkg-config executable was found

Most of my packages check for PKG_CONFIG_FOUND before trying to use pkg-config, and the fact that this module is no longer setting that variable means that CMake isn't picking up on all of the available dependencies.  The result is FTBFS errors and missing program features on builds that do succeed.

Version-Release number of selected component (if applicable):

How reproducible:

The following simple CMakeLists.txt can be used to recreate the problem:

======begin CMakeLists.txt======
cmake_minimum_required(VERSION 2.8)


	message(STATUS "PkgConfig Found.")
	message(STATUS "PkgConfig Not Found.")

message(STATUS "PkgConfig Executable: ${PKG_CONFIG_EXECUTABLE}")
======end CMakeLists.txt======

cmake-2.8.8-0.2.rc2.fc18.x86_64 in rawhide (f18) produces the following output:
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.25") 
-- PkgConfig Not Found.
-- PkgConfig Executable: /usr/bin/pkg-config

cmake-2.8.7-4.fc17.x86_64 in f17 produces:
-- PkgConfig Found.
-- PkgConfig Executable: /usr/bin/pkg-config

cmake-2.8.7-4.fc16.x86_64 in f16 produces:
-- PkgConfig Found.
-- PkgConfig Executable: /usr/bin/pkg-config
Comment 1 Orion Poplawski 2012-04-12 23:22:03 EDT
Filed upstream.
Comment 2 Orion Poplawski 2012-04-13 23:54:39 EDT
Building cmake-2.8.8-0.3.rc2.fc18 in rawhide now, which should fix this issue.  Please test when available and note the result here.
Comment 3 Rex Dieter 2012-04-14 16:44:02 EDT
Seems still not fixed.  I'm seeing failures building telepathy-qt4 too.

put in some diagostic into the cmake module,


and it prints:

Comment 4 Rex Dieter 2012-04-14 17:26:55 EDT
OK, found the problem

from FindPackageHandleStandardArgs.cmake:
# It also sets the <UPPERCASED_NAME>_FOUND variable.

notice the *UPPERCASED* part, so
set(PKG_CONFIG_FOUND "${PkgConfig_FOUND}")
does not work, but

I'll adjust our local patch accordingly, and poke upstream.
Comment 5 Rex Dieter 2012-04-14 17:43:15 EDT
OK, I guess I'm silly today, can't figure out how to add a comment to the upstream report... Orion, mind helping me out there (or give me a clue how to do it)?
Comment 6 Rex Dieter 2012-04-14 18:09:45 EDT
Build cmake-2.8.8-0.4.rc2.fc18 , and confirmed good (for me)
Comment 7 Orion Poplawski 2012-04-14 19:26:33 EDT
(In reply to comment #5)
> OK, I guess I'm silly today, can't figure out how to add a comment to the
> upstream report... Orion, mind helping me out there (or give me a clue how to
> do it)?

I think you need to reopen it first.  Thanks for fixing this.
Comment 8 Rex Dieter 2012-04-14 21:41:03 EDT
I can't see any way for me to reopen it either, I guess I can just file a new one
Comment 9 Rex Dieter 2012-04-14 21:44:31 EDT

Note You need to log in before you can comment on or make changes to this bug.