Re: [gdal-dev] Build question: GDAL with libwebp....

2024-02-15 Thread Carl Godkin via gdal-dev
On Wed, Feb 14, 2024 at 9:06 PM Kai Pastor, DG0YT  wrote:

>
> Did you try to quote for the linux command line, instead of escaping:
>
> "-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a;/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a"
>
> (YMMV. "LIBRARY" usually isn't for lists at all.)
>
>
Hi Kai,

Yes, it behaves the same way.   I had tried that too earlier and just
double-checked it.

I'll live with my workaround.  Another possibility is to use an older
version of libwebp, from before version 1.3.0 when the "libsharpyuv" code
was added.

Thanks a lot,

carl
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Build question: GDAL with libwebp....

2024-02-14 Thread Kai Pastor, DG0YT via gdal-dev

Am 15.02.24 um 00:42 schrieb Carl Godkin:

Hi Kai,

> To pass lists into cmake, you usually need ';' as item separator.

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.


When I pass this:
-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
 \
the link line comes out with the semi-colon (and also quoted):

 "/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a;/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" 



Or were you suggesting a different syntax?


Did you try to quote for the linux command line, instead of escaping:

"-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a;/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a"

(YMMV. "LIBRARY" usually isn't for lists at all.)

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).


Maybe most people using libwebp just let cmake find it on their system 
somehow?


The second part is CMake code in a separate script which is injected 
into the configuration process by using the CMAKE_PROJECT_INCLUDE 
variable at the command line.


It really doesn't do more than finding webp's cmake config and making it 
available in a way that GDAL can consume. I would be happy if GDAL would 
just use the webp CMake config.


The pattern can be adapted to other packages. It also works for Kealib.



My workaround, in case someone else is interested, is to do this
-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
 \
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.)


Working on the vcpkg port is my approach to this scriptable solution.

Kai.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Build question: GDAL with libwebp....

2024-02-14 Thread Carl Godkin via gdal-dev
Hi Kai,

> To pass lists into cmake, you usually need ';' as item separator.

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.

When I pass this:

   -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
\

the link line comes out with the semi-colon (and also quoted):


 
"/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a;/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a"

Or were you suggesting a different syntax?

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).

Maybe most people using libwebp just let cmake find it on their system
somehow?

My workaround, in case someone else is interested, is to do this

   -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
\

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.)

Thanks,
carl


On Tue, Feb 13, 2024 at 11:29 PM Kai Pastor, DG0YT via gdal-dev <
gdal-dev@lists.osgeo.org> wrote:

> To pass lists into cmake, you usually need ';' as item separator.
> (Exception: CMAKE__FLAGS which is a command line fragment with
> space-separated items.)
>
> In vcpkg, webp is configured via a CMAKE_PROJECT_INCLUDE file:
>
> if(GDAL_USE_WEBP)
> find_package(WebP CONFIG REQUIRED)
> add_library(WEBP::WebP ALIAS WebP::webp)
> set(GDAL_CHECK_PACKAGE_WebP_NAMES WebP CACHE INTERNAL "vcpkg")
> set(GDAL_CHECK_PACKAGE_WebP_TARGETS WebP::webp CACHE INTERNAL "vcpkg")
> endif()
>
> Kai
>
> Am 14.02.24 um 01:13 schrieb Carl Godkin via gdal-dev:
>
> Hi Andrew,
>
> Thanks for replying.  I am not looking for ways to edit CMakeLists.txt
> files, especially since I don't really understand the syntax.
>
>  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.
>
> Sorry I over-complicated my question!
>
> carl
>
> On Tue, Feb 13, 2024 at 10:45 AM Andrew C Aitchison <
> and...@aitchison.me.uk> wrote:
>
>> On Tue, 13 Feb 2024, Carl Godkin via gdal-dev wrote:
>>
>> > Hi,
>> >
>> > Sorry if this is an elementary cmake question but I am curious if there
>> is
>> > a cleaner solution than I came up with.
>> >
>> > I'm trying to build GDAL 3.8.3 with WEBP support.
>> >
>> > I built libwebp 1.3.2 (the latest) without any problems, also using
>> cmake.
>> >
>> > However, when building GDAL, the link on the shared library fails since
>> > WEBP seems to require TWO libraries (in the libwebp package), libwebp
>> and
>> > libsharpyuv.
>> >
>> > My question is how can I persuade cmake to accept both libraries for
>> > WEBP_LIBRARY?
>> >
>> > I thought quotes would help.  What I think I ought to be able to do is
>> > something like
>> >
>> >   -DWEBP_LIBRARY="/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
>> > /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \
>> >
>> > or else
>> >
>> >   "-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
>> > /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \
>> >
>> > but both options produce link lines that include the double quotes!
>> This
>> > is an issue on Windows and Linux for me.
>>
>> CMAKE is rather more verbose than that.
>>
>> Compare
>> gdal/frmts/webp/CMakeLists.txt
>> with
>> gdal/frmts/png/CMakeLists.txt
>> for how the png driver uses libpng and zlib
>>
>> You probably don't need the gdal_add_vendored_lib commands or the
>> GDAL_USE_..._INTERNAL tests, since gdal is not bundling libwebp.
>>
>> > I have a couple of workarounds that I won't bore you with, but I was
>> > wondering what the best practice is here (other than hand-editing the
>> cmake
>> > output of course).
>> >
>> > I think that libwebp added the "sharpyuv" stuff at version 1.3.0 so
>> perhaps
>> > using an older version would also work, but that doesn't seem
>> sustainable.
>> >
>> > Thanks for suggestions,
>> >
>> > carl
>> >
>>
>> --
>> Andrew C. Aitchison  Kendal, UK
>> and...@aitchison.me.uk
>>
>
> ___
> gdal-dev mailing 
> listgdal-dev@lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Build question: GDAL with libwebp....

