@@ -71,6 +71,9 @@ option(OPENMP_BUILD "Build with openmp support" OFF) # see issue #1662
71
71
option (BUILD_TRAINING_TOOLS "Build training tools" ON )
72
72
option (BUILD_TESTS "Build tests" OFF )
73
73
74
+ if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /.cppan)
75
+ set (CPPAN_BUILD OFF )
76
+ endif ()
74
77
75
78
###############################################################################
76
79
#
@@ -125,7 +128,7 @@ endif()
125
128
#
126
129
###############################################################################
127
130
128
- if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /.cppan OR NOT CPPAN_BUILD)
131
+ if (NOT CPPAN_BUILD)
129
132
if (NOT Leptonica_DIR AND NOT MSVC )
130
133
find_package (PkgConfig REQUIRED)
131
134
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION} )
@@ -152,6 +155,7 @@ find_package(OpenCL QUIET)
152
155
153
156
set (AUTOCONFIG_SRC ${CMAKE_CURRENT_BINARY_DIR} /config_auto.h.in)
154
157
set (AUTOCONFIG ${CMAKE_CURRENT_BINARY_DIR} /config_auto.h)
158
+ add_definitions (-DHAVE_CONFIG_H)
155
159
156
160
include (Configure)
157
161
@@ -329,13 +333,13 @@ else()
329
333
set_target_properties (libtesseract PROPERTIES OUTPUT_NAME tesseract)
330
334
endif ()
331
335
332
- if (NOT CPPAN_BUILD)
333
- target_link_libraries (libtesseract ${Leptonica_LIBRARIES} )
334
- export (TARGETS libtesseract FILE ${CMAKE_CURRENT_BINARY_DIR} /TesseractTargets.cmake)
335
- else ()
336
+ if (CPPAN_BUILD)
336
337
target_link_libraries (libtesseract pvt.cppan.demo.danbloomberg.leptonica)
337
338
file (WRITE ${CMAKE_CURRENT_BINARY_DIR} /TesseractTargets.cmake "include(${CMAKE_CURRENT_BINARY_DIR} /cppan.cmake)\n " )
338
339
export (TARGETS libtesseract APPEND FILE ${CMAKE_CURRENT_BINARY_DIR} /TesseractTargets.cmake)
340
+ else ()
341
+ target_link_libraries (libtesseract ${Leptonica_LIBRARIES} )
342
+ export (TARGETS libtesseract FILE ${CMAKE_CURRENT_BINARY_DIR} /TesseractTargets.cmake)
339
343
endif ()
340
344
341
345
if (WIN32 AND CLANG AND OPENMP_BUILD)
0 commit comments