leptonica/leptonica_cmake.patch
2023-12-27 15:33:38 +01:00

78 lines
3.9 KiB
Diff

diff -rupN --no-dereference leptonica-1.84.0-orig/CMakeLists.txt leptonica-1.84.0/CMakeLists.txt
--- leptonica-1.84.0-orig/CMakeLists.txt 2023-12-24 09:24:30.000000000 +0100
+++ leptonica-1.84.0/CMakeLists.txt 2023-12-27 13:49:02.576324545 +0100
@@ -71,7 +71,7 @@ option(ENABLE_WEBP "Enable WebP support"
option(ENABLE_OPENJPEG "Enable OpenJPEG support" ON)
set(leptonica_INSTALL_CMAKE_DIR
- "lib/cmake/leptonica"
+ "lib${LIB_SUFFIX}/cmake/leptonica"
CACHE STRING "Install destination for CMake package files")
if(NOT SW_BUILD)
@@ -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(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/LeptonicaConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake @ONLY)
-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)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig-version.cmake
DESTINATION ${leptonica_INSTALL_CMAKE_DIR})
diff -rupN --no-dereference leptonica-1.84.0-orig/prog/CMakeLists.txt leptonica-1.84.0/prog/CMakeLists.txt
--- leptonica-1.84.0-orig/prog/CMakeLists.txt 2023-12-24 09:24:30.000000000 +0100
+++ leptonica-1.84.0/prog/CMakeLists.txt 2023-12-27 13:49:02.576324545 +0100
@@ -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)
########################################
diff -rupN --no-dereference leptonica-1.84.0-orig/src/CMakeLists.txt leptonica-1.84.0/src/CMakeLists.txt
--- leptonica-1.84.0-orig/src/CMakeLists.txt 2023-12-24 09:24:30.000000000 +0100
+++ leptonica-1.84.0/src/CMakeLists.txt 2023-12-27 14:34:36.751976070 +0100
@@ -16,7 +16,10 @@ string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS
add_library (leptonica ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION 6.0.0)
set_target_properties (leptonica PROPERTIES SOVERSION 6)
-set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica$<$<BOOL:${WIN32}>:-${PROJECT_VERSION}$<$<CONFIG:DEBUG>:d>>)
+set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica)
+if(MINGW)
+set_target_properties (leptonica PROPERTIES SUFFIX "-6${CMAKE_SHARED_LIBRARY_SUFFIX}")
+endif(MINGW)
if (BUILD_SHARED_LIBS)
target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS)
@@ -66,7 +69,7 @@ if (UNIX)
${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()
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}