[CMake] Upper or lower case for package variables in FindXXX.cmake files?

Philip Lowman philip at yhbt.com
Fri Feb 27 14:01:17 EST 2009

On Fri, Feb 27, 2009 at 1:13 PM, Matt Williams <lists at milliams.com> wrote:

> Based on the modules readme.txt [1] I have been assuming that if I have a
> package called QtOgre (with that capitalisation) then the FindXXX.cmake
> file
> should be called FindQtOgre.cmake (alternatively there should be a
> QtOgreConfig.cmake file). In order to maintain unambiguity, I have been
> calling the variables within according to the readme.txt rules as things
> like
> QtOgre_LIBRARIES etc. rather that QTOGRE_LIBRARIES.
> Looking around at the other FinXXX.cmake files out there (including the
> officially distributed ones), there is a mixture of these two casing
> conventions. Boost and wxWidgets, for example, both use the mixed case form
> but others such as Perl use the uppercased form. Confusingly, there are
> even
> those which mix the two conventions, like FindJasper.cmake containing
> There is no indication in the readme.txt which is preferred though I have
> been
> assuming the mixed case version. Based on bits and pieces I guess I am
> right
> (for example,the "DOXYGEN_FIND_QUIETLY, but it should have been
> Doxygen_FIND_QUIETLY" comment in FindDoxygen.cmake).
I have wondered the same thing for many a moon.

The arguments to find_package, i.e. EXACT, QUIET, COMPONENTS, version
number, etc. cause variables such as Doxygen_FIND_QUIETLY, Boost_COMPONENTS,
and OpenSceneGraph_FIND_VERSION to be generated by CMake.  These are based
directly off of the name of the find module filename so they will generally
appear to be mixed case if that is the name of the module.

Macros like FindPackageHandleStandardArgs seem to make everything upper case

Not sure what the answer is.  It's almost as if input variables are
encouraged to be the case of the module and output variables are encouraged
to be uppercase always.

Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090227/77bd2c22/attachment.htm>

More information about the CMake mailing list