Skip to content

Commit

Permalink
Download icu on windows to build set_unicharset_properties target.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Nov 30, 2015
1 parent f3b20a0 commit f15cd96
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ set(Leptonica_DIR ${Leptonica_BUILD_DIR})
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
endif()

find_package(ICU COMPONENTS uc i18n)
find_package(OpenCL QUIET)
find_package(PkgConfig)

Expand Down Expand Up @@ -220,6 +219,7 @@ set(tesseractmain_src
)
add_executable (tesseractmain ${tesseractmain_src})
target_link_libraries (tesseractmain tesseract)
set_target_properties (tesseractmain PROPERTIES OUTPUT_NAME tesseract)

########################################

Expand Down
48 changes: 48 additions & 0 deletions training/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@

if (STATIC OR NOT (WIN32 OR CYGWIN))

# experimental
if (MSVC)

include(CheckTypeSize)
check_type_size("void *" SIZEOF_VOID_P)

if (SIZEOF_VOID_P EQUAL 8)
set(X64 1)
set(ARCH_DIR_NAME 64)
elseif (SIZEOF_VOID_P EQUAL 4)
set(X86 1)
set(ARCH_DIR_NAME 32)
else()
message(FATAL_ERROR "Cannot determine target architecture")
endif()

set(icu_dir "${CMAKE_CURRENT_BINARY_DIR}/icu")
set(icu_archive "${icu_dir}/icu${ARCH_DIR_NAME}.zip")

if (X86)
set(icu_hash 45167a240b60e36b59a87eda23490ce4)
else()
set(icu_hash 480c72491576c048de1218c3c5519399)
endif()

message(STATUS "Downloading latest ICU binaries")

file(DOWNLOAD
"http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-Win${ARCH_DIR_NAME}-msvc10.zip"
"${icu_archive}"
SHOW_PROGRESS
EXPECTED_HASH MD5=${icu_hash}
)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xz "${icu_archive}"
WORKING_DIRECTORY "${icu_dir}"
RESULT_VARIABLE __result
)
if(NOT __result EQUAL 0)
message(FATAL_ERROR "error ${__result}")
endif()

set(ICU_ROOT ${icu_dir}/icu)

endif(MSVC)
# experimental

find_package(ICU COMPONENTS uc i18n)

########################################
# LIBRARY tessopt
########################################
Expand Down

0 comments on commit f15cd96

Please sign in to comment.