Skip to content

Commit e92a424

Browse files
committed
try to fix ca0be2f
1 parent af3dd1a commit e92a424

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

CMakeLists.txt

+9-13
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,16 @@ if(CPPAN_BUILD)
150150
endif()
151151
add_subdirectory(.cppan)
152152
else()
153-
if(Leptonica_DIR)
154-
message(STATUS "Using Leptonica directory ${Leptonica_DIR} for build.")
153+
find_package(PkgConfig)
154+
if(PKG_CONFIG_EXECUTABLE)
155+
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
156+
link_directories(${Leptonica_LIBRARY_DIRS})
155157
else()
156-
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION})
157-
if (NOT Leptonica_FOUND)
158-
find_package(PkgConfig)
159-
if(PKG_CONFIG_EXECUTABLE)
160-
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
161-
link_directories(${Leptonica_LIBRARY_DIRS})
162-
else()
163-
message(FATAL_ERROR "Cannot find required library Leptonica. Quitting!")
164-
endif(PKG_CONFIG_EXECUTABLE)
165-
endif()
166-
endif()
158+
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
159+
endif(PKG_CONFIG_EXECUTABLE)
160+
if (NOT Leptonica_FOUND)
161+
message(FATAL_ERROR "Cannot find required library Leptonica. Quitting!")
162+
endif(NOT Leptonica_FOUND)
167163
endif()
168164

169165
find_package(OpenCL QUIET)

0 commit comments

Comments
 (0)