<div dir="ltr">Hi Kai,<div><br></div><div>> To pass lists into cmake, you usually need ';' as item separator.<br><div><br></div><div>Thanks for the suggestion.  I am sure I am missing something but inserting a semi-colon on the Linux command line appears to require it be escaped.</div></div><div><br></div><div>When I pass this:</div><div><pre style="color:rgb(0,0,0)">   -DWEBP_INCLUDE_DIR:PATH=/usr/local/devlibs/libwebp-1.3.2/include \
   -DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a\;/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a \</pre></div><div>the link line comes out with the semi-colon (and also quoted):</div><div><br></div><div>   "/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a;/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" <br></div><div><br></div><div>Or were you suggesting a different syntax?</div><div><br></div><div>I do not really understand the second part of your reply but I'm not using vcpkg; I'm trying to use cmake at the command line (and trying to build on both Windows and Linux).</div><div><br></div><div>Maybe most people using libwebp just let cmake find it on their system somehow?</div><div><br></div><div>My workaround, in case someone else is interested, is to do this</div><div><pre style="color:rgb(0,0,0)">   -DWEBP_INCLUDE_DIR:PATH=/usr/local/devlibs/libwebp-1.3.2/include \
   -DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a \
   -DCMAKE_CXX_STANDARD_LIBRARIES=/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a \</pre></div><div>Now libsharpyuv is included in every link line which works but isn't quite right.  (I have also hand-edited the generated link line but I was looking for a scriptable solution.)</div><div><br></div><div>Thanks,</div><div>carl</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 13, 2024 at 11:29 PM Kai Pastor, DG0YT via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</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"><u></u>

  
    
  
  <div>
    <div>To pass lists into cmake, you usually
      need ';' as item separator.</div>
    <div>(Exception: CMAKE_<lang>_FLAGS
      which is a command line fragment with space-separated items.)</div>
    <div><br>
    </div>
    <div>In vcpkg, webp is configured via a
      CMAKE_PROJECT_INCLUDE file:<br>
    </div>
    <div><br>
    </div>
    <div>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><br>
    </div>
    <div>Kai<br>
    </div>
    <div><br>
    </div>
    <div>Am 14.02.24 um 01:13 schrieb Carl
      Godkin via gdal-dev:<br>
    </div>
    <blockquote type="cite">
      <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" target="_blank">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">andrew@aitchison.me.uk</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </div>

_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>