mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 14:41:36 +08:00
Fix a lot of training tool to work on windows with static build.
This commit is contained in:
parent
b1d0cb9692
commit
c0d8a07b9d
@ -193,7 +193,9 @@ set(tesseract_src ${tesseract_src}
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_library (tesseract ${LIBRARY_TYPE} ${tesseract_src} ${tesseract_hdr})
|
add_library (tesseract ${LIBRARY_TYPE} ${tesseract_src} ${tesseract_hdr})
|
||||||
|
if (NOT STATIC)
|
||||||
target_compile_definitions (tesseract PUBLIC -DTESS_EXPORTS)
|
target_compile_definitions (tesseract PUBLIC -DTESS_EXPORTS)
|
||||||
|
endif()
|
||||||
target_link_libraries (tesseract ${Leptonica_LIBRARIES} ${LIB_Ws2_32} ${LIB_pthread})
|
target_link_libraries (tesseract ${Leptonica_LIBRARIES} ${LIB_Ws2_32} ${LIB_pthread})
|
||||||
set_target_properties (tesseract PROPERTIES OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR})
|
set_target_properties (tesseract PROPERTIES OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR})
|
||||||
set_target_properties (tesseract PROPERTIES DEBUG_OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}d)
|
set_target_properties (tesseract PROPERTIES DEBUG_OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}d)
|
||||||
@ -214,8 +216,6 @@ target_link_libraries (tesseractmain tesseract)
|
|||||||
|
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
if (BUILD_TRAINING)
|
|
||||||
add_subdirectory(training)
|
add_subdirectory(training)
|
||||||
endif()
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# tesseract
|
# tesseract
|
||||||
#
|
#
|
||||||
|
|
||||||
add_definitions(-DPANGO_ENABLE_ENGINE)
|
if (STATIC)
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# LIBRARY tessopt
|
# LIBRARY tessopt
|
||||||
@ -13,7 +13,115 @@ project_group (tessopt "Training Tools")
|
|||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# LIBRARY training
|
# LIBRARY common_training
|
||||||
|
########################################
|
||||||
|
|
||||||
|
set(common_training_src
|
||||||
|
commandlineflags.cpp
|
||||||
|
commontraining.cpp
|
||||||
|
)
|
||||||
|
set(common_training_hdr
|
||||||
|
commandlineflags.h
|
||||||
|
commontraining.h
|
||||||
|
)
|
||||||
|
add_library (common_training ${common_training_src} ${common_training_hdr})
|
||||||
|
target_link_libraries (common_training tessopt)
|
||||||
|
project_group (common_training "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE ambiguous_words
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (ambiguous_words ambiguous_words.cpp)
|
||||||
|
target_link_libraries (ambiguous_words tesseract)
|
||||||
|
project_group (ambiguous_words "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE classifier_tester
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (classifier_tester classifier_tester.cpp)
|
||||||
|
target_link_libraries (classifier_tester tesseract common_training)
|
||||||
|
project_group (classifier_tester "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE combine_tessdata
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (combine_tessdata combine_tessdata.cpp)
|
||||||
|
target_link_libraries (combine_tessdata tesseract)
|
||||||
|
project_group (combine_tessdata "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE cntraining
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (cntraining cntraining.cpp)
|
||||||
|
target_link_libraries (cntraining tesseract common_training)
|
||||||
|
project_group (cntraining "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE dawg2wordlist
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (dawg2wordlist dawg2wordlist.cpp)
|
||||||
|
target_link_libraries (dawg2wordlist tesseract)
|
||||||
|
project_group (dawg2wordlist "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE mftraining
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (mftraining mftraining.cpp mergenf.cpp)
|
||||||
|
target_link_libraries (mftraining tesseract common_training)
|
||||||
|
project_group (mftraining "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE shapeclustering
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (shapeclustering shapeclustering.cpp)
|
||||||
|
target_link_libraries (shapeclustering tesseract common_training)
|
||||||
|
project_group (shapeclustering "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE unicharset_extractor
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (unicharset_extractor unicharset_extractor.cpp)
|
||||||
|
target_link_libraries (unicharset_extractor tesseract tessopt)
|
||||||
|
project_group (unicharset_extractor "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# EXECUTABLE wordlist2dawg
|
||||||
|
########################################
|
||||||
|
|
||||||
|
add_executable (wordlist2dawg wordlist2dawg.cpp)
|
||||||
|
target_link_libraries (wordlist2dawg tesseract)
|
||||||
|
project_group (wordlist2dawg "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
|
endif(STATIC)
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# UNCHECKED
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if (BUILD_TRAINING)
|
||||||
|
|
||||||
|
add_definitions(-DPANGO_ENABLE_ENGINE)
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# LIBRARY training ?
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
set(training_src
|
set(training_src
|
||||||
@ -32,79 +140,19 @@ project_group (training "Training Tools")
|
|||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# EXECUTABLE ambiguous_words
|
# EXECUTABLE set_unicharset_properties ?
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
add_executable (ambiguous_words ambiguous_words.cpp)
|
add_executable (set_unicharset_properties
|
||||||
target_link_libraries (ambiguous_words tesseract training tessopt)
|
set_unicharset_properties.cpp
|
||||||
project_group (ambiguous_words "Training Tools")
|
unicharset_training_utils.cpp
|
||||||
|
)
|
||||||
|
target_link_libraries (set_unicharset_properties tesseract common_training ${ICU_LIBRARIES})
|
||||||
########################################
|
|
||||||
# EXECUTABLE classifier_tester
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (classifier_tester classifier_tester.cpp)
|
|
||||||
target_link_libraries (classifier_tester tesseract training tessopt)
|
|
||||||
project_group (classifier_tester "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE combine_tessdata
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (combine_tessdata combine_tessdata.cpp)
|
|
||||||
target_link_libraries (combine_tessdata tesseract)
|
|
||||||
project_group (combine_tessdata "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE cntraining
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (cntraining cntraining.cpp)
|
|
||||||
target_link_libraries (cntraining tesseract training tessopt)
|
|
||||||
project_group (cntraining "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE dawg2wordlist
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (dawg2wordlist dawg2wordlist.cpp)
|
|
||||||
target_link_libraries (dawg2wordlist tesseract training tessopt)
|
|
||||||
project_group (dawg2wordlist "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE mftraining
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (mftraining mftraining.cpp mergenf.cpp)
|
|
||||||
target_link_libraries (mftraining tesseract training tessopt)
|
|
||||||
project_group (mftraining "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE set_unicharset_properties
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (set_unicharset_properties set_unicharset_properties.cpp)
|
|
||||||
target_link_libraries (set_unicharset_properties tesseract training tessopt ${ICU_LIBRARIES})
|
|
||||||
project_group (set_unicharset_properties "Training Tools")
|
project_group (set_unicharset_properties "Training Tools")
|
||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# EXECUTABLE shapeclustering
|
# EXECUTABLE text2image ?
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (shapeclustering shapeclustering.cpp)
|
|
||||||
target_link_libraries (shapeclustering tesseract training tessopt)
|
|
||||||
project_group (shapeclustering "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE text2image
|
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
add_executable (text2image text2image.cpp)
|
add_executable (text2image text2image.cpp)
|
||||||
@ -118,23 +166,6 @@ target_link_libraries (text2image tesseract training tessopt
|
|||||||
)
|
)
|
||||||
project_group (text2image "Training Tools")
|
project_group (text2image "Training Tools")
|
||||||
|
|
||||||
|
endif(BUILD_TRAINING)
|
||||||
########################################
|
|
||||||
# EXECUTABLE unicharset_extractor
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (unicharset_extractor unicharset_extractor.cpp)
|
|
||||||
target_link_libraries (unicharset_extractor tesseract tessopt)
|
|
||||||
project_group (unicharset_extractor "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# EXECUTABLE wordlist2dawg
|
|
||||||
########################################
|
|
||||||
|
|
||||||
add_executable (wordlist2dawg wordlist2dawg.cpp)
|
|
||||||
target_link_libraries (wordlist2dawg tesseract tessopt)
|
|
||||||
project_group (wordlist2dawg "Training Tools")
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user