[cmake-developers] FindPackageHandleStandardArgs and empty versions

Brian Helba brian.helba at kitware.com
Wed Jan 8 11:29:52 EST 2014


Hello,

>
> I've got a question about some logic in
> CMake's find_package_handle_standard_args function, specifically the fact
> that it considers a nonexistent / empty string version to be a version that
> acceptably matches the required version.
>
> The logic is:
> * call find_package_handle_standard_args(... VERSION_VAR "" ...)
> * at FindPackageHandleStandardArgs.cmake:286<http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindPackageHandleStandardArgs.cmake;hb=HEAD#l286>,
> the VERSION_OK variable is set to a default value of TRUE
> * at 287, the value of the argument following VERSION_VAR is set into
> VERSION
> * at 309, if VERSION is undefined or an empty string, the else() branch is
> taken
> * from 309-318, an error message is set, but VERSION_OK is never made FALSE
> * at 325, since VERSION_OK is still TRUE, the logic proceeds with setting
> ${package_name}_FOUND to TRUE
>
> Is this the intended behavior (and if so, why?) or a bug?
>
> Thanks,
> Brian
>
> --
> Brian Helba
> Medical Imaging
> Kitware, Inc.
>



-- 
Brian Helba
Medical Imaging
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140108/279a03a9/attachment.html>


More information about the cmake-developers mailing list