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 ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers