From 8c573e4cefaa011de2b303fa4c967ac943dc55a6 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 18 Jul 2022 23:50:01 +0200 Subject: [PATCH] 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 --- Makefile.am | 25 +++++++++++++++++-------- src/{viewer => }/svpaint.cpp | 0 sw.cpp | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) rename src/{viewer => }/svpaint.cpp (100%) diff --git a/Makefile.am b/Makefile.am index 148a91a5..53a6d42b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,6 +17,8 @@ EXTRA_DIST += CMakeLists.txt tesseract.pc.cmake cmake VERSION DIST_SUBDIRS = $(SUBDIRS) +EXTRA_PROGRAMS = + uninstall-hook: 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/svmnode.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. @@ -758,12 +767,12 @@ endif if ENABLE_TRAINING -training: $(EXTRA_PROGRAMS) | $(PROGRAMS) +training: $(trainingtools) | $(PROGRAMS) -training-install: $(EXTRA_PROGRAMS) +training-install: $(trainingtools) mkdir -p $(DESTDIR)$(bindir) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install \ - $(INSTALL) $(INSTALL_STRIP_FLAG) $(EXTRA_PROGRAMS) $(DESTDIR)$(bindir) + $(INSTALL) $(INSTALL_STRIP_FLAG) $(trainingtools) $(DESTDIR)$(bindir) training-uninstall: @@ -773,8 +782,6 @@ check: libtesseract_training.la # dawg_test runs dawg2wordlist and wordlist2dawg. check: dawg2wordlist wordlist2dawg -CLEANFILES += $(EXTRA_PROGRAMS) - else training: @@ -782,6 +789,8 @@ training: endif +CLEANFILES += $(EXTRA_PROGRAMS) + training_CPPFLAGS := -DPANGO_ENABLE_ENGINE training_CPPFLAGS += -DTESS_COMMON_TRAINING_API= training_CPPFLAGS += -DTESS_PANGO_TRAINING_API= @@ -908,7 +917,7 @@ endif $(trainingtools): libtesseract.la -EXTRA_PROGRAMS = $(trainingtools) +EXTRA_PROGRAMS += $(trainingtools) extralib = libtesseract.la extralib += $(libarchive_LIBS) diff --git a/src/viewer/svpaint.cpp b/src/svpaint.cpp similarity index 100% rename from src/viewer/svpaint.cpp rename to src/svpaint.cpp diff --git a/sw.cpp b/sw.cpp index 7559b440..49b01ad9 100644 --- a/sw.cpp +++ b/sw.cpp @@ -21,7 +21,7 @@ void build(Solution &s) libtesseract -= "src/tesseract.cpp", - "src/viewer/svpaint.cpp"; + "src/svpaint.cpp"; libtesseract.Public += "include"_idir; libtesseract.Protected +=