2024-02-13 Thread Kai Pastor, DG0YT via gdal-dev

To pass lists into cmake, you usually need ';' as item separator.
(Exception: CMAKE__FLAGS which is a command line fragment with 
space-separated items.)


In vcpkg, webp is configured via a CMAKE_PROJECT_INCLUDE file:

if(GDAL_USE_WEBP)
    find_package(WebP CONFIG REQUIRED)
    add_library(WEBP::WebP ALIAS WebP::webp)
    set(GDAL_CHECK_PACKAGE_WebP_NAMES WebP CACHE INTERNAL "vcpkg")
    set(GDAL_CHECK_PACKAGE_WebP_TARGETS WebP::webp CACHE INTERNAL "vcpkg")
endif()

Kai

Am 14.02.24 um 01:13 schrieb Carl Godkin via gdal-dev:

Hi Andrew,

Thanks for replying.  I am not looking for ways to edit CMakeLists.txt 
files, especially since I don't really understand the syntax.


 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.


Sorry I over-complicated my question!

carl

On Tue, Feb 13, 2024 at 10:45 AM Andrew C Aitchison 
 wrote:


On Tue, 13 Feb 2024, Carl Godkin via gdal-dev wrote:

> Hi,
>
> Sorry if this is an elementary cmake question but I am curious
if there is
> a cleaner solution than I came up with.
>
> I'm trying to build GDAL 3.8.3 with WEBP support.
>
> I built libwebp 1.3.2 (the latest) without any problems, also
using cmake.
>
> However, when building GDAL, the link on the shared library
fails since
> WEBP seems to require TWO libraries (in the libwebp package),
libwebp and
> libsharpyuv.
>
> My question is how can I persuade cmake to accept both libraries for
> WEBP_LIBRARY?
>
> I thought quotes would help.  What I think I ought to be able to
do is
> something like
>
>  -DWEBP_LIBRARY="/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
> /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \
>
> or else
>
>  "-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
> /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \
>
> but both options produce link lines that include the double
quotes!  This
> is an issue on Windows and Linux for me.

CMAKE is rather more verbose than that.

Compare
    gdal/frmts/webp/CMakeLists.txt
with
    gdal/frmts/png/CMakeLists.txt
for how the png driver uses libpng and zlib

You probably don't need the gdal_add_vendored_lib commands or the
GDAL_USE_..._INTERNAL tests, since gdal is not bundling libwebp.

> I have a couple of workarounds that I won't bore you with, but I was
> wondering what the best practice is here (other than
hand-editing the cmake
> output of course).
>
> I think that libwebp added the "sharpyuv" stuff at version 1.3.0
so perhaps
> using an older version would also work, but that doesn't seem
sustainable.
>
> Thanks for suggestions,
>
> carl
>

