From bug #175426:
FindWebP failed to find libwebp on my test system and printed an error, but I guess it must have set WEBP_FOUND=1 or something because the build proceeded even though it was REQUIRED.
Konstantin discovered that REQUIRED was not working properly:
> No, by design it should result in fatal error. However, I've found why it
> doesn't happen for WebP and GeoClue: package names are case-sensitive, so
> WebP != WEBP, and WEBP_FOUND being false is ignored because cmake looks for
> WebP_FOUND. We either need to rename FindWebP.cmake to FindWEBP.cmake and
> use find_package(WEBP), or use "WebP" spelling consistently. Same for other
> packages with mixed case names.
So we need to call in the case-sensitivity police to fix OptionsGTK.cmake (and probably other ports, too).
What way of fixing do you prefer? I think it would be more cmake'ish[*] to use mised case like "WebP" everywhere, but renaming files would result in less changes.
[*] more consistent with built-in cmake modules
I have no strong preference. Do want to write the patch, or shall I?
Are we going to have to change WEBP_LIBRARIES and WEBP_INCLUDE_DIRS to WebP_LIBRARIES and WebP_FOUND as well?
Huh, there are a quite a few of them:
(In reply to Michael Catanzaro from comment #2)
> I have no strong preference. Do want to write the patch, or shall I?
> Are we going to have to change WEBP_LIBRARIES and WEBP_INCLUDE_DIRS to
> WebP_LIBRARIES and WebP_FOUND as well?
If we go to WebP way, yes
(In reply to Konstantin Tokarev from comment #4)
> (In reply to Michael Catanzaro from comment #2)
> > I have no strong preference. Do want to write the patch, or shall I?
> > Are we going to have to change WEBP_LIBRARIES and WEBP_INCLUDE_DIRS to
> > WebP_LIBRARIES and WebP_FOUND as well?
> If we go to WebP way, yes
Oops, actually no. It's just a good practise but not a requirement, and old modules like FindLibXml2 do this. What matters is that X in FindX.cmake and in find_package_handle_standard_args(X ...) have the same case.
But we'll need to specify "wrong" variable names explicitly in each module which isn't doing this yet
I think I like CMake less and less the more I learn about it.
Konstantin, why don't you pick your preferred approach and we can just see how well it works out.
Too much work to do by hand and I use only 2 of these modules, but I'll try to make a script for sed
(In reply to Michael Catanzaro from comment #7)
> I think I like CMake less and less the more I learn about it.
Created attachment 317928 [details]
Created attachment 317931 [details]
Comment on attachment 317931 [details]
Thanks, this could have been so much worse.
Committed r220595: <http://trac.webkit.org/changeset/220595>