[CMake] FindXXX.cmake conventions

Joe loeffel77 at yahoo.com
Sun Nov 4 19:02:38 EST 2007


Hi,
we have started to migrate the build system of our
software to cmake. After a great success in starting
the new build system some questions arise, when
thinking about mid and long term maintainability.

When writing own FindXXX.cmake modules, it seems to be
of advantage to follow the same conventions that
possible future dependencies might follow, too. But
here some discrepancies arise.

I found a nice readme.txt at
${CMAKE_ROOT}/share/cmake-2.4/Modules/readme.txt
surprisingly almost none of the predefined find
modules in the same directory seems to follow these
rules (the use of XXX_INCLUDE_DIR instead of
XXX_INCLUDE_DIRS is one of the most obvious
discrepancy, that no modules uses XXX_ROOT_DIR is
another).

Is the readme outdated, or will the modules be adapted
to the readme conventions?

My second question concerns the XXX_LIBRARIES
variable.   As indicated in the readme.txt the full
path to the libraries should be given in the
XXX_LIBARIES variable. For simplicity we create the
XXXConfig.cmake files with the CONFIGURE_FILE command
containing a line like
SET( XXX_LIBRARIES @installed_lib@ )
in the XXXConfig.cmake.in.
To "calculate" the variable installed_lib with the
complete install path, the library prefix and suffix
(.a or .so) seems to be a quite tedious task. Is there
a way to get the full path and name of an _installed_
target directly, or is there a good way to avoid the
need to know the full path and exact library name
(with  pre- and suffix)?

Thanks in advance for your answer. Cheers,
Klaus.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the CMake mailing list