-- 
Andrew C. Aitchison                      Kendal, UK

and...@aitchison.me.uk


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Build question: GDAL with libwebp....

2024-02-13 Thread Carl Godkin via gdal-dev
Hi Andrew,

Thanks for replying.  I am not looking for ways to edit CMakeLists.txt
files, especially since I don't really understand the syntax.

 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.

Sorry I over-complicated my question!

carl

On Tue, Feb 13, 2024 at 10:45 AM Andrew C Aitchison 
wrote:

> On Tue, 13 Feb 2024, Carl Godkin via gdal-dev wrote:
>
> > Hi,
> >
> > Sorry if this is an elementary cmake question but I am curious if there
> is
> > a cleaner solution than I came up with.
> >
> > I'm trying to build GDAL 3.8.3 with WEBP support.
> >
> > I built libwebp 1.3.2 (the latest) without any problems, also using
> cmake.
> >
> > However, when building GDAL, the link on the shared library fails since
> > WEBP seems to require TWO libraries (in the libwebp package), libwebp and
> > libsharpyuv.
> >
> > My question is how can I persuade cmake to accept both libraries for
> > WEBP_LIBRARY?
> >
> > I thought quotes would help.  What I think I ought to be able to do is
> > something like
> >
> >   -DWEBP_LIBRARY="/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
> > /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \
> >
> > or else
> >
> >   "-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
> > /usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \
> >
> > but both options produce link lines that include the double quotes!  This
> > is an issue on Windows and Linux for me.
>
> CMAKE is rather more verbose than that.
>
> Compare
> gdal/frmts/webp/CMakeLists.txt
> with
> gdal/frmts/png/CMakeLists.txt
> for how the png driver uses libpng and zlib
>
> You probably don't need the gdal_add_vendored_lib commands or the
> GDAL_USE_..._INTERNAL tests, since gdal is not bundling libwebp.
>
> > I have a couple of workarounds that I won't bore you with, but I was
> > wondering what the best practice is here (other than hand-editing the
> cmake
> > output of course).
> >
> > I think that libwebp added the "sharpyuv" stuff at version 1.3.0 so
> perhaps
> > using an older version would also work, but that doesn't seem
> sustainable.
> >
> > Thanks for suggestions,
> >
> > carl
> >
>
> --
> Andrew C. Aitchison  Kendal, UK
> and...@aitchison.me.uk
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Build question: GDAL with libwebp....

2024-02-13 Thread Andrew C Aitchison via gdal-dev

On Tue, 13 Feb 2024, Carl Godkin via gdal-dev wrote:


Hi,

Sorry if this is an elementary cmake question but I am curious if there is
a cleaner solution than I came up with.

I'm trying to build GDAL 3.8.3 with WEBP support.

I built libwebp 1.3.2 (the latest) without any problems, also using cmake.

However, when building GDAL, the link on the shared library fails since
WEBP seems to require TWO libraries (in the libwebp package), libwebp and
libsharpyuv.

My question is how can I persuade cmake to accept both libraries for
WEBP_LIBRARY?

I thought quotes would help.  What I think I ought to be able to do is
something like

  -DWEBP_LIBRARY="/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \

or else

  "-DWEBP_LIBRARY=/usr/local/devlibs/libwebp-1.3.2/lib64/libwebp.a
/usr/local/devlibs/libwebp-1.3.2/lib64/libsharpyuv.a" \

but both options produce link lines that include the double quotes!  This
is an issue on Windows and Linux for me.


CMAKE is rather more verbose than that.

Compare
   gdal/frmts/webp/CMakeLists.txt
with
   gdal/frmts/png/CMakeLists.txt
for how the png driver uses libpng and zlib

You probably don't need the gdal_add_vendored_lib commands or the 
GDAL_USE_..._INTERNAL tests, since gdal is not bundling libwebp.



I have a couple of workarounds that I won't bore you with, but I was
wondering what the best practice is here (other than hand-editing the cmake
output of course).

I think that libwebp added the "sharpyuv" stuff at version 1.3.0 so perhaps
using an older version would also work, but that doesn't seem sustainable.

Thanks for suggestions,

carl



--
Andrew C. Aitchison  Kendal, UK
   and...@aitchison.me.uk
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev