mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-19 06:53:36 +08:00
cmake: fix build without pkg-config (issue #2424)
This commit is contained in:
parent
5320320b63
commit
ee024e0209
@ -142,16 +142,19 @@ endif()
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
if(NOT CPPAN_BUILD)
|
if(NOT CPPAN_BUILD AND NOT Leptonica_DIR)
|
||||||
find_package(PkgConfig)
|
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} CONFIG QUIET)
|
||||||
if (NOT Leptonica_DIR AND NOT MSVC AND COMMAND pkg_check_modules)
|
if (NOT Leptonica_FOUND)
|
||||||
if(NOT PKG_CONFIG_EXECUTABLE)
|
find_package(PkgConfig QUIET)
|
||||||
message(FATAL_ERROR "Missing required pkg-config")
|
if(PKG_CONFIG_EXECUTABLE)
|
||||||
|
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
|
||||||
|
link_directories(${Leptonica_LIBRARY_DIRS})
|
||||||
|
endif(PKG_CONFIG_EXECUTABLE)
|
||||||
|
# message ("Leptonica: ${Leptonica_LIBRARY_DIRS}, ${Leptonica_FOUND}")
|
||||||
|
|
||||||
|
if (NOT Leptonica_FOUND)
|
||||||
|
message(FATAL_ERROR "Cannot find required library Leptonica. Quitting!")
|
||||||
endif()
|
endif()
|
||||||
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
|
|
||||||
link_directories(${Leptonica_LIBRARY_DIRS})
|
|
||||||
else()
|
|
||||||
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if (STATIC)
|
if (STATIC)
|
||||||
|
Loading…
Reference in New Issue
Block a user