-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: fix build without pkg-config (issue #2424)
- Loading branch information
Showing
1 changed file
with
12 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
zdenop
Author
Contributor
|
||
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) | ||
|
AND NOT Leptonica_DIR
breaks the build