[CMake] find_package question

Richard Quirk richard.quirk at gmail.com
Sat Apr 11 11:16:09 EDT 2009


On Sat, Apr 11, 2009 at 1:36 PM, Daniel Nelson <torham at connect2.com> wrote:

> When you call find_package(),  variables can be set inside the find script for
> arguments such as QUIET or REQUIRED.  For FindFoo.cmake, these variables would
> be Foo_FIND_QUIETLY and Foo_FIND_REQUIRED respectively.  I think it's ugly and
> confusing having some variable all in caps and others with a strange mixture
> of CamelCase and caps.  Further a strict reading of Modules/readme.txt
> indicates that for a script FindFoo.cmake the variable set should be
> Foo_FOUND.  So it seems to me that the find script itself really should be
> named in all caps, i.e. FindFOO.cmake.
>
> As things are now, most scripts are named FindFoo.cmake and most of them set
> FOO_FOUND.

I'd just like to plug my lint script for CMake files at this point.

http://code.google.com/p/cmake-lint/

Among other things, it checks exactly the convention described above.
Running it on cmake/Modules/*.* results in 7826 "bad practices", but
they are my personal preferences so there will be false positives. A
full description of the checks made are here:

http://code.google.com/p/cmake-lint/wiki/CMakeStyleGuide

regards,
Richard


More information about the CMake mailing list