| # -*- mode: python; -*- |
| |
| # Description: |
| # tesseract build file. |
| |
| licenses(['notice']) # Apache 2.0 |
| |
| #----------------------------------------------------------------------------- |
| # LIBRARIES |
| |
| cc_library(name = "scrollview_lib", |
| srcs = [ "viewer/scrollview.cpp", |
| "viewer/svutil.cpp", |
| "viewer/svmnode.cpp" ], |
| deps = [ "//third_party/leptonica", |
| ], |
| includes = [ "third_party/leptonica/includes" ], |
| copts = [ "-DHAVE_LIBLEPT", |
| "-DSCROLLVIEW_PATH=/home/build/static/projects/ocr" ] |
| ) |
| |
| cc_library(name = "tesseract_cc_util", |
| srcs = [ "ccutil/basedir.cpp", |
| "ccutil/bits16.cpp", |
| "ccutil/boxread.cpp", |
| "ccutil/clst.cpp", |
| "ccutil/debugwin.cpp", |
| "ccutil/elst.cpp", |
| "ccutil/elst2.cpp", |
| "ccutil/errcode.cpp", |
| "ccutil/tessopt.cpp", |
| "ccutil/globaloc.cpp", |
| "ccutil/hashfn.cpp", |
| "ccutil/mainblk.cpp", |
| "ccutil/memblk.cpp", |
| "ccutil/memry.cpp", |
| "ccutil/ocrshell.cpp", |
| "ccutil/serialis.cpp", |
| "ccutil/strngs.cpp", |
| "ccutil/tprintf.cpp", |
| "ccutil/unichar.cpp", |
| "ccutil/unicharset.cpp", |
| "ccutil/unicharmap.cpp", |
| "ccutil/varable.cpp", |
| "ccutil/ccutil.cpp" ], |
| deps = [ ], |
| includes = [ "ccutil" |
| ]) |
| |
| cc_library(name = "tesseract_c_util", |
| srcs = [ "cutil/tessarray.cpp", |
| "cutil/bitvec.cpp", |
| "cutil/danerror.cpp", |
| "cutil/debug.cpp", |
| "cutil/efio.cpp", |
| "cutil/emalloc.cpp", |
| "cutil/freelist.cpp", |
| "cutil/globals.cpp", |
| "cutil/listio.cpp", |
| "cutil/oldheap.cpp", |
| "cutil/oldlist.cpp", |
| "cutil/structures.cpp", |
| "cutil/tordvars.cpp", |
| "cutil/cutil.cpp", |
| "cutil/variables.cpp", |
| "cutil/cutil_class.cpp" ], |
| deps = [ "tesseract_cc_util" ], |
| includes = [ "cutil", |
| "ccutil" |
| ]) |
| |
| cc_library(name = "tesseract_dict", |
| srcs = [ "dict/choices.cpp", |
| "dict/context.cpp", |
| "dict/conversion.cpp", |
| "dict/dawg.cpp", |
| "dict/dict.cpp", |
| "dict/hyphen.cpp", |
| "dict/permdawg.cpp", |
| "dict/permnum.cpp", |
| "dict/permngram.cpp", |
| "dict/permute.cpp", |
| "dict/states.cpp", |
| "dict/stopper.cpp", |
| "dict/reduce.cpp", |
| "dict/makedawg.cpp", |
| "dict/lookdawg.cpp", |
| "dict/trie.cpp", |
| "dict/wordfst.cpp", |
| "dict/patternfst.cpp", |
| "dict/fstmodel.cpp" ], |
| deps = [ "tesseract_c_util", |
| "tesseract_cc_struct", |
| "tesseract_cc_util", |
| "//third_party/libidn:idn", |
| "//third_party/icu:icu", |
| "//i18n/utf8", |
| "//nlp/fst/lib" ], |
| includes = [ "cutil", |
| "ccutil", |
| "ccstruct", |
| "dict" |
| ]) |
| |
| cc_library(name = "tesseract_aspirin", |
| srcs = [ "aspirin/bpsim.cpp", |
| "aspirin/bpsupport.cpp", |
| "aspirin/nmatch.cpp", |
| "aspirin/vanilla.cpp" ], |
| deps = [ "tesseract_c_util", |
| "tesseract_cc_util" ], |
| includes = [ "aspirin", |
| "ccutil", |
| "cutil" ], |
| # license with restrictions on commercial use, see LICENSE file |
| licenses = [ "by_exception_only" ], |
| ) |
| |
| cc_library(name = "tesseract_image", |
| srcs = ["image/image.cpp", |
| "image/imgbmp.cpp", |
| "image/imgio.cpp", |
| "image/imgs.cpp", |
| "image/imgtiff.cpp", |
| "image/bitstrm.cpp", |
| "image/svshowim.cpp", |
| ], |
| deps = [ "tesseract_cc_util", |
| "scrollview_lib", |
| "//third_party/leptonica" ], |
| includes = [ "ccutil", |
| "image", |
| "viewer", |
| "third_party/leptonica/includes" |
| ], |
| copts = [ "-DHAVE_LIBLEPT" ] |
| ) |
| |
| cc_library(name = "tesseract_cc_struct", |
| srcs = [ "ccstruct/blobbox.cpp", |
| "ccstruct/blobs.cpp", |
| "ccstruct/blread.cpp", |
| "ccstruct/callcpp.cpp", |
| "ccstruct/ccstruct.cpp", |
| "ccstruct/coutln.cpp", |
| "ccstruct/genblob.cpp", |
| "ccstruct/labls.cpp", |
| "ccstruct/linlsq.cpp", |
| "ccstruct/lmedsq.cpp", |
| "ccstruct/mod128.cpp", |
| "ccstruct/normalis.cpp", |
| "ccstruct/ocrblock.cpp", |
| "ccstruct/ocrrow.cpp", |
| "ccstruct/pageblk.cpp", |
| "ccstruct/pageres.cpp", |
| "ccstruct/pdblock.cpp", |
| "ccstruct/points.cpp", |
| "ccstruct/polyaprx.cpp", |
| "ccstruct/polyblk.cpp", |
| "ccstruct/polyblob.cpp", |
| "ccstruct/polyvert.cpp", |
| "ccstruct/poutline.cpp", |
| "ccstruct/quadlsq.cpp", |
| "ccstruct/quadratc.cpp", |
| "ccstruct/quspline.cpp", |
| "ccstruct/ratngs.cpp", |
| "ccstruct/rect.cpp", |
| "ccstruct/rejctmap.cpp", |
| "ccstruct/rwpoly.cpp", |
| "ccstruct/statistc.cpp", |
| "ccstruct/stepblob.cpp", |
| "ccstruct/txtregn.cpp", |
| "ccstruct/vecfuncs.cpp", |
| "ccstruct/werd.cpp" ], |
| deps = [ "tesseract_image", |
| "tesseract_c_util", |
| "tesseract_cc_util" ], |
| includes = [ "ccstruct", |
| "ccutil", |
| "cutil", |
| "image", |
| "viewer", |
| ] ) |
| |
| cc_library(name = "tesseract_classify", |
| srcs = [ "classify/adaptive.cpp", |
| "classify/adaptmatch.cpp", |
| "classify/baseline.cpp", |
| "classify/blobclass.cpp", |
| "classify/chartoname.cpp", |
| "classify/classify.cpp", |
| "classify/cluster.cpp", |
| "classify/clusttool.cpp", |
| "classify/cutoffs.cpp", |
| "classify/extract.cpp", |
| "classify/featdefs.cpp", |
| "classify/flexfx.cpp", |
| "classify/float2int.cpp", |
| "classify/fpoint.cpp", |
| "classify/fxdefs.cpp", |
| "classify/hideedge.cpp", |
| "classify/intfx.cpp", |
| "classify/intmatcher.cpp", |
| "classify/intproto.cpp", |
| "classify/kdtree.cpp", |
| "classify/mf.cpp", |
| "classify/mfdefs.cpp", |
| "classify/mfoutline.cpp", |
| "classify/mfx.cpp", |
| "classify/normfeat.cpp", |
| "classify/normmatch.cpp", |
| "classify/ocrfeatures.cpp", |
| "classify/outfeat.cpp", |
| "classify/picofeat.cpp", |
| "classify/protos.cpp", |
| "classify/sigmenu.cpp", |
| "classify/speckle.cpp", |
| "classify/xform2d.cpp" ], |
| deps = [ "tesseract_cc_struct", |
| "tesseract_dict", |
| "tesseract_c_util", |
| "tesseract_cc_util" ], |
| includes = [ "cutil", |
| "classify", |
| "ccutil", |
| "ccstruct", |
| "dict" |
| ]) |
| |
| cc_library(name = "tesseract_textord", |
| srcs = [ "textord/blkocc.cpp", |
| "textord/drawedg.cpp", |
| "textord/drawtord.cpp", |
| "textord/edgblob.cpp", |
| "textord/edgloop.cpp", |
| "textord/fpchop.cpp", |
| "textord/gap_map.cpp", |
| "textord/makerow.cpp", |
| "textord/oldbasel.cpp", |
| "textord/pagesegmain.cpp", |
| "textord/pithsync.cpp", |
| "textord/pitsync1.cpp", |
| "textord/scanedg.cpp", |
| "textord/sortflts.cpp", |
| "textord/topitch.cpp", |
| "textord/tordmain.cpp", |
| "textord/tospace.cpp", |
| "textord/tovars.cpp", |
| "textord/underlin.cpp", |
| "textord/wordseg.cpp" ], |
| deps = [ "tesseract_cc_struct", |
| "tesseract_image", |
| "tesseract_cc_util", |
| "tesseract_pageseg" ], |
| includes = [ "ccstruct", |
| "wordrec", |
| "ccutil", |
| "dict", |
| "classify", |
| "image", |
| "viewer", |
| "pageseg" |
| ] ) |
| |
| cc_library(name = "tesseract_wordrec", |
| srcs = [ "wordrec/associate.cpp", |
| "wordrec/badwords.cpp", |
| "wordrec/bestfirst.cpp", |
| "wordrec/chop.cpp", |
| "wordrec/chopper.cpp", |
| "wordrec/closed.cpp", |
| "wordrec/djmenus.cpp", |
| "wordrec/drawfx.cpp", |
| "wordrec/findseam.cpp", |
| "wordrec/gradechop.cpp", |
| "wordrec/heuristic.cpp", |
| "wordrec/makechop.cpp", |
| "wordrec/matchtab.cpp", |
| "wordrec/matrix.cpp", |
| "wordrec/metrics.cpp", |
| "wordrec/mfvars.cpp", |
| "wordrec/msmenus.cpp", |
| "wordrec/olutil.cpp", |
| "wordrec/outlines.cpp", |
| "wordrec/pieces.cpp", |
| "wordrec/plotedges.cpp", |
| "wordrec/plotseg.cpp", |
| "wordrec/render.cpp", |
| "wordrec/seam.cpp", |
| "wordrec/split.cpp", |
| "wordrec/tally.cpp", |
| "wordrec/tessinit.cpp", |
| "wordrec/tface.cpp", |
| "wordrec/wordclass.cpp", |
| "wordrec/wordrec.cpp" ], |
| deps = [ "tesseract_cc_struct", |
| "tesseract_classify", |
| "tesseract_image", |
| "tesseract_dict", |
| "tesseract_c_util", |
| "tesseract_cc_util" ], |
| includes = [ "ccstruct", |
| "ccutil", |
| "cutil", |
| "cstruct", |
| "classify", |
| "image", |
| "dict", |
| "viewer", |
| ] ) |
| |
| cc_library(name = "tesseract_pageseg", |
| srcs = [ "pageseg/pageseg.cpp", |
| "pageseg/leptonica_pageseg.cpp", |
| "pageseg/leptonica_pageseg_interface.cpp" ], |
| deps = [ "tesseract_image", |
| "//third_party/leptonica" ], |
| includes = [ "ccstruct", |
| "ccutil", |
| "ccmain", |
| "image", |
| "textord", |
| "viewer", |
| "third_party/leptonica/includes" ], |
| copts = [ "-DHAVE_LIBLEPT" ] ) |
| |
| cc_library(name = "tesseract_main", |
| srcs = [ "ccmain/tessedit.cpp", |
| "ccmain/adaptions.cpp", |
| "ccmain/applybox.cpp", |
| "ccmain/baseapi.cpp", |
| "ccmain/blobcmp.cpp", |
| "ccmain/callnet.cpp", |
| "ccmain/charcut.cpp", |
| "ccmain/charsample.cpp", |
| "ccmain/control.cpp", |
| "ccmain/docqual.cpp", |
| "ccmain/expandblob.cpp", |
| "ccmain/fixspace.cpp", |
| "ccmain/fixxht.cpp", |
| "ccmain/imgscale.cpp", |
| "ccmain/matmatch.cpp", |
| "ccmain/osdetect.cpp", |
| "ccmain/output.cpp", |
| "ccmain/otsuthr.cpp", |
| "ccmain/pagewalk.cpp", |
| "ccmain/paircmp.cpp", |
| "ccmain/pgedit.cpp", |
| "ccmain/reject.cpp", |
| "ccmain/scaleimg.cpp", |
| "ccmain/tessbox.cpp", |
| "ccmain/tesseractclass.cpp", |
| "ccmain/tessvars.cpp", |
| "ccmain/thresholder.cpp", |
| "ccmain/tfacepp.cpp", |
| "ccmain/tstruct.cpp", |
| "ccmain/varabled.cpp", |
| "ccmain/werdit.cpp" ], |
| deps = [ "tesseract_wordrec", |
| "tesseract_textord", |
| "tesseract_cc_struct", |
| "tesseract_classify", |
| "tesseract_image", |
| "tesseract_aspirin", |
| "tesseract_dict", |
| "tesseract_c_util", |
| "tesseract_cc_util", |
| "//third_party/tiff", |
| "//third_party/leptonica", |
| "scrollview_lib" ], |
| includes = [ "ccutil", |
| "ccstruct", |
| "image", |
| "viewer", |
| "dict", |
| "classify", |
| "wordrec", |
| "cutil", |
| "textord", |
| "aspirin", |
| "ccmain", |
| "third_party/tiff", |
| "third_party/leptonica/includes" |
| ], |
| defines = [ "HAVE_LIBTIFF", "HAVE_LIBLEPT" ] |
| # copts = [ "-DHAVE_LIBTIFF", "-DHAVE_LIBLEPT" ] |
| ) |
| |
| cc_library(name = "tesseract_training", |
| srcs = [ "training/name2char.cpp", |
| "training/commontraining.cpp", |
| "training/mergenf.cpp", |
| ], |
| deps = [ "tesseract_textord", |
| "tesseract_c_util", |
| "tesseract_cc_util" ], |
| includes = [ "cutil", |
| "ccutil", |
| "dict", |
| "training", |
| "classify" |
| ] ) |
| |
| #----------------------------------------------------------------------------- |
| |
| # BINARIES |
| |
| cc_binary(name = "tesseract", |
| srcs = [ "ccmain/tesseractmain.cpp" ], |
| deps = [ "tesseract_main", |
| "//third_party/tiff" ], |
| includes = [ "ccutil", |
| "ccstruct", |
| "image", |
| "viewer", |
| "dict", |
| "classify", |
| "wordrec", |
| "cutil", |
| "textord", |
| "aspirin", |
| "ccmain" |
| ], |
| copts = [ "-DHAVE_LIBTIFF" ] |
| ) |
| |
| cc_binary(name = "cntraining", |
| srcs = [ "training/cntraining.cpp" ], |
| deps = [ "tesseract_training", |
| "tesseract_classify" ], |
| includes = [ "ccutil", |
| "cutil", |
| "viewer", |
| "dict", |
| "classify", |
| ] ) |
| |
| cc_binary(name = "mftraining", |
| srcs = [ "training/mftraining.cpp", |
| ], |
| deps = [ "tesseract_training", |
| "tesseract_classify" ], |
| includes = [ "ccutil", |
| "cutil", |
| "viewer", |
| "dict", |
| "classify", |
| ] ) |
| |
| cc_binary(name = "svpaint", |
| srcs = [ "viewer/svpaint.cpp"], |
| deps = [ "scrollview_lib"], |
| ) |
| |
| cc_binary(name = "unicharset_extractor", |
| srcs = [ "training/unicharset_extractor.cpp"], |
| deps = [ "tesseract_cc_util"], |
| includes = [ "ccutil" |
| ] ) |
| |
| cc_binary(name = "wordlist2dawg", |
| srcs = [ "training/wordlist2dawg.cpp"], |
| deps = [ "tesseract_dict", |
| "tesseract_classify", |
| "tesseract_cc_util", |
| "tesseract_c_util"], |
| includes = [ "ccutil", |
| "cutil", |
| "dict", |
| "classify" |
| ] ) |
| |
| #----------------------------------------------------------------------------- |
| # Data |
| |
| # export configuration data for Blaze compliance |
| exports_files(["tessdata"]) |
| |
| #----------------------------------------------------------------------------- |
| # UNITTESTS |