From e92a424efa82aa9a502e40f355ea7b7d186c1b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zdenko=20Podobn=C3=BD?= Date: Fri, 17 May 2019 10:51:06 +0200 Subject: [PATCH] try to fix ca0be2fb729 --- CMakeLists.txt | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aec15788da..83dd702bff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,20 +150,16 @@ if(CPPAN_BUILD) endif() add_subdirectory(.cppan) else() - if(Leptonica_DIR) - message(STATUS "Using Leptonica directory ${Leptonica_DIR} for build.") + find_package(PkgConfig) + if(PKG_CONFIG_EXECUTABLE) + pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION}) + link_directories(${Leptonica_LIBRARY_DIRS}) else() - find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION}) - if (NOT Leptonica_FOUND) - find_package(PkgConfig) - if(PKG_CONFIG_EXECUTABLE) - pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION}) - link_directories(${Leptonica_LIBRARY_DIRS}) - else() - message(FATAL_ERROR "Cannot find required library Leptonica. Quitting!") - endif(PKG_CONFIG_EXECUTABLE) - endif() - endif() + find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG) + endif(PKG_CONFIG_EXECUTABLE) + if (NOT Leptonica_FOUND) + message(FATAL_ERROR "Cannot find required library Leptonica. Quitting!") + endif(NOT Leptonica_FOUND) endif() find_package(OpenCL QUIET)