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 @@ -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_$.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_$.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.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 @@ -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.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 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$<$:-${PROJECT_VERSION}$<$: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 "$" ${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}