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)
3
3
ocv_module_disable (freetype )
4
4
endif ()
5
5
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 )
10
8
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 ()
16
15
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 ()
21
21
endif ()
22
22
23
-
24
- if ( FREETYPE_FOUND AND HARFBUZZ_FOUND )
23
+ if (FREETYPE_FOUND AND HARFBUZZ_FOUND )
25
24
ocv_define_module (freetype opencv_core opencv_imgproc WRAP python )
26
25
ocv_target_link_libraries (${the_module} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} )
27
26
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")
2
2
ocv_define_module (text opencv_ml opencv_imgproc opencv_core opencv_features2d opencv_dnn OPTIONAL opencv_highgui WRAP python java )
3
3
4
4
if (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 ()
7
9
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 ()
9
15
set (HAVE_TESSERACT 1 )
10
16
ocv_include_directories (${Tesseract_INCLUDE_DIRS} )
11
17
ocv_target_link_libraries (${the_module} ${Tesseract_LIBRARIES} )
Original file line number Diff line number Diff line change 1
1
# 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)
5
3
if (NOT Tesseract_FOUND )
6
4
find_path (Tesseract_INCLUDE_DIR tesseract/baseapi.h
7
5
HINTS
You can’t perform that action at this time.
0 commit comments