[cmake-developers] [PATCH] FindPackageHandleStandardArgs: fix documentation
Yury G. Kudryashov
urkud.urkud at gmail.com
Fri Jan 20 08:57:13 EST 2012
Brad King wrote:
> On 1/19/2012 2:41 PM, Yury G. Kudryashov wrote:
>> State explicitly what CONFIG_MODE argument does.
> [snip]
>> -# a find_package(... NO_MODULE) call, in this case all the information
>> -# provided by the config-mode of find_package() will be evaluated
>> -# automatically.
>> +# a find_package(... NO_MODULE) call, in this VERSION_VAR will be set to
>> +# NAME_VERSION and the macro will automatically check whether the Config
>> module +# was found.
>
> I do not think that explanation is correct. The find_package command
> in Config mode will set everything as needed.
Yes, so the old explanation is incorrect.
> The role of the CONFIG_MODE
> option is to produce a nice error message when the package is not found.
I've searched FPHSA.cmake for CONFIG_MODE, and found the following code
snippets:
IF(FPHSA_CONFIG_MODE)
LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
ENDIF(FPHSA_CONFIG_MODE)
This code sets VERSION_VAR and requires ${_NAME}_CONFIG to be set.
IF(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
ELSE(FPHSA_CONFIG_MODE)
This code and the macro called from this code generates a nice error
message.
>
> Alex, as the author of the behavior can you suggest clearer wording?
--
Yury G. Kudryashov,
mailto: urkud at mccme.ru
More information about the cmake-developers
mailing list