tesseract compile issue: leptonica_OUTPUT_NAME is not set

99封情书 提交于 2019-12-12 03:27:21

问题


I am trying to compile the source code of Tesseract Open Source OCR Engine (https://github.com/tesseract-ocr/tesseract).

But when running cmake, I always get the following error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: leptonica_OUTPUT_NAME linked by target "libtesseract" in directory /home/test/github/tesseract

I have already downloaded the source code of leptonica (http://www.leptonica.com/download.html) and installed it.

I am wondering which value should I set to leptonica_OUTPUT_NAME.


回答1:


I ran into the same problem. It seems that

find_package(PkgConfig REQUIRED)
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})

in CMakeLists.txt has problems finding leptonica whereas cmake's find_package just works fine:

if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.cppan)
#    if (NOT Leptonica_DIR AND NOT MSVC)
#        find_package(PkgConfig REQUIRED)
#        pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
#    else()
        find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
#    endif()
else()

For completeness (both compiled from sources):

  • tesseract 4.00.00alpha
  • leptonica-1.74.4


来源:https://stackoverflow.com/questions/44985637/tesseract-compile-issue-leptonica-output-name-is-not-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!