config.h.cmake issue ?

David Faure faure at kde.org
Wed May 3 22:38:38 CEST 2006


On Wednesday 03 May 2006 20:37, Ralf Habacker wrote:
> This does not mean that #ifdef HAVE_ is bad.
It's bad because one doesn't notice if one forgets to include config.h or config-foo.h,
but this is kind of unrelated to this discussion, it's an orthogonal idea that I had.

> PCRE_FOUND is an implementation detail of macro_optional_find_package. 
> Wouldn't it be better to be at the same level for adding the define like 
> shown below ?
> 
>   macro_optional_find_package(PCRE)
>   add_package_define(PCRE HAVE_PCREPOSIX ${CMAKE_CURRENT_BINARY_DIR}/global.h )

This is just one case. Most things do not come from packages. Think about 
  check_include_files(sys/types.h   HAVE_SYS_TYPES_H)  
this one would need to take a file into which to put the define, too, or with my solution it's simpler because
we can then just add  add_define( ${CMAKE_CURRENT_BINARY_DIR}/config-lowlevel.h HAVE_SYS_TYPES_H )
Same for check_library_exists, check_function_exists, etc. Instead of extending all of those to
tell them into which file to put the result, I think it's simpler and cleaner to just separate the
checking and the writing out to a .h file.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-buildsystem mailing list