2018-03-14 04:15:44 +08:00
|
|
|
# Absolute path of directory 'tessdata' with traineddata files
|
|
|
|
# (must be on same level as top source directory).
|
|
|
|
TESSDATA_DIR=$(shell cd $(top_srcdir) && cd .. && pwd)/tessdata
|
|
|
|
|
|
|
|
# Absolute path of directory 'testing' with test images and ground truth texts
|
|
|
|
# (must be directly below top source directory).
|
|
|
|
TESTING_DIR=$(shell cd $(top_srcdir) && pwd)/testing
|
|
|
|
|
|
|
|
AM_CPPFLAGS += -DTESSDATA_DIR="\"$(TESSDATA_DIR)\""
|
|
|
|
AM_CPPFLAGS += -DTESTING_DIR="\"$(TESTING_DIR)\""
|
2018-03-04 21:43:28 +08:00
|
|
|
AM_CPPFLAGS += -DPANGO_ENABLE_ENGINE
|
2018-04-24 19:17:57 +08:00
|
|
|
AM_CPPFLAGS += -I$(top_builddir)/api
|
2017-09-03 10:39:18 +08:00
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/api
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/arch
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/ccmain
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/ccstruct
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/ccutil
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/classify
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/cutil
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/dict
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/display
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/lstm
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/textord
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/viewer
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/wordrec
|
2018-03-04 21:43:28 +08:00
|
|
|
|
2017-08-19 21:12:06 +08:00
|
|
|
# Build googletest:
|
|
|
|
check_LTLIBRARIES = libgtest.la libgtest_main.la
|
|
|
|
libgtest_la_SOURCES = ../googletest/googletest/src/gtest-all.cc
|
|
|
|
libgtest_la_CPPFLAGS = -I$(top_srcdir)/googletest/googletest/include -I$(top_srcdir)/googletest/googletest -pthread
|
|
|
|
libgtest_main_la_SOURCES = ../googletest/googletest/src/gtest_main.cc
|
|
|
|
## libgtest_main_la_LIBADD = libgtest.la
|
|
|
|
|
|
|
|
# Build unittests
|
|
|
|
GTEST_LIBS = libgtest.la libgtest_main.la
|
2017-09-11 23:46:31 +08:00
|
|
|
TESS_LIBS = $(top_builddir)/api/libtesseract.la
|
2017-08-19 21:12:06 +08:00
|
|
|
AM_CPPFLAGS += -isystem $(top_srcdir)/googletest/googletest/include
|
|
|
|
|
|
|
|
check_PROGRAMS = \
|
|
|
|
apiexample_test \
|
2017-09-08 22:06:19 +08:00
|
|
|
intsimdmatrix_test \
|
2018-03-04 21:52:27 +08:00
|
|
|
matrix_test \
|
|
|
|
osd_test \
|
|
|
|
tesseracttests
|
|
|
|
|
2017-08-19 21:12:06 +08:00
|
|
|
|
|
|
|
TESTS = $(check_PROGRAMS)
|
|
|
|
|
|
|
|
#List of source files needed to build the executable:
|
2018-03-04 21:43:28 +08:00
|
|
|
|
2017-09-08 22:06:19 +08:00
|
|
|
apiexample_test_SOURCES = apiexample_test.cc
|
2017-09-09 00:34:31 +08:00
|
|
|
apiexample_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
|
|
|
|
apiexample_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
2017-08-19 21:12:06 +08:00
|
|
|
|
2017-09-08 22:06:19 +08:00
|
|
|
intsimdmatrix_test_SOURCES = intsimdmatrix_test.cc
|
2017-09-09 00:34:31 +08:00
|
|
|
intsimdmatrix_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
2017-08-19 21:12:06 +08:00
|
|
|
|
|
|
|
matrix_test_SOURCES = matrix_test.cc
|
2017-09-09 00:34:31 +08:00
|
|
|
matrix_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
2017-09-08 22:06:19 +08:00
|
|
|
|
2018-03-04 21:52:27 +08:00
|
|
|
osd_test_SOURCES = osd_test.cc
|
|
|
|
osd_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
|
|
|
|
2017-09-08 22:06:19 +08:00
|
|
|
tesseracttests_SOURCES = ../tests/tesseracttests.cpp
|
2017-09-09 00:34:31 +08:00
|
|
|
tesseracttests_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
2017-08-19 21:12:06 +08:00
|
|
|
|
|
|
|
# for windows
|
|
|
|
if T_WIN
|
|
|
|
apiexample_test_LDADD += -lws2_32
|
2017-09-08 22:06:19 +08:00
|
|
|
intsimdmatrix_test_LDADD += -lws2_32
|
2017-08-19 21:12:06 +08:00
|
|
|
matrix_test_LDADD += -lws2_32
|
2018-03-04 21:52:27 +08:00
|
|
|
osd_test_LDADD += -lws2_32
|
2017-08-19 21:12:06 +08:00
|
|
|
tesseracttests_LDADD += -lws2_32
|
|
|
|
endif
|
2017-09-12 18:53:26 +08:00
|
|
|
|
|
|
|
EXTRA_apiexample_test_DEPENDENCIES = $(abs_top_builddir)/testing/phototest.tif
|
|
|
|
EXTRA_apiexample_test_DEPENDENCIES += $(abs_top_builddir)/testing/phototest.txt
|
|
|
|
|
|
|
|
$(abs_top_builddir)/testing/phototest.tif:
|
|
|
|
ln -s $(top_srcdir)/testing/phototest.tif $(top_builddir)/testing/phototest.tif
|
|
|
|
|
|
|
|
$(abs_top_builddir)/testing/phototest.txt:
|
|
|
|
ln -s $(top_srcdir)/testing/phototest.txt $(top_builddir)/testing/phototest.txt
|