<div dir="ltr">Hi Andrew,<div><br></div><div>Thanks for replying.  I am not looking for ways to edit CMakeLists.txt files, especially since I don't really understand the syntax.</div><div><br></div><div> I was just hoping that someone who had built GDAL with WEBP enabled would tell me how to specify both libraries to cmake on the command line.</div><div><br></div><div>Sorry I over-complicated my question!</div><div><br></div><div>carl</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 13, 2024 at 10:45 AM Andrew C Aitchison <<a href="mailto:andrew@aitchison.me.uk">andrew@aitchison.me.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 13 Feb 2024, Carl Godkin via gdal-dev wrote:<br>
<br>
> Hi,<br>
><br>
> Sorry if this is an elementary cmake question but I am curious if there is<br>
> a cleaner solution than I came up with.<br>
><br>
> I'm trying to build GDAL 3.8.3 with WEBP support.<br>
><br>
> I built libwebp 1.3.2 (the latest) without any problems, also using cmake.<br>
><br>
> However, when building GDAL, the link on the shared library fails since<br>
> WEBP seems to require TWO libraries (in the libwebp package), libwebp and<br>
> libsharpyuv.<br>
><br>
> My question is how can I persuade cmake to accept both libraries for<br>
> WEBP_LIBRARY?<br>
><br>
> I thought quotes would help.  What I think I ought to be able to do is<br>
> something like<br>
><br>
>   -DWEBP_LIBRARY="/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a<br>
> /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \<br>
><br>
> or else<br>
><br>
>   "-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a<br>
> /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \<br>
><br>
> but both options produce link lines that include the double quotes!  This<br>
> is an issue on Windows and Linux for me.<br>
<br>
CMAKE is rather more verbose than that.<br>
<br>
Compare<br>
    gdal/frmts/webp/CMakeLists.txt<br>
with<br>
    gdal/frmts/png/CMakeLists.txt<br>
for how the png driver uses libpng and zlib<br>
<br>
You probably don't need the gdal_add_vendored_lib commands or the <br>
GDAL_USE_..._INTERNAL tests, since gdal is not bundling libwebp.<br>
<br>
> I have a couple of workarounds that I won't bore you with, but I was<br>
> wondering what the best practice is here (other than hand-editing the cmake<br>
> output of course).<br>
><br>
> I think that libwebp added the "sharpyuv" stuff at version 1.3.0 so perhaps<br>
> using an older version would also work, but that doesn't seem sustainable.<br>
><br>
> Thanks for suggestions,<br>
><br>
> carl<br>
><br>
<br>
-- <br>
Andrew C. Aitchison                      Kendal, UK<br>
                    <a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a><br>
</blockquote></div>