WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
204657
[CMake] Add OpenJPEG find module
https://bugs.webkit.org/show_bug.cgi?id=204657
Summary
[CMake] Add OpenJPEG find module
esodan@gmail.com
Reported
2019-11-27 16:43:17 PST
Required version for Openjpeg is VERSION_LESS "2.2.0", but should be VERSION_GREATER "2.2.0" in order to allow versions like "2.3.0", at file Source/cmake/OptionsGTK.cmake line 378. This is trying to build 2.27.3 on jhbuild.
Attachments
Patch
(8.50 KB, patch)
2019-12-11 13:01 PST
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
Patch
(8.66 KB, patch)
2019-12-11 13:18 PST
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
Patch
(8.68 KB, patch)
2019-12-11 13:30 PST
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
Patch
(8.68 KB, patch)
2019-12-11 13:32 PST
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
Patch
(8.49 KB, patch)
2019-12-11 13:34 PST
,
Don Olmstead
mcatanzaro
: review+
Details
Formatted Diff
Diff
Patch
(8.39 KB, patch)
2019-12-11 14:43 PST
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
Patch
(8.23 KB, patch)
2019-12-11 14:44 PST
,
Don Olmstead
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Don Olmstead
Comment 1
2019-12-11 13:01:26 PST
Comment hidden (obsolete)
Created
attachment 385427
[details]
Patch
Don Olmstead
Comment 2
2019-12-11 13:18:06 PST
Comment hidden (obsolete)
Created
attachment 385429
[details]
Patch
Don Olmstead
Comment 3
2019-12-11 13:30:52 PST
Comment hidden (obsolete)
Created
attachment 385432
[details]
Patch
Don Olmstead
Comment 4
2019-12-11 13:32:34 PST
Comment hidden (obsolete)
Created
attachment 385434
[details]
Patch
Don Olmstead
Comment 5
2019-12-11 13:34:24 PST
Created
attachment 385435
[details]
Patch
Michael Catanzaro
Comment 6
2019-12-11 14:07:05 PST
Comment on
attachment 385435
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=385435&action=review
> Source/cmake/FindOpenJPEG.cmake:58 > +set(OpenJPEG_VERSION ${PC_OPENJPEG_CFLAGS_VERSION})
This looks phony. ${PC_OPENJPEG_CFLAGS_VERSION}? Shouldn't it be: ${PC_OPENJPEG_VERSION}? If you have a FreeBSD or Linux box handy, might I suggest testing this part? ;)
> Source/cmake/OptionsGTK.cmake:375 > if (USE_OPENJPEG) > - find_package(OpenJPEG) > - if (NOT OpenJPEG_FOUND) > - message(FATAL_ERROR "libopenjpeg is needed for USE_OPENJPEG.") > - endif () > - if ("${OPENJPEG_MAJOR_VERSION}.${OPENJPEG_MINOR_VERSION}.${OPENJPEG_BUILD_VERSION}" VERSION_LESS "2.2.0") > - message(FATAL_ERROR "libopenjpeg 2.2.0 is required for USE_OPENJPEG.") > - endif () > + find_package(OpenJPEG 2.2.0 REQUIRED) > endif ()
The reason we write it out longways, instead of passing REQUIRED to find_package(), is to make the error less-confusing. The intent is for the error message to point to the USE_OPENJPEG build option so that you can just disable that if you don't want OpenJPEG support. But when you pass REQUIRED to find_package(), the error message doesn't indicate that OpenJPEG is optional. So I'd rather keep the long error messages and not use REQUIRED in OptionsGTK.cmake/OptionsWPE.cmake. BTW I think the bug as reported is invalid. Here we clearly fail if OpenJPEG version is below 2.2.0 and succeed otherwise. Maybe there's something wrong somewhere that I don't see, but I don't think it's here? Anyway, r+ anyway because I like targets, assuming you rename the change and keep the long error messages instead of switching to find_package(..., REQUIRED).
Michael Catanzaro
Comment 7
2019-12-11 14:11:09 PST
Comment on
attachment 385435
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=385435&action=review
> Source/cmake/FindOpenJPEG.cmake:89 > +if ("${OpenJPEG_FIND_VERSION}" VERSION_GREATER "${OpenJPEG_VERSION}") > + message(FATAL_ERROR "Required version (" ${OpenJPEG_FIND_VERSION} ") is higher than found version (" ${OpenJPEG_VERSION} ")") > +endif ()
Maybe mention "OpenJPEG" in the error message. Also: what if it's not used with REQUIRED? Shouldn't be fatal in that case.
Don Olmstead
Comment 8
2019-12-11 14:43:20 PST
Comment hidden (obsolete)
Created
attachment 385443
[details]
Patch
Don Olmstead
Comment 9
2019-12-11 14:44:30 PST
Comment hidden (obsolete)
Created
attachment 385444
[details]
Patch
Michael Catanzaro
Comment 10
2019-12-11 14:52:51 PST
Comment on
attachment 385444
[details]
Patch LGTM
WebKit Commit Bot
Comment 11
2019-12-11 16:54:44 PST
Comment on
attachment 385444
[details]
Patch Clearing flags on attachment: 385444 Committed
r253406
: <
https://trac.webkit.org/changeset/253406
>
WebKit Commit Bot
Comment 12
2019-12-11 16:54:46 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug