autotools: Add rule for svpaint executable (#3873)

Move also its source code svpaint.cpp from src/viewer/ to src/,
so it is no longer included in libtesseract by the cmake build.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2022-07-18 23:50:01 +02:00 committed by GitHub
parent e589bfa58b
commit 8c573e4cef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View File

@ -17,6 +17,8 @@ EXTRA_DIST += CMakeLists.txt tesseract.pc.cmake cmake VERSION
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
EXTRA_PROGRAMS =
uninstall-hook: uninstall-hook:
rm -rf $(DESTDIR)$(pkgincludedir) rm -rf $(DESTDIR)$(pkgincludedir)
@ -673,9 +675,16 @@ noinst_HEADERS += src/viewer/svutil.h
libtesseract_la_SOURCES += src/viewer/scrollview.cpp libtesseract_la_SOURCES += src/viewer/scrollview.cpp
libtesseract_la_SOURCES += src/viewer/svmnode.cpp libtesseract_la_SOURCES += src/viewer/svmnode.cpp
libtesseract_la_SOURCES += src/viewer/svutil.cpp libtesseract_la_SOURCES += src/viewer/svutil.cpp
endif
# TODO: Add rule to generate svpaint from svpaint.cpp. EXTRA_PROGRAMS += svpaint
svpaint_CPPFLAGS =
svpaint_CPPFLAGS += -I$(top_builddir)/include
svpaint_CPPFLAGS += -I$(top_srcdir)/include
svpaint_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
svpaint_CPPFLAGS += -I$(top_srcdir)/src/viewer
svpaint_SOURCES = src/svpaint.cpp
svpaint_LDADD = libtesseract.la
endif
# Rules for src/wordrec. # Rules for src/wordrec.
@ -758,12 +767,12 @@ endif
if ENABLE_TRAINING if ENABLE_TRAINING
training: $(EXTRA_PROGRAMS) | $(PROGRAMS) training: $(trainingtools) | $(PROGRAMS)
training-install: $(EXTRA_PROGRAMS) training-install: $(trainingtools)
mkdir -p $(DESTDIR)$(bindir) mkdir -p $(DESTDIR)$(bindir)
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install \
$(INSTALL) $(INSTALL_STRIP_FLAG) $(EXTRA_PROGRAMS) $(DESTDIR)$(bindir) $(INSTALL) $(INSTALL_STRIP_FLAG) $(trainingtools) $(DESTDIR)$(bindir)
training-uninstall: training-uninstall:
@ -773,8 +782,6 @@ check: libtesseract_training.la
# dawg_test runs dawg2wordlist and wordlist2dawg. # dawg_test runs dawg2wordlist and wordlist2dawg.
check: dawg2wordlist wordlist2dawg check: dawg2wordlist wordlist2dawg
CLEANFILES += $(EXTRA_PROGRAMS)
else else
training: training:
@ -782,6 +789,8 @@ training:
endif endif
CLEANFILES += $(EXTRA_PROGRAMS)
training_CPPFLAGS := -DPANGO_ENABLE_ENGINE training_CPPFLAGS := -DPANGO_ENABLE_ENGINE
training_CPPFLAGS += -DTESS_COMMON_TRAINING_API= training_CPPFLAGS += -DTESS_COMMON_TRAINING_API=
training_CPPFLAGS += -DTESS_PANGO_TRAINING_API= training_CPPFLAGS += -DTESS_PANGO_TRAINING_API=
@ -908,7 +917,7 @@ endif
$(trainingtools): libtesseract.la $(trainingtools): libtesseract.la
EXTRA_PROGRAMS = $(trainingtools) EXTRA_PROGRAMS += $(trainingtools)
extralib = libtesseract.la extralib = libtesseract.la
extralib += $(libarchive_LIBS) extralib += $(libarchive_LIBS)

2
sw.cpp
View File

@ -21,7 +21,7 @@ void build(Solution &s)
libtesseract -= libtesseract -=
"src/tesseract.cpp", "src/tesseract.cpp",
"src/viewer/svpaint.cpp"; "src/svpaint.cpp";
libtesseract.Public += "include"_idir; libtesseract.Public += "include"_idir;
libtesseract.Protected += libtesseract.Protected +=