[cmake-developers] [CMake 0015903]: pkg_search_module no longer caches _PREFIX, _LIBDIR, _INCLUDEDIR

Mantis Bug Tracker mantis at public.kitware.com
Mon Jan 4 11:49:16 EST 2016


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15903 
====================================================================== 
Reported By:                Bernd Lörwald
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15903
Category:                   Modules
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-01-04 17:49 CET
Last Modified:              2016-01-04 17:49 CET
====================================================================== 
Summary:                    pkg_search_module no longer caches _PREFIX, _LIBDIR,
_INCLUDEDIR
Description: 
Beginning with
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70e8db6e20749a484dd677d7094780c5f4b451c6,
the pkgconfig module no longer caches the _PREFIX, _LIBDIR, _INCLUDEDIR
variables. This was introduced by using pkg_get_variable which sets for
PARENT_SCOPE but not CACHE as _pkgconfig_set did previously. Instead, a helper
variable is cached.

Steps to Reproduce: 
$ cat > CMakeLists.txt 
cmake_minimum_required (VERSION 3.3)
find_package (PkgConfig)
pkg_search_module (PREFIX REQUIRED gl)
if (NOT PREFIX_PREFIX)
  message (FATAL_ERROR "BUMMER")
endif()
^D

$ cmake-3.4.1 .
-- […snip]
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- Checking for one of the modules 'gl'
-- Configuring done
-- Generating done
-- Build files have been written to: […snip]
$ cmake-3.4.1 .
CMake Error at CMakeLists.txt:5 (message):
  BUMMER
$ grep -E "prefix_result|PREFIX_PREFIX" CMakeCache.txt 
PREFIX_PREFIX:INTERNAL=
prefix_result:INTERNAL=/usr/lib64

$ cmake-3.3.2 .
-- […snip]
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- checking for one of the modules 'gl'
-- Configuring done
-- Generating done
-- Build files have been written to: […snip]
$ cmake-3.3.2 .
-- Configuring done
-- Generating done
-- Build files have been written to: […snip]
$ grep -E "prefix_result|PREFIX_PREFIX" CMakeCache.txt 
PREFIX_PREFIX:INTERNAL=/usr

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-01-04 17:49 Bernd Lörwald  New Issue                                    
======================================================================



More information about the cmake-developers mailing list