0

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.

camino
  • 10,085
  • 20
  • 64
  • 115
  • 2
    There is a workaround that: replacing all leptonica_OUTPUT_NAME-NOTFOUND to leptonica for file CMakeCache.txt – camino Jul 08 '17 at 17:28

1 Answers1

2

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
holzkohlengrill
  • 1,044
  • 19
  • 29
  • I'm having the same issue, how does it know where to look for package leptonica??? Where do I add the folder name, and which folder from the leptonica sources do I need to add? – Mich Oct 02 '18 at 23:02