File tree Expand file tree Collapse file tree 3 files changed +24
-21
lines changed Expand file tree Collapse file tree 3 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -3,25 +3,24 @@ if(APPLE_FRAMEWORK)
33  ocv_module_disable(freetype)
44endif ()
55
6- if (PKG_CONFIG_FOUND)
7-   pkg_search_module(FREETYPE freetype2)
8-   pkg_search_module(HARFBUZZ harfbuzz)
9- endif ()
6+ ocv_check_modules(FREETYPE freetype2)
7+ ocv_check_modules(HARFBUZZ harfbuzz)
108
11- if (NOT  FREETYPE_FOUND)
12-   message (STATUS  "freetype2:   NO" )
13- else ()
14-   message (STATUS  "freetype2:   YES" )
15- endif ()
9+ if (OPENCV_INITIAL_PASS)
10+   if (NOT  FREETYPE_FOUND)
11+     message (STATUS  "freetype2:   NO" )
12+   else ()
13+     message (STATUS  "freetype2:   YES (ver ${FREETYPE_VERSION} )" )
14+   endif ()
1615
17- if (NOT  HARFBUZZ_FOUND)
18-   message (STATUS  "harfbuzz:    NO" )
19- else ()
20-   message (STATUS  "harfbuzz:    YES" )
16+   if (NOT  HARFBUZZ_FOUND)
17+     message (STATUS  "harfbuzz:    NO" )
18+   else ()
19+     message (STATUS  "harfbuzz:    YES (ver ${HARFBUZZ_VERSION} )" )
20+   endif ()
2121endif ()
2222
23- 
24- if ( FREETYPE_FOUND AND  HARFBUZZ_FOUND )
23+ if (FREETYPE_FOUND AND  HARFBUZZ_FOUND)
2524  ocv_define_module(freetype opencv_core opencv_imgproc WRAP python)
2625  ocv_target_link_libraries(${the_module}  ${FREETYPE_LIBRARIES}  ${HARFBUZZ_LIBRARIES} )
2726  ocv_include_directories( ${FREETYPE_INCLUDE_DIRS}  ${HARFBUZZ_INCLUDE_DIRS}  )
Original file line number Diff line number Diff line change @@ -2,10 +2,16 @@ set(the_description "Text Detection and Recognition")
22ocv_define_module(text opencv_ml opencv_imgproc opencv_core opencv_features2d opencv_dnn OPTIONAL  opencv_highgui WRAP python java)
33
44if (NOT  CMAKE_CROSSCOMPILING  OR  OPENCV_FIND_TESSERACT)
5-   set (CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH}  ${CMAKE_CURRENT_SOURCE_DIR} /cmake)
6-   find_package (Tesseract QUIET )
5+   find_package (Tesseract QUIET )  # Prefer CMake's standard locations (including Tesseract_DIR) 
6+   if (NOT  Tesseract_FOUND)
7+     include ("${CMAKE_CURRENT_SOURCE_DIR} /cmake/FindTesseract.cmake" )  # OpenCV's fallback 
8+   endif ()
79  if (Tesseract_FOUND)
8-     message (STATUS  "Tesseract:   YES" )
10+     if (Tesseract_VERSION)
11+       message (STATUS  "Tesseract:   YES (ver ${Tesseract_VERSION} )" )
12+     else ()
13+       message (STATUS  "Tesseract:   YES (ver unknown)" )
14+     endif ()
915    set (HAVE_TESSERACT 1)
1016    ocv_include_directories(${Tesseract_INCLUDE_DIRS} )
1117    ocv_target_link_libraries(${the_module}  ${Tesseract_LIBRARIES} )
Original file line number Diff line number Diff line change 11# Tesseract OCR 
2- if (COMMAND  pkg_check_modules)
3-   pkg_check_modules(Tesseract tesseract lept)
4- endif ()
2+ ocv_check_modules(Tesseract tesseract) # lept is excluded (not a direct dependency) 
53if (NOT  Tesseract_FOUND)
64  find_path (Tesseract_INCLUDE_DIR tesseract/baseapi.h
75    HINTS 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments