[CMake] module variable naming conventions

Bob Kuehne rpk at mac.com
Wed Apr 11 20:11:19 EDT 2007


hi, i've been using cmake for a while now, and am writing some of my  
own modules to find packages, in particular. i was using my own  
naming convention for return INCLUDE and LIB paths, something like  
FOO_INCLUDE_DIR and FOO_LIBRARY_DIR, until i read the module readme:

  /usr/share/cmake-2.4/Modules/readme.txt

it pretty clearly states that i should return things that are plural,  
like:

  FOO_LIBRARY_DIRS
  FOO_INCLUDE_DIRS
  FOO_LIBRARIES

however quite a number of the Find*.cmake that exist in the  
distribution use different syntax, returning mixed singular and  
plural forms (FindJPEG), _PATH instead of _DIR for returned INCLUDES  
(FindPythonLibs), and many other combinations.

my question (you knew i had one, right?) is simply this:

  - what is the best practice / standard for nomenclature? contents  
of 'readme.txt'?
  - is it worth fixing up old versions to the standard?

i love cmake, it's been very good to me so far! but i want to try to  
smooth a few of the rough edges in my understanding, and maybe in the  
usage and workings of this cool tool.

thanks!
bob





More information about the CMake mailing list