Skip to content

Commit

Permalink
Turn on building of text2image.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed May 7, 2017
1 parent 6ba14f3 commit 2ea946d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
11 changes: 8 additions & 3 deletions cppan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ local_settings:
#generator: Visual Studio 14 2015 Win64
silent: false
#copy_import_libs: true
build:
c_flags: /W0
cxx_flags: /W0
#build:
#c_flags: /W0
#cxx_flags: /W0
builds:
vs2017:
generator: Visual Studio 15 2017
vs2017_64:
generator: Visual Studio 15 2017 Win64

dependencies:
pvt.cppan.demo.danbloomberg.leptonica: 1
Expand Down
14 changes: 11 additions & 3 deletions training/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,15 @@ if (NOT CPPAN_BUILD)
find_package(PkgConfig)
endif()

if (PKG_CONFIG_FOUND)
if (PKG_CONFIG_FOUND OR CPPAN_BUILD)

if (PKG_CONFIG_FOUND)
pkg_check_modules(Pango REQUIRED pango)
pkg_check_modules(Cairo REQUIRED cairo)
pkg_check_modules(PangoFt2 REQUIRED pangoft2)
pkg_check_modules(PangoCairo REQUIRED pangocairo)
pkg_check_modules(FontConfig REQUIRED fontconfig)
endif()

set(text2image_src
text2image.cpp
Expand All @@ -260,18 +262,24 @@ set(text2image_src ${text2image_src} ../vs2010/port/strcasestr.cpp)
endif()

add_executable (text2image ${text2image_src})
target_link_libraries (text2image unicharset_training)
if (PKG_CONFIG_FOUND)
target_include_directories (text2image BEFORE PRIVATE ${Cairo_INCLUDE_DIRS} ${Pango_INCLUDE_DIRS})
target_compile_definitions (text2image PRIVATE -DPANGO_ENABLE_ENGINE)
target_link_libraries (text2image libtesseract unicharset_training
target_link_libraries (text2image
${Pango_LIBRARIES}
${Cairo_LIBRARIES}
${PangoCairo_LIBRARIES}
${PangoFt2_LIBRARIES}
${FontConfig_LIBRARIES}
)
endif()
if (CPPAN_BUILD)
target_link_libraries (text2image pvt.cppan.demo.gnome.pango.pangocairo)
endif()
project_group (text2image "Training Tools")

endif(PKG_CONFIG_FOUND)
endif()
endif(ICU_FOUND)

###############################################################################

0 comments on commit 2ea946d

Please sign in to comment.