Bug 812188 - FindPkgConfig.cmake not setting PKG_CONFIG_FOUND
Summary: FindPkgConfig.cmake not setting PKG_CONFIG_FOUND
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: rawhide
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL: http://public.kitware.com/Bug/view.ph...
Depends On:
TreeView+ depends on / blocked
Reported: 2012-04-13 02:33 UTC by Rich Mattes
Modified: 2012-04-15 01:44 UTC (History)
5 users (show)

Fixed In Version: cmake-2.8.8-0.4.rc2.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-04-14 22:09:45 UTC
Type: Bug

Attachments (Terms of Use)

Description Rich Mattes 2012-04-13 02:33:17 UTC
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-13 03:22:03 UTC
Filed upstream.

Comment 2 Orion Poplawski 2012-04-14 03:54:39 UTC
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 20:44:02 UTC
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 21:26:55 UTC
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 21:43:15 UTC
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 22:09:45 UTC
Build cmake-2.8.8-0.4.rc2.fc18 , and confirmed good (for me)

Comment 7 Orion Poplawski 2012-04-14 23:26:33 UTC
(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-15 01:41:03 UTC
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-15 01:44:31 UTC

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