[gdal-dev] OpenJPEG JPEG2000 Driver

Mateusz Loskot mateusz at loskot.net
Wed Feb 15 10:30:39 PST 2023


On Wed, 15 Feb 2023 at 19:14, Simon Eves <simon.eves at heavy.ai> wrote:
>
> I am building OpenJPEG with SHARED_LIBS off, as we only need the static version for GDAL.
> GDAL itself builds default (SHARED_LIBS on) as we need static for our main product build,

I know nothing about OpenJPEG build configuration, but GDAL uses CMake's native
BUILD_SHARED_LIBS to control the shared/static library build

> We don't need to link GDAL statically into any higher-level shared libs, just the main monolithic executable.
> [...]
> My main concern remains the need to hack the configure script to get the GDAL build to agree that OpenJPEG is usable,

In theory, BUILD_SHARED_LIBS=ON could/should cascade to all dependencies
- you want static GDAL, good, we will assume you link it against
static OpenJPEG, etc.

However, I remember, I had to modify the old NMAKE makefile to make
GDAL link against
static curl and a few others I did build as static libraries, e.g.
forcing those deps as static-s
and adding list of dependencies of those dependencies, etc.
So, I'd say hacking build config for uncommon builds nothing buggy or
unexpected.

Best regards.
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list