macro_optional_find_package and case-sensitivity

Alexander Neundorf neundorf at
Wed Jan 6 22:32:29 CET 2010

On Tuesday 05 January 2010, Volker Krause wrote:
> Hi,
> I just run into some build issues in kdelibs related to libattica on
> Windows and wanted to take the shortcut and simply disable it setting
> WITH_LibAttica (which is evaluated by macro_optional_find_package) to
> false. However, that didn't work. AFAICS this is caused by
> find_package_handle_standard_args upper-casing the prefix it uses (ie.
> LIBATTICA_FOUND in this case), while macro_optional_find_package does not
> (ie. giving me LibAttica_FOUND etc.).
> So, every package using those two macros and a name that's not all
> uppercase is affected by this I guess. How can we fix this? Change
> macro_optional_find_package to additionally also use an uppercase prefix?

But, you are right, we have an issue here.
macro_optional_find_package() basically only guesses which variables are set 
by the module which has been disabled.
This may be wrong guesses. 
So if the module package has already been found before, it may not be possible 
to disable the package afterwards if the values are already in the cache.

It works reliably if you call cmake with -DWITH_LibAttica=FALSE for the 
initial cmake run.

I'll commit a patch so that it sets also the uppercase variables to false.


More information about the Kde-buildsystem mailing list