Rename cppan/cmake projects.

This commit is contained in:
Egor Pugin 2017-02-23 15:39:58 +03:00
parent a011b15b0d
commit 0dcb6b3547
3 changed files with 24 additions and 25 deletions

View File

@ -213,30 +213,30 @@ set(tesseract_src ${tesseract_src}
api/pdfrenderer.cpp
)
add_library (tesseract ${LIBRARY_TYPE} ${tesseract_src} ${tesseract_hdr})
add_library (libtesseract ${LIBRARY_TYPE} ${tesseract_src} ${tesseract_hdr})
if (NOT STATIC)
target_compile_definitions (tesseract
target_compile_definitions (libtesseract
PRIVATE -DTESS_EXPORTS
INTERFACE -DTESS_IMPORTS
)
set_target_properties (tesseract PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS True)
set_target_properties (libtesseract PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS True)
endif()
target_link_libraries (tesseract ${LIB_Ws2_32} ${LIB_pthread})
set_target_properties (tesseract PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR_0}.${VERSION_MINOR_1})
set_target_properties (tesseract PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR_0}.${VERSION_MINOR_1})
target_link_libraries (libtesseract ${LIB_Ws2_32} ${LIB_pthread})
set_target_properties (libtesseract PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR_0}.${VERSION_MINOR_1})
set_target_properties (libtesseract PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR_0}.${VERSION_MINOR_1})
if (WIN32)
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 (libtesseract PROPERTIES OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR})
set_target_properties (libtesseract PROPERTIES DEBUG_OUTPUT_NAME tesseract${VERSION_MAJOR}${VERSION_MINOR}d)
endif()
if (NOT CPPAN_BUILD)
target_link_libraries (tesseract ${Leptonica_LIBRARIES})
export(TARGETS tesseract FILE ${CMAKE_BINARY_DIR}/TesseractTargets.cmake)
target_link_libraries (libtesseract ${Leptonica_LIBRARIES})
export(TARGETS libtesseract FILE ${CMAKE_BINARY_DIR}/TesseractTargets.cmake)
else()
target_link_libraries (tesseract pvt.cppan.demo.danbloomberg.leptonica)
add_dependencies (tesseract cppan)
target_link_libraries (libtesseract pvt.cppan.demo.danbloomberg.leptonica)
add_dependencies (libtesseract cppan)
file(WRITE ${CMAKE_BINARY_DIR}/TesseractTargets.cmake "include(${CMAKE_BINARY_DIR}/cppan.cmake)\n")
export(TARGETS tesseract APPEND FILE ${CMAKE_BINARY_DIR}/TesseractTargets.cmake)
export(TARGETS libtesseract APPEND FILE ${CMAKE_BINARY_DIR}/TesseractTargets.cmake)
endif()
########################################
@ -248,9 +248,8 @@ set(tesseractmain_src
vs2010/tesseract/resource.h
vs2010/tesseract/tesseract.rc
)
add_executable (tesseractmain ${tesseractmain_src})
target_link_libraries (tesseractmain tesseract)
set_target_properties (tesseractmain PROPERTIES OUTPUT_NAME tesseract)
add_executable (tesseract ${tesseractmain_src})
target_link_libraries (tesseract libtesseract)
########################################

View File

@ -17,7 +17,7 @@ common_settings:
c++: 11
projects:
tesseract:
libtesseract:
type: lib
export_all_symbols: true
files:
@ -136,7 +136,7 @@ projects:
dependencies:
pvt.cppan.demo.danbloomberg.leptonica: 1
tesseractmain:
tesseract:
files: api/tesseractmain.cpp
dependencies:
- tesseract

View File

@ -78,7 +78,7 @@ set(common_training_src
commontraining.h
)
add_library (common_training ${common_training_src})
target_link_libraries (common_training tesseract tessopt)
target_link_libraries (common_training libtesseract tessopt)
project_group (common_training "Training Tools")
@ -87,7 +87,7 @@ project_group (common_training "Training Tools")
########################################
add_executable (ambiguous_words ambiguous_words.cpp)
target_link_libraries (ambiguous_words tesseract)
target_link_libraries (ambiguous_words libtesseract)
project_group (ambiguous_words "Training Tools")
@ -105,7 +105,7 @@ project_group (classifier_tester "Training Tools")
########################################
add_executable (combine_tessdata combine_tessdata.cpp)
target_link_libraries (combine_tessdata tesseract)
target_link_libraries (combine_tessdata libtesseract)
project_group (combine_tessdata "Training Tools")
@ -123,7 +123,7 @@ project_group (cntraining "Training Tools")
########################################
add_executable (dawg2wordlist dawg2wordlist.cpp)
target_link_libraries (dawg2wordlist tesseract)
target_link_libraries (dawg2wordlist libtesseract)
project_group (dawg2wordlist "Training Tools")
@ -150,7 +150,7 @@ project_group (shapeclustering "Training Tools")
########################################
add_executable (unicharset_extractor unicharset_extractor.cpp)
target_link_libraries (unicharset_extractor tesseract tessopt)
target_link_libraries (unicharset_extractor libtesseract tessopt)
project_group (unicharset_extractor "Training Tools")
@ -159,7 +159,7 @@ project_group (unicharset_extractor "Training Tools")
########################################
add_executable (wordlist2dawg wordlist2dawg.cpp)
target_link_libraries (wordlist2dawg tesseract)
target_link_libraries (wordlist2dawg libtesseract)
project_group (wordlist2dawg "Training Tools")
@ -262,7 +262,7 @@ endif()
add_executable (text2image ${text2image_src})
target_include_directories (text2image BEFORE PRIVATE ${Cairo_INCLUDE_DIRS} ${Pango_INCLUDE_DIRS})
target_compile_definitions (text2image PRIVATE -DPANGO_ENABLE_ENGINE)
target_link_libraries (text2image tesseract unicharset_training
target_link_libraries (text2image libtesseract unicharset_training
${Pango_LIBRARIES}
${Cairo_LIBRARIES}
${PangoCairo_LIBRARIES}