Commit Graph

292 Commits

Author SHA1 Message Date
zdenop
8778e84eba cmake: fix policy setting for newer cmake (CheckIPOSupported) 2020-06-30 13:31:49 +02:00
zdenop
744697e502 Merge branch 'master' of https://github.com/tesseract-ocr/tesseract 2020-06-26 15:42:32 +02:00
zdenop
6c2d3f52f3 cmake: allow to enable LTO 2020-06-26 15:38:00 +02:00
zdenop
d17ec2c754
Merge pull request #3036 from xuzhen/master
Fixed CMakeLists.txt for the compilers without C++17 support
2020-06-26 14:40:38 +02:00
Prabindh Sundareson
31edf8bdf9 Add MT option for MSVC compilation 2020-06-25 17:47:22 +05:30
Xu Zhen
57fe147115
Fixed CMake with MinGW 4.9 2020-06-23 12:23:41 +08:00
amitdo
eb5ad74665 Disabled legacy build: Don't compile permdawg.cpp 2020-06-18 18:24:17 +03:00
Matej Knopp
e900252c1a Fix CMake build with DISABLED_LEGACY_ENGINE 2020-06-17 19:42:49 +02:00
zdenop
3a3c41d1ab try to fix cmake gcc build - make simd configuration (HAVE_?) global (as autotools). 2020-05-19 18:02:16 +02:00
zdenop
32b3ab40f1 fix cmake msvc build 2020-05-19 16:16:38 +02:00
zdenop
90e81ac939 supress VS warnings in release target C4267 (conversion from 'size_t' to 'type', possible loss of data), C4305 ('context' : truncation from 'type1' to 'type2') and C4267 (var' : conversion from 'size_t' to 'type', possible loss of data) 2020-05-19 16:06:03 +02:00
zdenop
acaa90c971 cmake: dont use vector unit compile definition globaly 2020-05-16 12:30:20 +02:00
zdenop
9df8710402 Merge branch 'master' of https://github.com/tesseract-ocr/tesseract 2020-01-05 22:33:34 +01:00
zdenop
8ba14a655d fix #2847 cmake with OPENMP_BUILD=ON 2020-01-05 22:33:24 +01:00
Egor Pugin
ca3ce652b1
Update CMakeLists.txt 2020-01-05 23:08:03 +03:00
Stefan Weil
1d75ddd56f Use /W4 instead of /Wall for MSVC (fix issue #2816)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-12-18 07:42:52 +01:00
Stefan Weil
a1a139cbd2 Replace AVX_OPT, ..., AVX macros by HAVE_AVX, ... and clean related code
- Replace AVX_OPT, AVX2_OPT, FMA_OPT, SSE41_OPT
- Replace AVX, AVX2, FMA, SSE4_1
- Write new HAVE_AVX, HAVE_AVX2, HAVE_FMA, HAVE_SSE4_1 into config_auto.h
- Put related conditionals in Makefile.am in one place

This makes the code clearer and fixes a log message in
IntSimdMatrixTest.AVX2.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-28 17:51:37 +01:00
zdenop
2b688983f6 cmake: fix typo 2019-11-11 19:10:01 +01:00
zdenop
dbcff0ae88 cmake: fix clan openmp build on windows 2019-11-01 09:28:51 +01:00
zdenop
a5716692b2 cmake: allow build on Raspbian GNU/Linux 9 (stretch) 2019-11-01 09:28:08 +01:00
Egor Pugin
2bcc9d8093 Remove cppan build. 2019-10-30 21:37:38 +03:00
Stefan Weil
7bd94a9354 Remove old code for no longer existing src/api/*.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-10-29 12:47:04 +01:00
Stefan Weil
061eccd6ae Rename tesseract/tess_version.h -> tesseract/version.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-10-29 11:47:31 +01:00
Stefan Weil
17b0951736 Support cmake with new include file structure
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-10-29 08:33:55 +01:00
amitdo
227501c580 CMake: Sync list of public headers with Autotools build 2019-10-06 13:59:18 +02:00
Stefan Weil
b3b740eb22 cmake: Set default build type to Release
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-09-29 13:53:44 +02:00
zdenop
e8e77957ae cmake: AUTO_OPTIMIZE: enable to turn-off auto optimize macros 2019-09-28 14:37:05 +02:00
zdenop
573dc31adb cmake: arch files: fix duplicate build and follow autotools logic 2019-09-28 14:35:44 +02:00
zdenop
8a62d49914 cmake: auto optimize macros must be run before setting CMAKE_CXX_FLAGS* 2019-09-28 08:27:43 +02:00
zdenop
21680fa75b cmake: fix build type flags 2019-09-27 23:56:36 +02:00
zdenop
b1f7047a5f cmake: remove moved (training) header from installation 2019-09-27 21:08:17 +02:00
Egor Pugin
73f713519c
Merge pull request #2614 from stweil/training
Move source files which are used for training only to src/training
2019-08-12 19:35:50 +03:00
Stefan Weil
e84cb24def Move source files which are used for training only to src/training
They are moved from src/classify and src/lstm to src/training.

This reduces the size of the Tesseract library.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-08-12 17:08:08 +02:00
Stefan Weil
23e605911f Remove unused function truncate_path and related files
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-08-12 14:48:56 +02:00
Stefan Weil
25f2af9d1d cmake: Add missing include directory for LibArchive
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-07-25 09:13:31 +02:00
zhuangzhuang1988
35d252e30e fix cmake warning. 2019-07-16 11:03:14 +08:00
Zdenko Podobný
fef64d795c fix #2101 2019-07-13 20:11:03 +02:00
Stefan Weil
61eab60fe3 arch: Reduce number of include files for dot product functions
dotproductavx.h and dotproductsse.h declared only two functions.
Move those declarations to dotproduct.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-07-12 23:18:00 +02:00
Stefan Weil
2d5b166876 Add dot product implementation for Intel FMA (double = tessdata_best)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-07-12 23:18:00 +02:00
Egor Pugin
89cbb6adf2 [cmake] Hide unnecessary find_package. 2019-07-08 20:59:23 +03:00
Egor Pugin
3b6f071ee8 Implement CMake+SW build.
Currently only Windows is supported.
You could try it as following:

    mkdir build_sw && cd build_sw && cmake .. -DSW_BUILD=1
2019-07-08 18:50:30 +03:00
theirix
d371852c74 Avoid using experimental C++14/17 support in CMake
This commit points CMAKE_CXX_STANDARD to the latest non-experimental standard.

CMake announces C++14 and C++17 support even if the
compiler supports it only experimentally (c++1y and c++1z).
It breaks cmake standard detection and requires workarounds
for old compilers.
2019-07-08 11:34:51 +03:00
zdenop
54abc780fa cmake: do not report unused-command-line-argument for clan released target 2019-07-05 14:26:30 +02:00
Stefan Weil
134eb39960 Remove tesscallback.h
It is no longer used.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-07-04 16:03:30 +02:00
zhuangzhuang1988
91aac02387 export USE_SYSTEM_ICU viriable 2019-07-03 10:29:15 +08:00
Stefan Weil
7093727da1 cmake: Fix build with OpenMP (issue #2462)
Builds with gcc wrongly used /openmp instead of -fopenmp.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-25 13:20:52 +02:00
Stefan Weil
df98bb7368 Move LSTMTrainer from libtesseract to libtesseract_training
LSTMTrainer is only used for training, so the shared library for
Tesseract can be made smaller.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-22 16:23:51 +02:00
Stefan Weil
674d6a90d8 Remove code for embedded build
That code is unrelated to Tesseract and can be easily implemented
by external projects which require it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-17 09:55:33 +02:00
zdenop
5e62d02230 cmake: using c++ standard for g++ 2019-06-01 21:49:30 +02:00
Stefan Weil
b9a31eca37 Revert "Do not hardcode c++11 for unix builds"
This reverts commit 4348793bd5.
It is needed for Travis CI based on Ubuntu Trusty.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-01 17:42:24 +02:00
İsmail Dönmez
ab28df7448
Fix OpenMP builds on Unix 2019-05-31 14:18:26 +02:00
İsmail Dönmez
4348793bd5 Do not hardcode c++11 for unix builds 2019-05-31 14:11:11 +02:00
İsmail Dönmez
5df58fc979 Detect and use C++17 support for CMake builds 2019-05-31 14:11:11 +02:00
Zdenko Podobný
c69ee9af24 cmake: fix tiff linking to executable if tiffio.h is found 2019-05-24 11:12:39 +02:00
Zdenko Podobný
0f1e13a859 cmake: fix warning 2019-05-24 10:59:59 +02:00
zdenop
a54e345c9b fix typo 2019-05-17 11:19:07 +02:00
Zdenko Podobný
5282cdf7be another improvement for ca0be2fb72 2019-05-17 11:04:42 +02:00
Zdenko Podobný
e92a424efa try to fix ca0be2fb72 2019-05-17 10:51:06 +02:00
zdenop
ca0be2fb72 cmake: fix travis build 2019-05-16 23:18:13 +02:00
Zdenko Podobný
3f4dcf3c8b cmake: uninstall target 2019-05-08 19:19:26 +02:00
zdenop
a94334a255 cmake: fix build without pkg-config (issue #2424) 2019-05-08 18:49:48 +02:00
Zdenko Podobný
087576f2d9 cmake: fix linux build 2019-04-29 18:00:03 +02:00
zdenop
0fe929010a cmake: fixes #2337 Android cross-build 2019-04-24 21:42:58 +02:00
zdenop
63448de640 cmake: remove host.h from installation, remove definition of NOMINMAX and report used C++ standard 2019-04-23 23:05:26 +02:00
zdenop
3f9bb6626a cmake: show configuration summary 2019-04-22 09:06:22 +02:00
zdenop
21838b0e7a cmake: add detection of AVX, AVX2, SSE41 2019-04-22 09:05:55 +02:00
zdenop
b7065e2d40 fix finding tiffio.h cmake&clang on windows 2019-04-22 08:51:06 +02:00
zdenop
95a15a7a82 fix cmake&clang build 2019-04-06 15:31:53 +02:00
Stefan Weil
e76d81a0d5 Include src/training when exporting compile commands with cmake
`cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..` is used to get the file
compile_commands.json which is required by clang-tidy.

Export compile commands for all source files, not only those from
the default build, so clang-tidy can cover all source files.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-04-02 06:34:45 +02:00
Stefan Weil
ab009fae94 Remove macro WINDLLNAME
It is now no longer used.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-03-31 20:05:41 +02:00
zdenop
8891ba9711 add autotools options to cmake build 2019-03-17 14:50:36 +01:00
Egor Pugin
c4dd537206 [cmake] Add visibility to all target_link_libraries calls. 2019-03-11 00:11:25 +03:00
Egor Pugin
b0f61dfd1c Propagate libarchive to tess users. 2019-03-11 00:06:50 +03:00
Egor Pugin
37b0c36e32 Add libarchive dependency to cppan and sw builds. 2019-03-11 00:03:45 +03:00
zdenop
4ed44d70c5 cmake: enable libArchive support for non_cppan build 2019-03-10 20:08:19 +01:00
zdenop
441779de51 fix showing git tag for cmake build 2019-02-17 20:52:40 +01:00
zdenop
a2481de926 Revert "cmake workaround for #2246 for clang"
This reverts commit 4d8bbe2c97.
2019-02-17 16:34:39 +01:00
zdenop
e54c06f8d4 Merge branch 'master' of https://github.com/tesseract-ocr/tesseract 2019-02-16 17:56:18 +01:00
zdenop
4d8bbe2c97 cmake workaround for #2246 for clang 2019-02-16 17:55:45 +01:00
zdenop
15f2a4b2c1
Merge pull request #2231 from Shreeshrii/wordstr
Add renderer to create WordStr box files from images
2019-02-16 13:48:06 +01:00
Stefan Weil
7a1c6fe6f3 Fix typo
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-02-16 09:34:17 +01:00
zdenop
7f65afbaeb cmake check for avaible C++ standard. Mininum reqiered standard is C++11 2019-02-15 17:50:45 +01:00
Shree Devi Kumar
f3362a4b5b Add renderer to create WordStr box files from images 2019-02-10 19:59:17 +00:00
Shree Devi Kumar
9c89cd51cf Add a new renderer to create box files from images for LSTM training
(cherry picked from commit 921da6be2bdbda2ddd64514f9b6bec40a336246a)

fix typo

(cherry picked from commit 7bd1a0c80393fce2f34e2845cb26760bcf3791cd)

Add lstmboxrenderer to CMakeLists

(cherry picked from commit cfef3a889aef830725921b5c0218d5e9c633b03e)

fix formatting

(cherry picked from commit 7ba2b01ede7940ed609a073364948ef8c838cd10)
2019-02-05 14:03:29 +00:00
Zdenko Podobný
31c48a04d4 fix travis 2019-02-01 20:01:33 +01:00
Zdenko Podobný
0e090cd230 fix typo 2019-02-01 18:28:47 +01:00
Zdenko Podobný
114bc5016e improve cmake configuration 2019-02-01 18:02:28 +01:00
zdenop
fc55b5872d use AVX2 SSE for cmake&clang on Windows 2019-01-29 20:04:44 +01:00
zdenop
fd881e4486 fix cmake PACKAGE_VERSION to behave same way as in autotools 2019-01-29 20:01:55 +01:00
Stefan Weil
394839cdd7 Fix cmake compiler flags for AVX/SSE support
Commit 5f96ac1a71 had a typo
in the filename (simdetect.cpp / simddetect.cpp) which caused
a regression: AVX / AVX2 / SSE was no longer used.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-01-29 17:27:36 +01:00
zdenop
b30e92fb8a turn off openmp build for cmake (issue #263) 2019-01-24 23:03:47 +01:00
Egor Pugin
a1ec977f1e Revert "Fix broken builds"
This reverts commit 0c5f81947e.
2019-01-16 13:15:56 +03:00
Stefan Weil
0c5f81947e Fix broken builds
Don't use CPPAN by default because it fails with an error message:

    /usr/bin/ld: cannot find -lpvt.cppan.demo.danbloomberg.leptonica

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-01-16 09:25:28 +01:00
Stefan Weil
605b4d66c7 Replace dynamically allocated IntSimdMatrix instances by constants
Two header files are no longer needed and could be removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-01-14 21:34:37 +01:00
zdenop
c39a95ca57 try to fix appveyor 2019-01-06 17:46:59 +01:00
zdenop
bd1c05c102 remove old line 2019-01-06 16:56:38 +01:00
zdenop
c41a80f107 respect cmake -DCPPAN_BUILD=OFF 2019-01-06 16:47:54 +01:00
René Hansen
ff2535f8ec Avoid linking pthread on Android 2019-01-03 23:53:38 +01:00
Stefan Weil
5f96ac1a71 Update cmake compiler flags for new simdetect.cpp
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-01-01 13:15:58 +01:00
zdenop
d3065520fa fix 2 clang warnings 2018-12-30 20:25:24 +01:00
zdenop
b9a34d741d add support for clang on windows (cmake&ninja) 2018-12-29 10:43:13 +01:00
zdenop
3e6ec97ac3 Remove altorenderer.cpp from resource compiling (already included in tesseract_src) 2018-12-29 10:30:56 +01:00
Stefan Weil
fda0fa4e7e Add new hocrrenderer.cpp to CMakeList.txt and Android.mk
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-12-15 22:58:51 +01:00
Jake Sebright
d7cee03a94 Add support for ALTO output 2018-11-30 06:09:36 +01:00
zdenop
28df28123e Merge branch 'master' of https://github.com/tesseract-ocr/tesseract 2018-11-08 19:44:22 +01:00
Zdenko Podobný
2dd753ee4c replace VS implementation of gettimeofday with std::chrono::steady_clock::now(); fixes #2038 2018-11-08 19:43:46 +01:00
Stefan Weil
f4ec5beedc Remove dummy test
This reverts commit 99755b0732.
The dummy test is no longer needed as there exist a lot of real tests now.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-11-08 18:53:15 +01:00
Joel Gallant
422d1ca25a Uses CMAKE_CURRENT_ variables instead of PROJECT_ 2018-10-30 12:58:50 -06:00
Joel Gallant
58328405ec Adjusts CMAKE_MODULE_PATH instead of the include()'s 2018-10-30 12:51:09 -06:00
Joel Gallant
a4cb790e1d Reverts change on EXECUTABLE_OUTPUT_PATH 2018-10-30 12:27:34 -06:00
Joel Gallant
e87dc5b1f2 Uses PROJECT_ variables instead of CMAKE_ variables so it can be included using add_subdirectory 2018-10-30 12:00:32 -06:00
zdenop
6cee0528f5 turn off cmake test building 2018-10-13 20:48:10 +02:00
Stefan Weil
91522dfba5 Remove memry.h from public API
It is no longer needed by genericvector.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-23 21:15:54 +02:00
Stefan Weil
a9e2574eff Remove public API file ndminx.h
It is not needed for the Tesseract code, and the Tesseract API
should not provide MIN / MAX macros.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-21 08:33:30 +02:00
Alexander Zaitsev
d54d7486b4 Use std::max/std::min instead of MAX/MIN macros. 2018-05-20 17:49:48 +03:00
Stefan Weil
f54800f14b Add /utf-8 for MSVC
This fixes 208 compiler warnings of this form:

C4566: character represented by universal-character-name [...]
       cannot be represented in the current code page (1252)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 14:01:28 +02:00
Egor Pugin
104fe7931c Move training to src. 2018-04-25 11:35:26 +03:00
Egor Pugin
ca5c15e6a8 Set correct rc name. 2018-04-25 11:27:40 +03:00
Egor Pugin
cfe15b9d14 Remove wrong src dir from configure. 2018-04-25 11:09:45 +03:00
Egor Pugin
8ae22b9ebb Remove wrong src dir from configure. 2018-04-25 11:09:04 +03:00
Egor Pugin
e95ff1159e Move sources into src dir. Update build scripts. 2018-04-25 11:02:54 +03:00
bloke
2bdee5c5e4 cmake switch to turn off test building 2018-04-14 10:32:50 +02:00
bloke
da65617d74 cmake switch to turn off test building 2018-04-14 10:26:29 +02:00
Egor Pugin
742a087507 Merge branch 'master' of github.com-egorpugin:tesseract-ocr/tesseract 2018-04-11 00:16:35 +03:00
Egor Pugin
7dd2ecd026 Move cmake packages detection after compiler settings. 2018-04-11 00:16:31 +03:00
Zdenko Podobny
10f4998aee fix cmake build of training tools 2018-04-02 22:30:55 +02:00
Zdenko Podobný
e9e1e93686 add tess_version.h to distribution 2018-04-02 21:48:29 +02:00
Zdenko Podobný
af037c27e7 rename version.h.in because the filename is too general for distribution 2018-04-02 19:11:02 +02:00
Zdenko Podobny
f8e26eedff fix cmake windows version info for tesseract library and executable 2018-03-31 12:49:29 +02:00
Stefan Weil
8701b15134 cmake: Automatically build tesseract.rc with version from file
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-28 14:26:03 +02:00
Stefan Weil
832926f5af Update library version handling for cmake (#1435)
As Tesseract now uses semantic versioning, the old method to calculate
the library version was no longer valid.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-28 10:00:18 +02:00
Stefan Weil
b1d291e6fd cmake: Get version information from VERSION file (#1436)
Create also api/version.h like it is done for autoconf.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-28 09:58:25 +02:00
Egor Pugin
3fa25d9bbc Install training tools with CMake. 2018-03-23 23:28:51 +03:00
Stefan Weil
b94bbd6e83 Update version handling (#1408)
ccutil/version.h is now no longer needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-22 21:49:47 +01:00
Stefan Weil
8209ce3663 cmake: Update version and add it to config_auto.h (#1402)
In a next step, the package version should be read from the VERSION file.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-18 21:10:07 +01:00
Stefan Weil
7972b13e3a Remove macro USE_STD_NAMESPACE (#1360)
The related code in training/util.h now uses the GOOGLE_TESSERACT macro
to enable Google specific code to disable heap checking.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-03-04 14:43:28 +01:00
Amit D
d377281f73
Update CMakeLists.txt 2018-01-24 19:21:37 +02:00
Amit D
82ba423537
Update CMakeLists.txt 2018-01-24 19:07:17 +02:00
Egor Pugin
2da95d63bc Add more avx2, sse4.1 flags. Add MSVC's AVX2 ICE workaround. 2018-01-24 18:45:15 +03:00
Egor Pugin
4b6fefb2ac Add openmp support for Visual Studio builds. 2018-01-23 21:57:52 +03:00
Scott Talbot
a538cd126b Add Leptonica's pkg-config-found library directory to the search path 2017-10-03 21:15:44 +11:00
Clayton Walker
0d7c89ead4 Add -mavx and -msse4.1 compile flags on unix 2017-09-06 18:55:27 -06:00
Clayton Walker
69b9d298c7 Fix version.h not being installed 2017-08-29 15:14:54 -06:00
Clayton Walker
52cac3a42e Fix library being named liblibtesseract on non win32 platforms 2017-08-29 15:14:13 -06:00
Stefan Weil
99755b0732 googletest: Add dummy test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-07-24 19:45:06 +02:00
Stefan Weil
796cd7ab56 cmake: Add googletest
The submodule is build automatically as soon as it exists.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-07-24 19:45:06 +02:00
Egor Pugin
7dcd2ff90a Update CMakeLists.txt 2017-05-06 14:46:46 +03:00
Aleksey Nikolaev
be747a501b Correct include path for installed project 2017-04-20 14:59:13 +03:00
Aleksey Nikolaev
6641989866 Cmake install 2017-04-20 14:50:53 +03:00
Egor Pugin
5a37a8b593 Update CMakeLists.txt 2017-03-14 17:26:53 +03:00