Title: [255550] trunk
Revision
255550
Author
[email protected]
Date
2020-02-02 08:51:41 -0800 (Sun, 02 Feb 2020)

Log Message

[CMake] Use opj_config.h to find OpenJPEG include directory
https://bugs.webkit.org/show_bug.cgi?id=207100

Patch by Ting-Wei Lan <[email protected]> on 2020-02-02
Reviewed by Konstantin Tokarev.

WebKit needs OpenJPEG 2.2.0 or later versions, but it is possible for a
system to have both OpenJPEG 1 and OpenJPEG 2 installed. However, some
distributions do not put OpenJPEG 1 under a versioned directory and
put its header file directly under /usr/include or /usr/local/include.
Since CMake prefers its prefixes to paths given in HINTS, it is possible
that openjpeg.h from OpenJPEG 1 is found before the one from OpenJPEG 2,
causing WebKit to fail to build because of using the wrong header file.

Resolve the problem by checking opj_config.h instead of openjpeg.h.
OpenJPEG 1.5 does not have opj_config.h, so only OpenJPEG 2 can be
found. This also makes it consistent with the code below which already
uses opj_config.h.

* Source/cmake/FindOpenJPEG.cmake:

Modified Paths

Diff

Modified: trunk/ChangeLog (255549 => 255550)


--- trunk/ChangeLog	2020-02-02 10:20:09 UTC (rev 255549)
+++ trunk/ChangeLog	2020-02-02 16:51:41 UTC (rev 255550)
@@ -1,3 +1,25 @@
+2020-02-02  Ting-Wei Lan  <[email protected]>
+
+        [CMake] Use opj_config.h to find OpenJPEG include directory
+        https://bugs.webkit.org/show_bug.cgi?id=207100
+
+        Reviewed by Konstantin Tokarev.
+
+        WebKit needs OpenJPEG 2.2.0 or later versions, but it is possible for a
+        system to have both OpenJPEG 1 and OpenJPEG 2 installed. However, some
+        distributions do not put OpenJPEG 1 under a versioned directory and
+        put its header file directly under /usr/include or /usr/local/include.
+        Since CMake prefers its prefixes to paths given in HINTS, it is possible
+        that openjpeg.h from OpenJPEG 1 is found before the one from OpenJPEG 2,
+        causing WebKit to fail to build because of using the wrong header file.
+
+        Resolve the problem by checking opj_config.h instead of openjpeg.h.
+        OpenJPEG 1.5 does not have opj_config.h, so only OpenJPEG 2 can be
+        found. This also makes it consistent with the code below which already
+        uses opj_config.h.
+
+        * Source/cmake/FindOpenJPEG.cmake:
+
 2020-01-31  Don Olmstead  <[email protected]>
 
         [CMake] Add _PRIVATE_LIBRARIES to framework

Modified: trunk/Source/cmake/FindOpenJPEG.cmake (255549 => 255550)


--- trunk/Source/cmake/FindOpenJPEG.cmake	2020-02-02 10:20:09 UTC (rev 255549)
+++ trunk/Source/cmake/FindOpenJPEG.cmake	2020-02-02 16:51:41 UTC (rev 255550)
@@ -58,7 +58,7 @@
 set(OpenJPEG_VERSION ${PC_OPENJPEG_VERSION})
 
 find_path(OpenJPEG_INCLUDE_DIR
-    NAMES openjpeg.h
+    NAMES opj_config.h
     HINTS ${PC_OPENJPEG_INCLUDEDIR} ${PC_OPENJPEG_INCLUDE_DIRS}
 )
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to