[waffle] [PATCH 04/10] cmake: add autodetection for waffle_has_egl, glx...

Chad Versace chad.versace at intel.com
Thu Jun 5 23:18:42 PDT 2014


On Sat, May 31, 2014 at 03:22:02AM +0100, Emil Velikov wrote:
> Silence the pkg_check_modules and check set the default
> options depending on the packages found.

This is a good idea and will make Waffle easier to configure for
everyone.

There are a few problems though.

If configuration fails because the user tried to enable a platform for
which his system lacks the dependencies, then post-patch CMake no longer
gives sufficient explanation why it failed. For example, if
-Dwaffle_has_gbm=1 fails, CMake informs the user thta "gbm requirements
are not met" but does explain what those requirements are. And, since
waffle_pkg_config is now silenced by QUIET, CMake's earlier output
provides no clue.

To avoid providing the user a silent mystery, this block

> +    if(waffle_has_wayland)
> +        if(NOT wayland-client_FOUND OR
> +           NOT wayland-egl_FOUND OR NOT egl_FOUND)
> +            message(FATAL_ERROR "wayland requirements are not met.")
> +        endif()
> +    endif()

should explain which requirements, including the version if any, were
not met.  For example, if -Dwaffle_has_wayland=1 but the system lacks
wayland-egl>=9.1, then CMake should print something like
    "wayland dependency is missing: wayland-egl>=9.1"
or
    "wayland requirement wayland-egl>=9.1 is not met"


Why did you decide to silece waffle_pkg_config with QUIET? I feel that
it's useful to get notification for each item that CMake probes for.


More information about the waffle mailing list