Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graphics/leptonica: fix build with openjpeg 2.5.0
ChangeLog: DanBloomberg/leptonica#623 Fix detection of openjpeg 2.5.0 PR: 264684 Reported by: vvd@unislabs.com Approved by: hiroto.kagotani@gmail.com (maintainer, timeout > 1 month)
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
diff -u CMakeLists.txt.orig CMakeLists.txt | ||
--- CMakeLists.txt.orig | ||
+++ CMakeLists.txt | ||
@@ -141,6 +141,17 @@ | ||
set(HAVE_LIBJP2K 1) | ||
endif() | ||
endif() | ||
+ if(NOT JP2K) | ||
+ find_path(JP2K_INCLUDE_DIR /openjpeg-2.5/openjpeg.h) | ||
+ find_library(JP2K_LIBRARY NAMES openjp2) | ||
+ if (JP2K_INCLUDE_DIR AND JP2K_LIBRARY) | ||
+ set(JP2K 1) | ||
+ set(JP2K_FOUND TRUE) | ||
+ set(JP2K_LIBRARIES ${JP2K_LIBRARY}) | ||
+ set(JP2K_INCLUDE_DIRS ${JP2K_INCLUDE_DIR}) | ||
+ set(HAVE_LIBJP2K 1) | ||
+ endif() | ||
+ endif() | ||
set(libs_private "${libs_private} -lopenjp2") | ||
endif() | ||
endif() | ||
diff -u cmake/Configure.cmake.orig cmake/Configure.cmake | ||
--- cmake/Configure.cmake.orig | ||
+++ cmake/Configure.cmake | ||
@@ -69,6 +69,7 @@ | ||
openjpeg-2.2/openjpeg.h | ||
openjpeg-2.3/openjpeg.h | ||
openjpeg-2.4/openjpeg.h | ||
+ openjpeg-2.5/openjpeg.h | ||
) | ||
check_includes(include_files_list) | ||
|
||
@@ -146,7 +147,9 @@ | ||
/* Define to 1 if you have zlib. */ | ||
#cmakedefine HAVE_LIBZ 1 | ||
|
||
-#if defined(HAVE_OPENJPEG_2_4_OPENJPEG_H) | ||
+#if defined(HAVE_OPENJPEG_2_5_OPENJPEG_H) | ||
+#define LIBJP2K_HEADER <openjpeg-2.5/openjpeg.h> | ||
+#elif defined(HAVE_OPENJPEG_2_4_OPENJPEG_H) | ||
#define LIBJP2K_HEADER <openjpeg-2.4/openjpeg.h> | ||
#elif defined(HAVE_OPENJPEG_2_3_OPENJPEG_H) | ||
#define LIBJP2K_HEADER <openjpeg-2.3/openjpeg.h> | ||
diff -u config/config.h.in.orig config/config.h.in | ||
--- config/config.h.in.orig | ||
+++ config/config.h.in | ||
@@ -51,6 +51,12 @@ | ||
/* Define to 1 if you have the <openjpeg-2.3/openjpeg.h> header file. */ | ||
#undef HAVE_OPENJPEG_2_3_OPENJPEG_H | ||
|
||
+/* Define to 1 if you have the <openjpeg-2.4/openjpeg.h> header file. */ | ||
+#undef HAVE_OPENJPEG_2_4_OPENJPEG_H | ||
+ | ||
+/* Define to 1 if you have the <openjpeg-2.5/openjpeg.h> header file. */ | ||
+#undef HAVE_OPENJPEG_2_5_OPENJPEG_H | ||
+ | ||
/* Define to 1 if you have the <stdint.h> header file. */ | ||
#undef HAVE_STDINT_H | ||
|