mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-08 02:12:40 +08:00
cmake: fix travis build
This commit is contained in:
parent
198bbe3df5
commit
ca0be2fb72
@ -5,7 +5,7 @@ language: cpp
|
|||||||
dist: trusty
|
dist: trusty
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- LEPT_VER=1.77.0
|
- LEPT_VER=1.78.0
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
@ -46,7 +46,7 @@ string(REGEX REPLACE "^([^.]*)\\..*" "\\1" VERSION_MAJOR ${VERSION_PLAIN})
|
|||||||
string(REGEX REPLACE "^[^.]*\\.([^.]*)\\..*" "\\1" VERSION_MINOR ${VERSION_PLAIN})
|
string(REGEX REPLACE "^[^.]*\\.([^.]*)\\..*" "\\1" VERSION_MINOR ${VERSION_PLAIN})
|
||||||
string(REGEX REPLACE "^[^.]*\\.[^.]*\\.([0-9]*).*" "\\1" VERSION_PATCH ${VERSION_PLAIN})
|
string(REGEX REPLACE "^[^.]*\\.[^.]*\\.([0-9]*).*" "\\1" VERSION_PATCH ${VERSION_PLAIN})
|
||||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||||
execute_process(COMMAND git describe --abbrev=4
|
execute_process(COMMAND git --git-dir ${CMAKE_CURRENT_SOURCE_DIR}/.git describe --abbrev=4
|
||||||
OUTPUT_VARIABLE GIT_REV)
|
OUTPUT_VARIABLE GIT_REV)
|
||||||
string(REGEX REPLACE "\n$" "" PACKAGE_VERSION "${GIT_REV}")
|
string(REGEX REPLACE "\n$" "" PACKAGE_VERSION "${GIT_REV}")
|
||||||
endif()
|
endif()
|
||||||
@ -142,27 +142,28 @@ endif()
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
if(NOT CPPAN_BUILD AND NOT Leptonica_DIR)
|
if(CPPAN_BUILD)
|
||||||
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()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if (STATIC)
|
if (STATIC)
|
||||||
set(CPPAN_BUILD_SHARED_LIBS 0)
|
set(CPPAN_BUILD_SHARED_LIBS 0)
|
||||||
else()
|
else()
|
||||||
set(CPPAN_BUILD_SHARED_LIBS 1)
|
set(CPPAN_BUILD_SHARED_LIBS 1)
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(.cppan)
|
add_subdirectory(.cppan)
|
||||||
|
else()
|
||||||
|
if(Leptonica_DIR)
|
||||||
|
message(STATUS "Using Leptonica directory ${Leptonica_DIR} for build.")
|
||||||
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(OpenCL QUIET)
|
find_package(OpenCL QUIET)
|
||||||
|
Loading…
Reference in New Issue
Block a user