Skip to content

Commit 2ea946d

Browse files
committed
Turn on building of text2image.
1 parent 6ba14f3 commit 2ea946d

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

cppan.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ local_settings:
33
#generator: Visual Studio 14 2015 Win64
44
silent: false
55
#copy_import_libs: true
6-
build:
7-
c_flags: /W0
8-
cxx_flags: /W0
6+
#build:
7+
#c_flags: /W0
8+
#cxx_flags: /W0
9+
builds:
10+
vs2017:
11+
generator: Visual Studio 15 2017
12+
vs2017_64:
13+
generator: Visual Studio 15 2017 Win64
914

1015
dependencies:
1116
pvt.cppan.demo.danbloomberg.leptonica: 1

training/CMakeLists.txt

+11-3
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,15 @@ if (NOT CPPAN_BUILD)
228228
find_package(PkgConfig)
229229
endif()
230230

231-
if (PKG_CONFIG_FOUND)
231+
if (PKG_CONFIG_FOUND OR CPPAN_BUILD)
232232

233+
if (PKG_CONFIG_FOUND)
233234
pkg_check_modules(Pango REQUIRED pango)
234235
pkg_check_modules(Cairo REQUIRED cairo)
235236
pkg_check_modules(PangoFt2 REQUIRED pangoft2)
236237
pkg_check_modules(PangoCairo REQUIRED pangocairo)
237238
pkg_check_modules(FontConfig REQUIRED fontconfig)
239+
endif()
238240

239241
set(text2image_src
240242
text2image.cpp
@@ -260,18 +262,24 @@ set(text2image_src ${text2image_src} ../vs2010/port/strcasestr.cpp)
260262
endif()
261263

262264
add_executable (text2image ${text2image_src})
265+
target_link_libraries (text2image unicharset_training)
266+
if (PKG_CONFIG_FOUND)
263267
target_include_directories (text2image BEFORE PRIVATE ${Cairo_INCLUDE_DIRS} ${Pango_INCLUDE_DIRS})
264268
target_compile_definitions (text2image PRIVATE -DPANGO_ENABLE_ENGINE)
265-
target_link_libraries (text2image libtesseract unicharset_training
269+
target_link_libraries (text2image
266270
${Pango_LIBRARIES}
267271
${Cairo_LIBRARIES}
268272
${PangoCairo_LIBRARIES}
269273
${PangoFt2_LIBRARIES}
270274
${FontConfig_LIBRARIES}
271275
)
276+
endif()
277+
if (CPPAN_BUILD)
278+
target_link_libraries (text2image pvt.cppan.demo.gnome.pango.pangocairo)
279+
endif()
272280
project_group (text2image "Training Tools")
273281

274-
endif(PKG_CONFIG_FOUND)
282+
endif()
275283
endif(ICU_FOUND)
276284

277285
###############################################################################

0 commit comments

Comments
 (0)