~ubuntu-branches/ubuntu/utopic/sikuli/utopic

« back to all changes in this revision

Viewing changes to .pc/tess3.patch/cmake_modules/FindTesseract.cmake

  • Committer: Package Import Robot
  • Author(s): Gilles Filippini
  • Date: 2012-02-15 15:17:58 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120215151758-0waq2g0irnska3jf
Tags: 1.0~x~rc3.tesseract3-dfsg1-1
* Merge with the feature/tesseract3 branch from upstream
* debian/control: Build-Depends: libtesseract-dev instead of
  deprecated tesseract-ocr-dev (Closes: #659598)
* The upstream source code repository moved to github

* New patch:
  + tess3.patch:
    - Fix build with tesseract3
    - use OCR strategie OEM_TESSERACT_ONLY for now. Upstream has
      reported a 4x slowdown when using OEM_TESSERACT_CUBE_COMBINED
* Patch fix-cmake-sikuli-ide.patch:
  + Add a DEP3 style description
* debian/copyright:
  + Update DEP5 Format URL
  + Bump copyright years

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Try to find Tesseract-OCR 3.00 (not for 2.04)
 
2
# Once done, this will define
 
3
#
 
4
#  Tesseract_FOUND - system has Tesseract
 
5
#  Tesseract_INCLUDE_DIRS - the Tesseract include directories
 
6
#  Tesseract_LIBRARIES - link these to use Tesseract
 
7
 
 
8
find_path(Tesseract_DIR "include/tesseract/baseapi.h" DOC "Root directory of Tesseract-OCR")
 
9
 
 
10
include(LibFindMacros)
 
11
 
 
12
# Use pkg-config to get hints about paths
 
13
libfind_pkg_check_modules(Tesseract_PKGCONF Tesseract)
 
14
 
 
15
# Include dir
 
16
find_path(Tesseract_INCLUDE_DIR
 
17
  NAMES tesseract/baseapi.h
 
18
  HINTS "${Tesseract_DIR}/include"
 
19
        "/usr/include"
 
20
        "/usr/local/include"
 
21
        ${Tesseract_PKGCONF_INCLUDE_DIRS}
 
22
)
 
23
 
 
24
SET(TESSERACT_COMPONENTS 
 
25
   api cutil textord ccstruct dict training ccutil 
 
26
   image viewer classify main wordrec
 
27
)
 
28
 
 
29
FOREACH(LIB ${TESSERACT_COMPONENTS})
 
30
   find_library(Tesseract_${LIB}_LIBRARY
 
31
      NAMES   libtesseract_${LIB}.a
 
32
      HINTS "${Tesseract_DIR}/lib"
 
33
      "/usr/lib"
 
34
      "/usr/local/lib"
 
35
      ${Tesseract_PKGCONF_LIBRARY_DIRS}
 
36
   )
 
37
 
 
38
   set(Tesseract_LIBRARY ${Tesseract_LIBRARY} ${Tesseract_${LIB}_LIBRARY})
 
39
ENDFOREACH(LIB ${TESSERACT_COMPONENTS})
 
40
 
 
41
 
 
42
# Set the include dir variables and the libraries and let libfind_process do the rest.
 
43
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
 
44
set(Tesseract_PROCESS_INCLUDES Tesseract_INCLUDE_DIR Tesseract_INCLUDE_DIRS)
 
45
set(Tesseract_PROCESS_LIBS Tesseract_LIBRARY Tesseract_LIBRARIES)
 
46
libfind_process(Tesseract)
 
47