The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15795 
====================================================================== 
Reported By:                Sam Thursfield
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15795
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-10-16 10:41 EDT
Last Modified:              2015-10-16 10:41 EDT
====================================================================== 
Summary:                    pkg_check_modules produces incorrect results
depending on contents of CMakeCache.txt
Description: 
I got bitten by a bug involving pkg_check_modules.

If I run cmake, then edit my CMakeLists.txt to change the parameters passed to
pkg_check_modules, and rerun cmake, it ignores the change that I made to
CMakeLists.txt. I needed to delete the CMakeCache.txt file to get the right
results.

This seems like a cache invalidation bug to me -- a change in the parameters
passed to to pkg_check_modules() should cause the cached values to be
invalidated.

I've attached a small script that reproduces the issue.

Steps to Reproduce: 
Use attached script. It uses the 'avahi' library as an example, so needs the
avahi-devel or libavahi-dev package (or whatever else your distro calls it) to
be installed. Any two pkg-config modules will trigger the same error.

Output on my machine:

Creating initial CMakeLists.txt
Avahi libs should be: avahi-gobject
AVAHI LIBS: avahi-gobject;avahi-common;avahi-client;avahi-glib;glib-2.0

Updating pkg_check_modules call
Avahi libs should be:
avahi-gobject;avahi-common;avahi-client;avahi-glib;glib-2.0
AVAHI LIBS: avahi-gobject;avahi-common;avahi-client;avahi-glib;glib-2.0

Removing cache and trying again
Avahi libs should be:
avahi-gobject;avahi-common;avahi-client;avahi-glib;glib-2.0
AVAHI LIBS: avahi-gobject;avahi-common;avahi-client;avahi-glib;glib-2.0

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-10-16 10:41 Sam Thursfield New Issue                                    
2015-10-16 10:41 Sam Thursfield File Added: testcase.sh                      
======================================================================

-- 

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

Reply via email to