CMakeLists.txt 925 Bytes
Newer Older
1
set(the_description "Text Detection and Recognition")
2
ocv_define_module(text opencv_ml opencv_imgproc opencv_core opencv_features2d opencv_dnn OPTIONAL opencv_highgui WRAP python java)
3

Alexander Alekhin's avatar
Alexander Alekhin committed
4 5 6 7
if(NOT CMAKE_CROSSCOMPILING OR OPENCV_FIND_TESSERACT)
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  find_package(Tesseract QUIET)
  if(Tesseract_FOUND)
8 9
    message(STATUS "Tesseract:   YES")
    set(HAVE_TESSERACT 1)
Alexander Alekhin's avatar
Alexander Alekhin committed
10 11 12
    ocv_include_directories(${Tesseract_INCLUDE_DIR})
    ocv_target_link_libraries(${the_module} ${Tesseract_LIBRARIES})
  else()
13
    message(STATUS "Tesseract:   NO")
Alexander Alekhin's avatar
Alexander Alekhin committed
14
  endif()
15 16 17 18 19
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/text_config.hpp.in
               ${CMAKE_BINARY_DIR}/text_config.hpp @ONLY)

Alexander Alekhin's avatar
Alexander Alekhin committed
20
ocv_include_directories(${CMAKE_CURRENT_BINARY_DIR})
21

22 23 24
ocv_add_testdata(samples/ contrib/text
    FILES_MATCHING PATTERN "*.xml" PATTERN "*.xml.gz" REGEX "scenetext[0-9]+.jpg"
)