Skip to content

Commit

Permalink
cmake: fix travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed May 16, 2019
1 parent 198bbe3 commit ca0be2f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ language: cpp
dist: trusty

env:
- LEPT_VER=1.77.0
- LEPT_VER=1.78.0

notifications:
email: false
Expand Down
33 changes: 17 additions & 16 deletions CMakeLists.txt
Expand Up @@ -46,7 +46,7 @@ string(REGEX REPLACE "^([^.]*)\\..*" "\\1" VERSION_MAJOR ${VERSION_PLAIN})
string(REGEX REPLACE "^[^.]*\\.([^.]*)\\..*" "\\1" VERSION_MINOR ${VERSION_PLAIN})
string(REGEX REPLACE "^[^.]*\\.[^.]*\\.([0-9]*).*" "\\1" VERSION_PATCH ${VERSION_PLAIN})
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)
string(REGEX REPLACE "\n$" "" PACKAGE_VERSION "${GIT_REV}")
endif()
Expand Down Expand Up @@ -142,27 +142,28 @@ endif()
#
###############################################################################

if(NOT CPPAN_BUILD AND NOT Leptonica_DIR)
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(CPPAN_BUILD)
if (STATIC)
set(CPPAN_BUILD_SHARED_LIBS 0)
else()
set(CPPAN_BUILD_SHARED_LIBS 1)
endif()
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()

find_package(OpenCL QUIET)
Expand Down

0 comments on commit ca0be2f

Please sign in to comment.