vcpkg/ports/tesseract/portfile.cmake
Stefano Sinigardi a9303736fd [LibLZMA] automatic configuration (#6000)
* [LibLZMA] add a config-generated by CMake

* bump control files of LibLZMA and dependent ports

* [tiff] use proper liblzma target
[OpenCV] add an explicit dependency on LibLZMA for static linking

* [liblzma] fix header install path

* [LibLZMA] avoid using targets in old symbols

* fixes for windows-static and trying to see if CI is happier with a share/lib folder written in lowercase

* [LibLZMA] use only modern CMake language, remove patch in favour of target public definition

* [lzma] put symbols in cmake cache

* [libxmlpp] remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS regression

* [lzma] fix header install path

* [liblzma] install wrapper to force config mode

* [liblzma] remove function check inside cmake config since we know it will pass

* [liblzma] wrapper fix

* [tiff,geotiff] general cleanup and patch fixes

* [libgeotiff] remove debug tools

* [tesseract] modernize

* [tiff] fix also tiff_library symbol

* [pdal,libgeotiff] better library integration

* [tiff] restore using unix i/o on UWP, since it was working... for sure win32 one cannot work

* [tiff] enable lzma also on uwp, since it works and is requested by many dependencies

* [selene] enable build on arm/arm64-windows, which was surely broken before

* [lzma] uniform naming with cmake 3.14

* [podofo] fix regression, it requires openssl which was disabled in dependencies

* [many ports] remove unnecessary mods

* [boost-iostream] chmod

* [openssl] fix regression due to missing architecture

* [podofo] fix regression on uwp due to missing include

* [libpq] explicitly fail on UWP, it should avoid being marked as regression

* [shiva] fix regression on linux
2019-05-28 16:58:00 -07:00

48 lines
1.5 KiB
CMake

include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO tesseract-ocr/tesseract
REF 4.0.0
SHA512 69e57d4ba1fc43d212fd0fff69a2b5d48a3b37cfee7054fdc083cbb7e04d92317609a32e457229661d70ce8d9b16c9d25e81bfc3861db660dd2c8f292202d447
HEAD_REF master
PATCHES
use-vcpkg-icu.patch
ws2-32.patch
leptonica.patch
)
# The built-in cmake FindICU is better
file(REMOVE ${SOURCE_PATH}/cmake/FindICU.cmake)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DSTATIC=ON
-DUSE_SYSTEM_ICU=True
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")
# Install tool
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/tesseract)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/tesseract.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/tesseract)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/tesseract)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tesseract)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/tesseract/LICENSE ${CURRENT_PACKAGES_DIR}/share/tesseract/copyright)