[cmake-developers] Review request: use PKG_CONFIG

Brad King brad.king at kitware.com
Tue Feb 25 09:24:33 EST 2014


On 02/25/2014 08:49 AM, Christoph Grüninger wrote:
> there is a statement in the commit message:
>   "FPHSA now checks for PKG_CONFIG_VERSION_STRING to ensure
>   that the executable given by PKG_CONFIG is an executable
>   and has a --version parameter."

Sorry, I missed that.  Thanks.

> While testing, I set PKG_CONFIG to a random path like
> /usr/bin/kate. This was accepted by FindPkgConfig.
> Requiring PKG_CONFIG_VERSION_STRING ensures, that at
> least the --version thing is supported. This makes it
> more likely that a pkg-config executable is found.
> 
> Is my idea wrong or just my explanation not precise enough?

The purpose of REQUIRED_VARS is to both check that it was
found but also tell the user what cache entries they need
to set to make the package found if it was not.  Since the
version string is computed and the user cannot set it
directly it does not make sense in this context.

I do not think we should try too hard to protect users
from themselves, but if you want a check for this then it
would need to be your own if().

-Brad




More information about the cmake-developers mailing list