Skip to content

Conversation

@lgritz
Copy link
Collaborator

@lgritz lgritz commented Sep 17, 2025

PR #4875, switched to using openjph's exported cmake config instead of
our own FindOpenJPH.cmake, and in the process also renamed OpenJPH ->
openjph to follow their convention.

But I botched it, still using the old OPENJPH_LIBRARIES (etc.)
variables instead of fully switching to the correct targets exported
from their config.

This PR minimally fixes that error, re-enabling use of openjph.

Fixes #4893

@lgritz
Copy link
Collaborator Author

lgritz commented Sep 17, 2025

@kmilos Does this look right to you?

@lgritz lgritz added the build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. label Sep 17, 2025
@lgritz
Copy link
Collaborator Author

lgritz commented Sep 17, 2025

Anybody care to review this? It's the last piece I need to release a 3.1 beta2.

Comment on lines 180 to 183
set_target_properties(openjp2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENJPEG_INCLUDES}")
set_property(TARGET openjp2 APPEND PROPERTY
IMPORTED_LOCATION "${OPENJPEG_LIBRARIES}")
Copy link

@kmilos kmilos Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure this is sufficient - e.g. my OpenJPEGTargets-release.cmake config on Windows also has an IMPORTED_IMPLIB property for the stub to go w/ IMPORTED_LOCATION DLL...

I think it might be safer to do the minimal change just for the openjph target first (maybe something like I suggested), and only then refactor this later. This FindOpenJPEG module feels like overkill as OpenJPEG (at least v2) also ships CMake config files for a long time, maybe it should be checked first before setting stuff up manually...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should check if it's still the case, but last time I looked at using the OpenJPEG's own exported cmake configs, I think that they worked ok for the most recent version, but didn't exist or weren't reliable for some of the older versions that we still supported.

I can back off this a bit and propose a simpler, more direct fix, that doesn't mess with the OpenJPEG portions.

But before I commit to that, did you try this patch on your end and verify that there's something that doesn't work?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can back off this a bit and propose a simpler, more direct fix, that doesn't mess with the OpenJPEG portions.

I would agree it's better to separate these.

But before I commit to that, did you try this patch on your end and verify that there's something that doesn't work?

I haven't had the chance, sorry...

PR 4875, switched to using openjph's exported cmake config instead of
our own FindOpenJPH.cmake, and in the process also renamed OpenJPH ->
openjph to follow their convention.

But I botched it, still using the old OPENJPH_LIBRARIES (etc.)
veriables instead of fully switching to the correct targets exported
from their config.

This PR minimally fixes that error, re-enabling use of openjph.

Signed-off-by: Larry Gritz <[email protected]>
@lgritz
Copy link
Collaborator Author

lgritz commented Sep 18, 2025

I've fully replaced this PR with a simpler version that just directly addresses the problem:


build: fix openjph target use

PR 4875, switched to using openjph's exported cmake config instead of
our own FindOpenJPH.cmake, and in the process also renamed OpenJPH ->
openjph to follow their convention.

But I botched it, still using the old OPENJPH_LIBRARIES (etc.)
variables instead of fully switching to the correct targets exported
from their config.

This PR minimally fixes that error, re-enabling use of openjph.

@lgritz lgritz changed the title build: fix and modernize jpeg2000 and openjph target use build: fix openjph target use Sep 18, 2025
@kmilos
Copy link

kmilos commented Sep 18, 2025

LGTM

@lgritz lgritz merged commit 8530a87 into AcademySoftwareFoundation:main Sep 18, 2025
62 checks passed
@lgritz lgritz deleted the lg-openjph branch September 18, 2025 21:26
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Sep 19, 2025
PR AcademySoftwareFoundation#4875, switched to using openjph's exported cmake config instead of
our own FindOpenJPH.cmake, and in the process also renamed OpenJPH ->
openjph to follow their convention.

But I botched it, still using the old OPENJPH_LIBRARIES (etc.)
variables instead of fully switching to the correct targets exported
from their config.

This PR minimally fixes that error, re-enabling use of openjph.

Fixes AcademySoftwareFoundation#4893

Signed-off-by: Larry Gritz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUILD] OpenJPH feature build issues

2 participants