mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-14 00:31:47 +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)
|
||||
find_package(PkgConfig)
|
||||
if (NOT Leptonica_DIR AND NOT MSVC AND COMMAND pkg_check_modules)
|
||||
if(NOT PKG_CONFIG_EXECUTABLE)
|
||||
message(FATAL_ERROR "Missing required pkg-config")
|
||||
if(NOT CPPAN_BUILD AND NOT Leptonica_DIR)
|
||||
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} CONFIG QUIET)
|
||||
if (NOT Leptonica_FOUND)
|
||||
find_package(PkgConfig QUIET)
|
||||
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()
|
||||
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
|
||||
link_directories(${Leptonica_LIBRARY_DIRS})
|
||||
else()
|
||||
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
|
||||
endif()
|
||||
else()
|
||||
if (STATIC)
|
||||
|
Loading…
Reference in New Issue
Block a user