-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#4849) leptonica: fix CMake imported target + honor options + add wi…
…th_zlib option * refactoring of leptonica recipe - add with_zlib option - use classic CMake wrapper - rely on pkgconf for openjpeg & libwep dependencies, it's more robust - do not use CMAKE_DISABLE_FIND_PACKAGE_<LIB> to honor options, it's too fragile and might break due to find_package required in find module of others dependencies also requiring those libs - several cosmetic changes * move fixes specific to 1.78.0 in a patch * fix CMake imported target * more agressive patch for openjpeg & libwebp avoid to enable openjpeg or libwebp if found in system, but options disabled by consumers * fix dependencies injection again - be sure to inject dependencies definitions - use pkg_config only for libwebp & openjpeg
- Loading branch information
Showing
7 changed files
with
226 additions
and
107 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(cmake_wrapper) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
include(conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
include("CMakeListsOriginal.txt") | ||
add_subdirectory(source_subfolder) |
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
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
48 changes: 48 additions & 0 deletions
48
recipes/leptonica/all/patches/fix-find-modules-variables.patch
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,48 @@ | ||
see https://github.com/DanBloomberg/leptonica/pull/456 | ||
|
||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -31,33 +31,33 @@ if (NOT STATIC) | ||
target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS) | ||
endif() | ||
|
||
-if (GIF_LIBRARY) | ||
+if (GIF_LIBRARIES) | ||
target_include_directories (leptonica PUBLIC ${GIF_INCLUDE_DIR}) | ||
- target_link_libraries (leptonica ${GIF_LIBRARY}) | ||
+ target_link_libraries (leptonica ${GIF_LIBRARIES}) | ||
endif() | ||
-if (JPEG_LIBRARY) | ||
+if (JPEG_LIBRARIES) | ||
target_include_directories (leptonica PUBLIC ${JPEG_INCLUDE_DIR}) | ||
- target_link_libraries (leptonica ${JPEG_LIBRARY}) | ||
+ target_link_libraries (leptonica ${JPEG_LIBRARIES}) | ||
endif() | ||
if (JP2K_FOUND) | ||
target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIRS}) | ||
target_link_libraries (leptonica ${JP2K_LIBRARIES}) | ||
endif() | ||
-if (PNG_LIBRARY) | ||
+if (PNG_LIBRARIES) | ||
target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS}) | ||
- target_link_libraries (leptonica ${PNG_LIBRARY}) | ||
+ target_link_libraries (leptonica ${PNG_LIBRARIES}) | ||
endif() | ||
-if (TIFF_LIBRARY) | ||
+if (TIFF_LIBRARIES) | ||
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}) | ||
target_link_libraries (leptonica ${WEBP_LIBRARIES}) | ||
endif() | ||
-if (ZLIB_LIBRARY) | ||
+if (ZLIB_LIBRARIES) | ||
target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIR}) | ||
- target_link_libraries (leptonica ${ZLIB_LIBRARY}) | ||
+ target_link_libraries (leptonica ${ZLIB_LIBRARIES}) | ||
endif() | ||
|
||
if (UNIX) |
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package) | ||
project(test_package C) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
conan_basic_setup(TARGETS) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) | ||
find_package(Leptonica REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.c) | ||
target_link_libraries(${PROJECT_NAME} leptonica) |
Oops, something went wrong.