Skip to content

Commit 8c573e4

Browse files
authored
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 <[email protected]>
1 parent e589bfa commit 8c573e4

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Makefile.am

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ EXTRA_DIST += CMakeLists.txt tesseract.pc.cmake cmake VERSION
1717

1818
DIST_SUBDIRS = $(SUBDIRS)
1919

20+
EXTRA_PROGRAMS =
21+
2022
uninstall-hook:
2123
rm -rf $(DESTDIR)$(pkgincludedir)
2224

@@ -673,9 +675,16 @@ noinst_HEADERS += src/viewer/svutil.h
673675
libtesseract_la_SOURCES += src/viewer/scrollview.cpp
674676
libtesseract_la_SOURCES += src/viewer/svmnode.cpp
675677
libtesseract_la_SOURCES += src/viewer/svutil.cpp
676-
endif
677678

678-
# TODO: Add rule to generate svpaint from svpaint.cpp.
679+
EXTRA_PROGRAMS += svpaint
680+
svpaint_CPPFLAGS =
681+
svpaint_CPPFLAGS += -I$(top_builddir)/include
682+
svpaint_CPPFLAGS += -I$(top_srcdir)/include
683+
svpaint_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
684+
svpaint_CPPFLAGS += -I$(top_srcdir)/src/viewer
685+
svpaint_SOURCES = src/svpaint.cpp
686+
svpaint_LDADD = libtesseract.la
687+
endif
679688

680689
# Rules for src/wordrec.
681690

@@ -758,12 +767,12 @@ endif
758767

759768
if ENABLE_TRAINING
760769

761-
training: $(EXTRA_PROGRAMS) | $(PROGRAMS)
770+
training: $(trainingtools) | $(PROGRAMS)
762771

763-
training-install: $(EXTRA_PROGRAMS)
772+
training-install: $(trainingtools)
764773
mkdir -p $(DESTDIR)$(bindir)
765774
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install \
766-
$(INSTALL) $(INSTALL_STRIP_FLAG) $(EXTRA_PROGRAMS) $(DESTDIR)$(bindir)
775+
$(INSTALL) $(INSTALL_STRIP_FLAG) $(trainingtools) $(DESTDIR)$(bindir)
767776

768777
training-uninstall:
769778

@@ -773,15 +782,15 @@ check: libtesseract_training.la
773782
# dawg_test runs dawg2wordlist and wordlist2dawg.
774783
check: dawg2wordlist wordlist2dawg
775784

776-
CLEANFILES += $(EXTRA_PROGRAMS)
777-
778785
else
779786

780787
training:
781788
@echo "Need to reconfigure project, so there are no errors"
782789

783790
endif
784791

792+
CLEANFILES += $(EXTRA_PROGRAMS)
793+
785794
training_CPPFLAGS := -DPANGO_ENABLE_ENGINE
786795
training_CPPFLAGS += -DTESS_COMMON_TRAINING_API=
787796
training_CPPFLAGS += -DTESS_PANGO_TRAINING_API=
@@ -908,7 +917,7 @@ endif
908917

909918
$(trainingtools): libtesseract.la
910919

911-
EXTRA_PROGRAMS = $(trainingtools)
920+
EXTRA_PROGRAMS += $(trainingtools)
912921

913922
extralib = libtesseract.la
914923
extralib += $(libarchive_LIBS)
File renamed without changes.

sw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void build(Solution &s)
2121

2222
libtesseract -=
2323
"src/tesseract.cpp",
24-
"src/viewer/svpaint.cpp";
24+
"src/svpaint.cpp";
2525

2626
libtesseract.Public += "include"_idir;
2727
libtesseract.Protected +=

0 commit comments

Comments
 (0)