leptonica/leptonica_cmake.patch

78 lines
3.9 KiB
Diff
Raw Normal View History

2024-01-05 11:24:56 +00:00
diff -rupN --no-dereference leptonica-1.84.1/CMakeLists.txt leptonica-1.84.1-new/CMakeLists.txt
--- leptonica-1.84.1/CMakeLists.txt 2024-01-03 01:03:10.000000000 +0100
+++ leptonica-1.84.1-new/CMakeLists.txt 2024-01-05 12:23:14.492871244 +0100
2023-12-24 11:10:04 +00:00
@@ -71,7 +71,7 @@ option(ENABLE_WEBP "Enable WebP support"
option(ENABLE_OPENJPEG "Enable OpenJPEG support" ON)
2022-02-24 14:45:04 +00:00
2022-12-21 14:25:46 +00:00
set(leptonica_INSTALL_CMAKE_DIR
- "lib/cmake/leptonica"
+ "lib${LIB_SUFFIX}/cmake/leptonica"
2022-02-24 14:45:04 +00:00
CACHE STRING "Install destination for CMake package files")
if(NOT SW_BUILD)
2023-12-24 11:10:04 +00:00
@@ -358,7 +358,7 @@ configure_file(lept.pc.cmake ${CMAKE_CUR
# to resolve generator expression in OUTPUT_NAME
file(
GENERATE
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lept_$<CONFIG>.pc
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lept.pc
INPUT ${CMAKE_CURRENT_BINARY_DIR}/lept.pc.in)
configure_file(
@@ -368,8 +368,8 @@ configure_file(
2022-12-21 14:25:46 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/LeptonicaConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake @ONLY)
2022-02-24 14:45:04 +00:00
2023-12-24 11:10:04 +00:00
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lept_$<CONFIG>.pc
- DESTINATION lib/pkgconfig)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lept.pc
+ DESTINATION lib${LIB_SUFFIX}/pkgconfig)
2022-12-21 14:25:46 +00:00
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig-version.cmake
DESTINATION ${leptonica_INSTALL_CMAKE_DIR})
2024-01-05 11:24:56 +00:00
diff -rupN --no-dereference leptonica-1.84.1/prog/CMakeLists.txt leptonica-1.84.1-new/prog/CMakeLists.txt
--- leptonica-1.84.1/prog/CMakeLists.txt 2024-01-03 01:03:10.000000000 +0100
+++ leptonica-1.84.1-new/prog/CMakeLists.txt 2024-01-05 12:23:14.495871319 +0100
2023-12-24 11:10:04 +00:00
@@ -12,7 +12,7 @@ function(add_prog_target target)
if (BUILD_SHARED_LIBS)
target_compile_definitions (${target} PRIVATE -DLIBLEPT_IMPORTS)
endif()
- target_link_libraries (${target} leptonica)
+ target_link_libraries (${target} leptonica m)
set_target_properties (${target} PROPERTIES FOLDER prog)
endfunction(add_prog_target)
########################################
2024-01-05 11:24:56 +00:00
diff -rupN --no-dereference leptonica-1.84.1/src/CMakeLists.txt leptonica-1.84.1-new/src/CMakeLists.txt
--- leptonica-1.84.1/src/CMakeLists.txt 2024-01-03 01:03:10.000000000 +0100
+++ leptonica-1.84.1-new/src/CMakeLists.txt 2024-01-05 12:23:14.499871419 +0100
@@ -16,7 +16,10 @@ string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS
2023-12-24 11:10:04 +00:00
add_library (leptonica ${src} ${hdr})
2022-12-21 14:25:46 +00:00
set_target_properties (leptonica PROPERTIES VERSION 6.0.0)
set_target_properties (leptonica PROPERTIES SOVERSION 6)
2023-12-24 11:10:04 +00:00
-set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica$<$<BOOL:${WIN32}>:-${PROJECT_VERSION}$<$<CONFIG:DEBUG>:d>>)
+set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica)
2023-12-24 11:10:04 +00:00
+if(MINGW)
2022-12-21 14:25:46 +00:00
+set_target_properties (leptonica PROPERTIES SUFFIX "-6${CMAKE_SHARED_LIBRARY_SUFFIX}")
2023-12-24 11:10:04 +00:00
+endif(MINGW)
if (BUILD_SHARED_LIBS)
target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS)
@@ -66,7 +69,7 @@ if (UNIX)
2022-02-24 14:45:04 +00:00
${CMAKE_COMMAND} -E create_symlink "$<TARGET_FILE:leptonica>" ${old_target}
DEPENDS ${PROJECT_NAME}
COMMENT "Creating lept symlink")
- install(FILES ${CMAKE_BINARY_DIR}/src/${old_target} DESTINATION lib)
+ install(FILES ${CMAKE_BINARY_DIR}/src/${old_target} DESTINATION lib${LIB_SUFFIX})
endif(SYM_LINK)
endif()
@@ -89,7 +92,7 @@ else()
2022-02-24 14:45:04 +00:00
export(TARGETS leptonica APPEND FILE ${CMAKE_BINARY_DIR}/LeptonicaTargets.cmake)
endif()
-install(TARGETS leptonica EXPORT LeptonicaTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+install(TARGETS leptonica EXPORT LeptonicaTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
install(EXPORT LeptonicaTargets DESTINATION ${leptonica_INSTALL_CMAKE_DIR})
install(FILES
${hdr}