<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">To pass lists into cmake, you usually
need ';' as item separator.</div>
<div class="moz-cite-prefix">(Exception: CMAKE_<lang>_FLAGS
which is a command line fragment with space-separated items.)</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">In vcpkg, webp is configured via a
CMAKE_PROJECT_INCLUDE file:<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">if(GDAL_USE_WEBP)<br>
find_package(WebP CONFIG REQUIRED)<br>
add_library(WEBP::WebP ALIAS WebP::webp)<br>
set(GDAL_CHECK_PACKAGE_WebP_NAMES WebP CACHE INTERNAL "vcpkg")<br>
set(GDAL_CHECK_PACKAGE_WebP_TARGETS WebP::webp CACHE INTERNAL
"vcpkg")<br>
endif()</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Kai<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Am 14.02.24 um 01:13 schrieb Carl
Godkin via gdal-dev:<br>
</div>
<blockquote type="cite"
cite="mid:CAE=8km=+oA0AETcA57NReA5wEiuSg6WjmF3htYXsNodG4JyMEw@mail.gmail.com">
<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" moz-do-not-send="true"
class="moz-txt-link-freetext">andrew@aitchison.me.uk</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote">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" moz-do-not-send="true"
class="moz-txt-link-freetext">andrew@aitchison.me.uk</a><br>
</blockquote>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>