[CMake] Find template

Joerg Mayer jmayer at loplof.de
Thu Aug 31 06:10:56 EDT 2006


On Thu, Aug 31, 2006 at 10:03:59AM +0200, Jan Woetzel wrote:
> Andreas Schneider wrote:
> 
> >http://code.google.com/p/cmake-modules/
> 
> 
> The instructions in Modules/readme.txt changed slightly (in CVS).
> Please adapt the  FindPackage.cmake  template accordingly for consistency.
> 
> I noticed:
> - Xxx_INCLUDE_DIRS (with the plural S) instead of _DIR
> - mixed case ( Foo_ instead of FOO_ ): case of Filename and variables

Regarding that stuff:

I'd like to see every (including the stuff already provided with cmake)
to use the same variables (either foo_LIBRARY or foo_LIBRARIES,
either foo_INCLUDE_DIR or foo_INCLUDE_DIRS) and very important - make
sure that the filename has the same case (Findfoo.cmake) spelling that is
used as the prefix for the variables (that's because on Unix filename
are case sensitive).

The idea of this is to be enventually able to do something like this:

set(packages GTK2 ZLIB Pcap)
foreach(pack ${packages})
find_package(pack)   <- This needs the same case spelling as the ${pack}
in the line below on unix
set(project_incs ${project_incs} ${pack}_INCLUDE_DIRS)
set(project_libs ${project_libs} ${pack}_LIBRARIES)
endforeach(pack)

I don't case which varname is finally selected, but personally I prefer
the plural versions (i.e. ...INCLUDE_DIRS ..._LIBRARIES).

Ciao
      Joerg
-- 
Joerg Mayer                                           <jmayer at loplof.de>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.


More information about the CMake mailing list