[cmake-developers] Make non-REQUIRED find_package() always disable-able Was: Re: Adding argument "OPTIONAL" to find_package() and add_subdirectory

Alexander Neundorf neundorf at kde.org
Tue Jun 7 04:28:51 EDT 2011


Hi,

I slept over it, I think here's a better idea.

For every find_package() which is not REQUIRED, some people or packagers may 
want to explicitely disable each one of them.

So how about this:
if there is no REQUIRED keyword in the find_package() call, there is always an 
option added which can be used to disable this find_package() call.
These options could be named DISABLE_PACKAGE_<PackageName>.

This would
1) make it possible to disable each of the optional dependencies explicitely
2) these options will have the same standard name in all projects
3) does not add additional arguments to the find_package() interface

Options 1) and 2) are things regularly requested from developers used to 
autotools.

Alex



More information about the cmake-developers mailing list