File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -142,16 +142,19 @@ endif()
142
142
#
143
143
###############################################################################
144
144
145
- if (NOT CPPAN_BUILD)
146
- find_package (PkgConfig)
147
- if (NOT Leptonica_DIR AND NOT MSVC AND COMMAND pkg_check_modules)
148
- if (NOT PKG_CONFIG_EXECUTABLE)
149
- message (FATAL_ERROR "Missing required pkg-config" )
145
+ if (NOT CPPAN_BUILD AND NOT Leptonica_DIR)
146
+ find_package (Leptonica ${MINIMUM_LEPTONICA_VERSION} CONFIG QUIET )
147
+ if (NOT Leptonica_FOUND)
148
+ find_package (PkgConfig QUIET )
149
+ if (PKG_CONFIG_EXECUTABLE)
150
+ pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION} )
151
+ link_directories (${Leptonica_LIBRARY_DIRS} )
152
+ endif (PKG_CONFIG_EXECUTABLE)
153
+ # message ("Leptonica: ${Leptonica_LIBRARY_DIRS}, ${Leptonica_FOUND}")
154
+
155
+ if (NOT Leptonica_FOUND)
156
+ message (FATAL_ERROR "Cannot find required library Leptonica. Quitting!" )
150
157
endif ()
151
- pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION} )
152
- link_directories (${Leptonica_LIBRARY_DIRS} )
153
- else ()
154
- find_package (Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
155
158
endif ()
156
159
else ()
157
160
if (STATIC )
You can’t perform that action at this time.
0 commit comments