[CMake] recommended way to disable a package ?

Filipe Sousa filipe at ipb.pt
Mon Jan 30 05:52:48 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Neundorf wrote:
> Hi, 
>  
> ... 
>  
> Ok, then I think I'll do 
>  
> OPTION(USE_AGG "AGG SUpport" ON) 
> IF( USE_AGG) 
>    FIND_PACKAGE(AGG) 
> ENDIF( USE_AGG) 
>  
>  
> and later on use AGG_FOUND just as usual. This could even be wrapped into 
> a small macro: 
>  
> MACRO(optional_package name) 
>    OPTION(USE_${name} "Enable ${name} support" ON) 
>    IF(${USE_${name}}) 
>       FIND_PACKAGE(${name}) 
>    ENDIF(${USE_${name}}) 
> ENDMACRO(optional_package) 

You'd better add ARGN in case the user wants to add more optins to
FIND_PACKAGE

> Is there actually a cmake module where such macros could be collected, 
> like "CMakeTools.cmake", "CMakeUtilities.cmake" or something like this ? 
>  
> Bye 
> Alex 
>  
>  
> 


- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD3fAAbQdNYqwwwCwRAhBSAJ4wBdykZ8rf9XbHsLDSVHrV4NlfLwCcCnPE
p2VXrVZz3AgSvNOb3R8YpvY=
=BuF4
-----END PGP SIGNATURE-----


More information about the CMake mailing list