[leptonica] Update to 1.80.0 (#14125)

This commit is contained in:
Phoebe 2020-10-22 08:42:47 +08:00 committed by GitHub
parent b1dea7104f
commit aff62d3487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 67 deletions

View File

@ -1,5 +1,5 @@
Source: leptonica
Version: 1.78.0-1
Version: 1.80.0
Homepage: https://github.com/DanBloomberg/leptonica
Description: An open source library containing software that is broadly useful for image processing and image analysis applications
Build-Depends: libjpeg-turbo, zlib, libpng, tiff, giflib, libwebp

View File

@ -1,19 +1,19 @@
diff --git a/cmake/templates/LeptonicaConfig.cmake.in b/cmake/templates/LeptonicaConfig.cmake.in
index 4f7527a..c6759d1 100644
--- a/cmake/templates/LeptonicaConfig.cmake.in
+++ b/cmake/templates/LeptonicaConfig.cmake.in
@@ -20,6 +20,14 @@
#
# ===================================================================================
+include(CMakeFindDependencyMacro)
+find_dependency(TIFF)
+find_dependency(ZLIB)
+find_dependency(PNG)
+find_dependency(JPEG)
+find_dependency(GIF)
+find_dependency(WebP)
+
include(${CMAKE_CURRENT_LIST_DIR}/LeptonicaTargets.cmake)
# ======================================================
diff --git a/cmake/templates/LeptonicaConfig.cmake.in b/cmake/templates/LeptonicaConfig.cmake.in
index 342c37d..b358b7b 100644
--- a/cmake/templates/LeptonicaConfig.cmake.in
+++ b/cmake/templates/LeptonicaConfig.cmake.in
@@ -20,6 +20,14 @@
#
# ===================================================================================
+include(CMakeFindDependencyMacro)
+find_dependency(TIFF)
+find_dependency(ZLIB)
+find_dependency(PNG)
+find_dependency(JPEG)
+find_dependency(GIF)
+find_dependency(WebP)
+
include(${CMAKE_CURRENT_LIST_DIR}/LeptonicaTargets.cmake)
# ======================================================

View File

@ -1,12 +1,12 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 945100a..6daad98 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,6 @@ if (MSVC)
set_source_files_properties(${src} PROPERTIES LANGUAGE CXX)
endif()
-string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
add_library (leptonica ${LIBRARY_TYPE} ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION ${VERSION_PLAIN})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e474463..d2b999d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,6 @@ if (MSVC)
set_source_files_properties(${src} PROPERTIES LANGUAGE CXX)
endif()
-string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
add_library (leptonica ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION ${VERSION_PLAIN})

View File

@ -1,14 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index debc232..2aa2d3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,8 +60,7 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.cppan)
endif()
if(NOT WEBP)
message(STATUS "Looking for WEBP")
- find_path(WEBP_INCLUDE_DIR /webp/decode.h)
- find_library(WEBP_LIBRARY NAMES webp)
+ find_package(WebP CONFIG REQUIRED)
if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
set(WEBP 1)
set(WEBP_FOUND TRUE)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6535632..1740841 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,8 +70,7 @@ if(NOT SW_BUILD)
pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)
endif()
if(NOT WEBP)
- find_path(WEBP_INCLUDE_DIR /webp/decode.h)
- find_library(WEBP_LIBRARY NAMES webp)
+ find_package(WebP CONFIG REQUIRED)
if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
set(WEBP 1)
set(WEBP_FOUND TRUE)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d2b999d..019ec7b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -52,7 +52,7 @@ if (TIFF_LIBRARIES)
endif()
if (WEBP_FOUND)
target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS})
- target_link_libraries (leptonica ${WEBP_LIBRARIES})
+ target_link_libraries (leptonica WebP::webp WebP::libwebpmux)
endif()
if (ZLIB_LIBRARIES)
target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIRS})

View File

@ -1,14 +1,11 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO DanBloomberg/leptonica
REF 87b8219360bca3c9929a5705c3d9c50c42c34bca #1.78.0
SHA512 b7bfa9437be7e3d9276acacf8f62ccda1cd8f88741ada5106ef0232d4965617be2c5d0b8a6b4462896a1a0b6b44d9ecefd6e6b8d0e50d4fb881bdf5e821703a4
REF 1ac72c93fef1a5eb76b76d6723d2aee843dd6e51 # 1.80.0
SHA512 d6d1af744691b70601b9f3d292d4593c36d392bcfd9e4c190fd533c2df40fcedfc226868429c25fad9b54c8ed68b61750832c9984c47ff72fc702dd3c3f438d6
HEAD_REF master
PATCHES
fix-cmakelists.patch
use-tiff-libraries.patch
find-dependency.patch
fix-find-libwebp.patch
)
@ -19,6 +16,7 @@ vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DSW_BUILD=OFF
-DSTATIC=${STATIC}
-DCMAKE_REQUIRED_INCLUDES=${CURRENT_INSTALLED_DIR}/include # for check_include_file()
)
@ -31,6 +29,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/leptonica-license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/leptonica-license.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
file(INSTALL ${SOURCE_PATH}/leptonica-license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -1,13 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6daad98..5119895 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -48,7 +48,7 @@ if (PNG_LIBRARY)
endif()
if (TIFF_LIBRARY)
target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR})
- target_link_libraries (leptonica ${TIFF_LIBRARY})
+ target_link_libraries (leptonica ${TIFF_LIBRARIES})
endif()
if (WEBP_FOUND)
target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS})