[Piglit] [PATCH 2/9] cmake: If using Waffle, require waffle >= 1.3

Chad Versace chad.versace at linux.intel.com
Thu Jan 9 10:31:53 PST 2014


On Mon, Jan 06, 2014 at 11:41:26AM -0800, Ian Romanick wrote:
> On 12/30/2013 04:08 PM, Chad Versace wrote:
> > Subsequent patches will enable creation of forward-compatible and debug
> > contexts, which arrived in waffle-1.3.
> > 
> > After this patch, you may need to remove CMakeCache.txt and rerun CMake. The
> > problem is that CMake caches the results of pkg-config queries.  Alternatively,
> > you may manually update the value of CMakeCache.txt:WAFFLE_VERSION in any text
> > editor.
> 
> And this isn't what the previous patch fixes?

No, it doesn't. Welcome to CMake fun times ;)

When pkg_check_modules() finds a package, it sets an internal variable
in the CMake cache. Let's call it '__pkg_found_${pkg_name}' for this
discussion. Future calls to pkg_check_modules() on ${pkg_name}
will not run if '__pkg_found_${pkg_name}' exists in the cache.

The only way I see to work around this is:

  1. Put some hacks in piglit's cmake that mucks around with CMake
     internal variables.

  2. Remove your CMakeCache and rerun CMake.

I don't like this situation, but I think is Piglit's fate for using
CMake. That is, unless someone proposes some clever CMake-foo.


> > Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> > ---
> >  CMakeLists.txt | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index 7418ac3..d9bd28e 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -50,13 +50,14 @@ if(PIGLIT_USE_WAFFLE)
> >  	# validates the required version at most once for the lifetime of the
> >  	# source tree.  If someone changes the required version by editing the
> >  	# CMakeLists, CMake fails to detect the new requirement.
> > -	set(WAFFLE_REQUIRED_VERSION "1.2.2")
> > +	set(WAFFLE_REQUIRED_VERSION "1.3.0")
> >  	if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
> >  		message(FATAL_ERROR "Found waffle-${WAFFLE_VERSION}, but "
> >  		"piglit requires waffle-${WAFFLE_REQUIRED_VERSION}")
> >          endif()
> >  
> >  	add_definitions(-DPIGLIT_USE_WAFFLE)
> > +	add_definitions(-DWAFFLE_API_VERSION=0x0103)
> >  	add_definitions(-DPIGLIT_HAS_WAYLAND)
> >  	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WAFFLE_CFLAGS}")
> >  	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WAFFLE_CFLAGS}")
> > 
> 


More information about the Piglit mailing list