-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move all public headers to include/tesseract #2735
Conversation
@@ -36,7 +36,7 @@ config_auto.h | |||
/doc/*.xml | |||
|
|||
# generated version file | |||
/src/api/tess_version.h | |||
/include/tesseract/tess_version.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file name is now always preceded by the tesseract
directory, so we could simply use tesseract/version.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
This does not include the needed changes to CMake and sw, so the CI will fail. I tested it with autotools and it works fine. @egorpugin, please push more commits to this PR or first merge and do the CMake fix later. Please don't squash my commits. |
See #594 (comment) |
This pull request fixes 1 alert when merging 2f8884a into cede5b3 - view on LGTM.com fixed alerts:
|
@@ -0,0 +1,54 @@ | |||
AM_CPPFLAGS += \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is AM_CPPFLAGS
really needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. You can try to remove it and see if it compiles.
Remove (usr/local)/include/tesseract in your system first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works without it because no files are compiled there. But I suggest an even more radical modification, namely no include/tesseract/Makefile.am
at all. Instead use this code:
diff --git a/Makefile.am b/Makefile.am
index 27de8e24..1e900be8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,7 +22,7 @@ endif
SUBDIRS = src/arch src/ccutil src/viewer src/cutil src/opencl src/ccstruct
SUBDIRS += src/dict src/classify src/wordrec src/textord src/lstm
-SUBDIRS += src/ccmain src/api . tessdata doc unittest include/tesseract
+SUBDIRS += src/ccmain src/api . tessdata doc unittest
EXTRA_DIST = README.md LICENSE
EXTRA_DIST += aclocal.m4 config configure.ac autogen.sh
@@ -65,6 +65,25 @@ doc-clean:
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tesseract.pc
+pkginclude_HEADERS = $(top_builddir)/include/tesseract/tess_version.h
+pkginclude_HEADERS += include/tesseract/apitypes.h
+pkginclude_HEADERS += include/tesseract/baseapi.h
+pkginclude_HEADERS += include/tesseract/capi.h
+pkginclude_HEADERS += include/tesseract/genericvector.h
+pkginclude_HEADERS += include/tesseract/helpers.h
+pkginclude_HEADERS += include/tesseract/ltrresultiterator.h
+pkginclude_HEADERS += include/tesseract/ocrclass.h
+pkginclude_HEADERS += include/tesseract/osdetect.h
+pkginclude_HEADERS += include/tesseract/pageiterator.h
+pkginclude_HEADERS += include/tesseract/platform.h
+pkginclude_HEADERS += include/tesseract/publictypes.h
+pkginclude_HEADERS += include/tesseract/renderer.h
+pkginclude_HEADERS += include/tesseract/resultiterator.h
+pkginclude_HEADERS += include/tesseract/serialis.h
+pkginclude_HEADERS += include/tesseract/strngs.h
+pkginclude_HEADERS += include/tesseract/thresholder.h
+pkginclude_HEADERS += include/tesseract/unichar.h
+
# fuzzer-api is used for fuzzing tests.
# They are run by OSS-Fuzz https://oss-fuzz.com/, but can also be run locally.
# Note: -fsanitize=fuzzer currently requires the clang++ compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unittest
also needs fixed include statements.
The include statements in include/tesseract
don't need the added tesseract/
.
|
What about |
At least some Google projects do what I did. I'm not sure what's the right thing to do here. |
My hacky python script searches for files with *.cpp or *.h. That's why it missed *.cc ... |
This pull request fixes 1 alert when merging d390bfd into cede5b3 - view on LGTM.com fixed alerts:
|
I am fine with this change. |
I would not mix this with the current pull request. One could also argue that |
That are more examples of recursive Makefiles. They are not wrong, but they have several disadvantages. Parallel builds using more than one CPU are much slower with recursions. Additional recursive make processes need more RAM. That's why I would like to move the |
I agree not to include it to this PR, but when we are "moving sources", it would be nice to make all known changes "together", so we could have stable source tree for some time ;-). IMO using Maybe it would make sense to move tesseract library to separate repository and include it to tesseract repository as submodule. This should make easier to include tesseact library to other projects (e.g. wrappers) |
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This pull request fixes 1 alert when merging 26ba7e2 into cede5b3 - view on LGTM.com fixed alerts:
|
I fixed Travis CI and the unittest code now, but Appveyor CI still fails. @egorpugin, @zdenop, can we merge the pull request nevertheless and fix cppan.yml and sw.cpp later? Other changes to be done later:
|
+1 for Makefile.am removal from include/tesseract |
Also: