[CMake] checking consistency for the cmake modules: the FOO_FOUND variable

Alexander Neundorf a.neundorf-work at gmx.net
Tue Jun 17 15:30:23 EDT 2008


Hi,

according to Modules/readme.txt every module should set a FOO_FOUND variable 
indicating success or failure.
I tested this with the new FindModulesExeuteAll test and there are some 
modules which don't do that. They could be changed so that they do set that 
variable.

Question 1): do we actually want to make it a hard requirement that every 
module sets this variable ?

2) When should FOO_FOUND be set to TRUE ?
For obvious modules it's obvious (yeah I know...), but there are also modules 
which search for multiple components of one package. Should FOO_FOUND be set 
to TRUE only if all components have been found ? Or if at least one component 
has been found ? Or if COMPONENTS are listed in the FIND_PACKAGE call, only 
if all the components listed there have been found ?

3) How should it be named ? UPPERCASEPROJECT_FOUND or MixedCaseProject_FOUND ?
For consistency amd compatibility with (almost) all existing cmake modules 
(and I think we also already agreed on that last year) we should go for the 
upper case variant.

Alex

P.S. after that we could go on and check for (FOO|Foo)_(INCLUDE_DIR|INCLUDES) 
and (FOO|Foo)_(LIBRARIES|LIBS). The modules which don't search a library 
would have to be blacklisted (like FindPerlcmake).


More information about the CMake mailing list