[CMake] creating a CMakeUtils.cmake ?

Brad King brad.king at kitware.com
Mon Jan 30 17:23:07 EST 2006


Alexander Neundorf wrote:
> Hi, 
>  
> what do you think about creating a cmake module which contains several 
> useful macros ? 
> E.g. stuff like: 
>  
> MACRO(OPTIONAL_PACKAGE name) 
>    OPTION(WITH_${name} "ON" "Support ${name}") 
>    IF(WITH_${name}) 
>       FIND_PACKAGE(${name}) 
>    ENDIF(WITH_${name}) 
> ENDMACRO(OPTIONAL_PACKAGE) 
>  
> (just as an example, needs finetuning). 
>  
> What would be a good name ? 
> CMakeUtils, CMakeTools, CMakeLib (sounds as it would be related to 
> creating libraries) ? 

We should put each macro in its own module of the same name to allow 
users to include them individually and so that the documentation is 
nicely formatted by --help-module.  Then they could be packaged together 
under a single module that just INCLUDEs the other modules.  It could be 
called something like CMakeStandardMacros.

-Brad


More information about the CMake mailing list