Skip to content

Commit c1c87d7

Browse files
committed
Require tesseract/ for API header files (fixes potential name conflicts)
The tesseract/ subdirectory is no longer automatically added to the include path of the compiler. Therefore old code which used code like #include "capi.h" must now change that to #include "tesseract/capi.h" This avoids name conflicts with header files from other projects. Signed-off-by: Stefan Weil <[email protected]>
1 parent 518192d commit c1c87d7

File tree

9 files changed

+8
-10
lines changed

9 files changed

+8
-10
lines changed

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ EXTRA_DIST = README.md\
2929
DIST_SUBDIRS = $(SUBDIRS) $(TRAINING_SUBDIR)
3030

3131
uninstall-hook:
32-
rm -rf $(DESTDIR)$(includedir)
32+
rm -rf $(DESTDIR)$(pkgincludedir)
3333

3434
dist-hook:
3535
# Need to remove .svn directories from directories

configure.ac

-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ if $sse41; then
131131
AM_CONDITIONAL([SSE41_OPT], true)
132132
fi
133133

134-
includedir="${includedir}/tesseract"
135-
136134
AC_ARG_WITH([extra-includes],
137135
[AS_HELP_STRING([--with-extra-includes=DIR],
138136
[Define an additional directory for include files])],

src/api/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if VISIBILITY
1919
AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
2020
endif
2121

22-
include_HEADERS = apitypes.h baseapi.h capi.h renderer.h tess_version.h
22+
pkginclude_HEADERS = apitypes.h baseapi.h capi.h renderer.h tess_version.h
2323
lib_LTLIBRARIES =
2424

2525
noinst_LTLIBRARIES = libtesseract_api.la

src/arch/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
88
AM_CPPFLAGS += -DTESS_EXPORTS
99
endif
1010

11-
include_HEADERS = intsimdmatrix.h
11+
pkginclude_HEADERS = intsimdmatrix.h
1212

1313
noinst_HEADERS = dotproductavx.h dotproductsse.h
1414
noinst_HEADERS += intsimdmatrixavx2.h intsimdmatrixsse.h

src/ccmain/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ AM_CPPFLAGS += -DTESS_EXPORTS \
1919
-fvisibility=hidden -fvisibility-inlines-hidden
2020
endif
2121

22-
include_HEADERS = \
22+
pkginclude_HEADERS = \
2323
thresholder.h ltrresultiterator.h pageiterator.h resultiterator.h \
2424
osdetect.h
2525
noinst_HEADERS = \

src/ccstruct/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AM_CPPFLAGS += -DTESS_EXPORTS \
1010
-fvisibility=hidden -fvisibility-inlines-hidden
1111
endif
1212

13-
include_HEADERS = publictypes.h
13+
pkginclude_HEADERS = publictypes.h
1414
noinst_HEADERS = \
1515
blamer.h blckerr.h blobbox.h blobs.h blread.h boxread.h boxword.h ccstruct.h coutln.h crakedge.h \
1616
debugpixa.h detlinefit.h dppoint.h fontinfo.h genblob.h hpdsizes.h \

src/ccutil/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
1111
AM_CPPFLAGS += -DTESS_EXPORTS
1212
endif
1313

14-
include_HEADERS = \
14+
pkginclude_HEADERS = \
1515
basedir.h errcode.h fileerr.h genericvector.h helpers.h host.h memry.h \
1616
ndminx.h params.h ocrclass.h platform.h serialis.h strngs.h \
1717
tesscallback.h unichar.h unicharcompress.h unicharmap.h unicharset.h

src/lstm/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
2020
AM_CPPFLAGS += -DTESS_EXPORTS
2121
endif
2222

23-
include_HEADERS = \
23+
pkginclude_HEADERS = \
2424
convolve.h ctc.h fullyconnected.h functions.h input.h \
2525
lstm.h lstmrecognizer.h lstmtrainer.h maxpool.h \
2626
networkbuilder.h network.h networkio.h networkscratch.h \

tesseract.pc.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ URL: https://github.com/tesseract-ocr/tesseract
99
Version: @tesseract_VERSION@
1010
Libs: -L${libdir} -l@tesseract_OUTPUT_NAME@
1111
Libs.private:
12-
Cflags: -I${includedir} -I${includedir}/tesseract
12+
Cflags: -I${includedir}

0 commit comments

Comments
 (0)