[CMake] Module variables naming conventions

Maik Beckmann beckmann.maik at googlemail.com
Sun Apr 27 11:15:50 EDT 2008


Hello,

I know this topic isn't new, but I like to bring it up again.

From 
  Modules/readme.txt
I get the following.  A Find*.cmake file should _always_ set the plural forms 
like:
  XXX_INCLUDE_DIRS
  XXX_LIBRARY_DIRS
  ...
while the singular forms are appropriate for UI entries and internal usage.

There are many modules which don't define the plural form.  Adding sections 
like this
  <FindXXX.cmake> 
  ...
  # forwards to plural variable names: See Modules/readme.txt
  SET(XXX_INCLUDE_DIRS ${XXX_INCLUDE_DIR})
  ...
  <FindXXX.cmake>
doesn't break any backwards compatibility.

The only problem might be a projects developed with a consistent version of 
cmake doesn't build with an inconsistent one.  IMHO cmake-2.6 is the good 
staring point for this.

Before I start sending patches I would like to hear if there are objections 
against.

Best,
 -- Maik


More information about the CMake mailing list