From fceb3abc1fa7aa591fbd40d578ec092efa7bb7c7 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Thu, 14 Jan 2016 14:01:55 +0300 Subject: [PATCH 01/15] Update ci scripts. --- .travis.yml | 10 ++++++---- appveyor.yml | 11 +++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32f9f3739b..c5af5c044f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,19 +27,21 @@ before_install: - if [[ $OSX ]]; then brew update; fi + - export LEPT_VER=1.72 + install: - if [[ $OSX ]]; then brew install icu4c pango; brew link --force gettext; fi - if [[ $OSX ]]; then export ICU_ROOT=/usr/local/opt/icu4c ; fi - wget --no-check-certificate https://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.sh - sudo sh cmake-3.3.1-Linux-x86_64.sh --skip-license --prefix=/usr - - wget -O leptonica.zip https://github.com/egorpugin/leptonica/archive/master.zip + - wget -O leptonica.zip https://github.com/DanBloomberg/leptonica/archive/v$LEPT_VER.zip - unzip leptonica.zip -d . - - cmake -Hleptonica-master -Bleptonica-master/build - - make -C leptonica-master/build + - cmake -Hleptonica-$LEPT_VER -Bleptonica-$LEPT_VER/build + - make -C leptonica-$LEPT_VER/build - if [[ $LINUX && "$CXX" = "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8"; fi script: - mkdir build - cd build - - cmake .. -DLeptonica_BUILD_DIR=leptonica-master/build + - cmake .. -DLeptonica_BUILD_DIR=leptonica-$LEPT_VER/build - make diff --git a/appveyor.yml b/appveyor.yml index 3f54f976ee..e4c65e6db3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,13 +12,16 @@ before_build: - if %platform%==Win64 set generator=Visual Studio 14 Win64 - if %platform%==Win32 set vcplatform=Win32 - if %platform%==Win64 set vcplatform=x64 - - ps: Start-FileDownload 'https://github.com/egorpugin/leptonica/archive/master.zip' -FileName leptonica.zip + + - set LEPT_VER=1.72 + + - ps: Start-FileDownload 'https://github.com/DanBloomberg/leptonica/archive/v%LEPT_VER%.zip' -FileName leptonica.zip - 7z x leptonica.zip - - cmake -Hleptonica-master -Bleptonica-master/build -G "%generator%" - - msbuild leptonica-master/build/leptonica.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - cmake -Hleptonica-%LEPT_VER% -Bleptonica-%LEPT_VER%/build -G "%generator%" + - msbuild leptonica-%LEPT_VER%/build/leptonica.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" build_script: - mkdir build - cd build - - cmake .. -G "%generator%" -DLeptonica_BUILD_DIR=leptonica-master/build -DSTATIC=1 + - cmake .. -G "%generator%" -DLeptonica_BUILD_DIR=leptonica-%LEPT_VER%/build -DSTATIC=1 - msbuild tesseract.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" From 2da1fb1914c818aeb378929d4fefcdd0a88117e8 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Thu, 14 Jan 2016 14:02:48 +0300 Subject: [PATCH 02/15] Test release build on windows. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e4c65e6db3..416dc6c30d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ platform: - Win64 configuration: - - Debug + - Release before_build: - if %platform%==Win32 set generator=Visual Studio 14 From bbf25ee8715eb67a4e2070fb98fb7591eb334397 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Thu, 14 Jan 2016 14:23:12 +0300 Subject: [PATCH 03/15] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 416dc6c30d..347e43efc1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ before_build: - set LEPT_VER=1.72 - - ps: Start-FileDownload 'https://github.com/DanBloomberg/leptonica/archive/v%LEPT_VER%.zip' -FileName leptonica.zip + - ps: Start-FileDownload 'https://github.com/DanBloomberg/leptonica/archive/v$env:LEPT_VER.zip' -FileName leptonica.zip - 7z x leptonica.zip - cmake -Hleptonica-%LEPT_VER% -Bleptonica-%LEPT_VER%/build -G "%generator%" - msbuild leptonica-%LEPT_VER%/build/leptonica.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" From c2e8dd0fc8132224774b849df8edb6fb6596503d Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Thu, 14 Jan 2016 14:28:46 +0300 Subject: [PATCH 04/15] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 347e43efc1..a8bb8dec06 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ before_build: - set LEPT_VER=1.72 - - ps: Start-FileDownload 'https://github.com/DanBloomberg/leptonica/archive/v$env:LEPT_VER.zip' -FileName leptonica.zip + - ps: Start-FileDownload 'https://github.com/DanBloomberg/leptonica/archive/v'$env:LEPT_VER'.zip' -FileName leptonica.zip - 7z x leptonica.zip - cmake -Hleptonica-%LEPT_VER% -Bleptonica-%LEPT_VER%/build -G "%generator%" - msbuild leptonica-%LEPT_VER%/build/leptonica.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" From a3b175de7e0df8aefeef8b4c9d0c5a3c4a4d0dfa Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Thu, 14 Jan 2016 14:35:29 +0300 Subject: [PATCH 05/15] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a8bb8dec06..01b3744000 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ before_build: - set LEPT_VER=1.72 - - ps: Start-FileDownload 'https://github.com/DanBloomberg/leptonica/archive/v'$env:LEPT_VER'.zip' -FileName leptonica.zip + - ps: Start-FileDownload "https://github.com/DanBloomberg/leptonica/archive/v$env:LEPT_VER.zip" -FileName leptonica.zip - 7z x leptonica.zip - cmake -Hleptonica-%LEPT_VER% -Bleptonica-%LEPT_VER%/build -G "%generator%" - msbuild leptonica-%LEPT_VER%/build/leptonica.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" From dac1bd4c9ed051b4b829c46b184f7717d842ed87 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 12:44:36 +0300 Subject: [PATCH 06/15] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c5af5c044f..9e6b5c531d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_install: - if [[ $OSX ]]; then brew update; fi - - export LEPT_VER=1.72 + - export LEPT_VER=1.73 install: - if [[ $OSX ]]; then brew install icu4c pango; brew link --force gettext; fi From 74a72cd015b30ca1752e354e983917feb0938f70 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 12:44:52 +0300 Subject: [PATCH 07/15] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 01b3744000..6cfee649c3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,7 +13,7 @@ before_build: - if %platform%==Win32 set vcplatform=Win32 - if %platform%==Win64 set vcplatform=x64 - - set LEPT_VER=1.72 + - set LEPT_VER=1.73 - ps: Start-FileDownload "https://github.com/DanBloomberg/leptonica/archive/v$env:LEPT_VER.zip" -FileName leptonica.zip - 7z x leptonica.zip From 2cf2cfcf99d720992fb92843ee66b71c7cc6c0eb Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 13:39:59 +0300 Subject: [PATCH 08/15] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8387f32657..eac373968e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ set(VERSION_MAJOR 3) set(VERSION_MINOR 05) set(VERSION_PLAIN ${VERSION_MAJOR}.${VERSION_MINOR}) -set(MINIMUM_LEPTONICA_VERSION 1.71) +set(MINIMUM_LEPTONICA_VERSION 1.73) if (NOT Leptonica_BUILD_DIR) find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED) From 9bfa7643b4269d586497483efd5151fad014930a Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 13:42:59 +0300 Subject: [PATCH 09/15] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e6b5c531d..572c1e3ed7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ before_install: install: - if [[ $OSX ]]; then brew install icu4c pango; brew link --force gettext; fi - if [[ $OSX ]]; then export ICU_ROOT=/usr/local/opt/icu4c ; fi - - wget --no-check-certificate https://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.sh - - sudo sh cmake-3.3.1-Linux-x86_64.sh --skip-license --prefix=/usr + - wget --no-check-certificate https://www.cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.sh + - sudo sh cmake-3.4.1-Linux-x86_64.sh --skip-license --prefix=/usr - wget -O leptonica.zip https://github.com/DanBloomberg/leptonica/archive/v$LEPT_VER.zip - unzip leptonica.zip -d . - cmake -Hleptonica-$LEPT_VER -Bleptonica-$LEPT_VER/build From b9a6aa823b50989ce30ce1f1637e7ad3f95c62b6 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 14:04:29 +0300 Subject: [PATCH 10/15] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eac373968e..8387f32657 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ set(VERSION_MAJOR 3) set(VERSION_MINOR 05) set(VERSION_PLAIN ${VERSION_MAJOR}.${VERSION_MINOR}) -set(MINIMUM_LEPTONICA_VERSION 1.73) +set(MINIMUM_LEPTONICA_VERSION 1.71) if (NOT Leptonica_BUILD_DIR) find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED) From 94be926be07383dac9dd56caf222a62bfe66f557 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 14:14:48 +0300 Subject: [PATCH 11/15] Update leptonica version. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eac373968e..ac75d8de0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,10 +46,9 @@ set(VERSION_PLAIN ${VERSION_MAJOR}.${VERSION_MINOR}) set(MINIMUM_LEPTONICA_VERSION 1.73) -if (NOT Leptonica_BUILD_DIR) +if (NOT WIN32) find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED) else() -set(Leptonica_DIR ${Leptonica_BUILD_DIR}) find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG) endif() From ef32ec9c68448e2d751a4dbe19dc3969c2644a31 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 14:15:17 +0300 Subject: [PATCH 12/15] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 572c1e3ed7..69ba4d1535 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,5 +43,5 @@ install: script: - mkdir build - cd build - - cmake .. -DLeptonica_BUILD_DIR=leptonica-$LEPT_VER/build + - cmake .. -DLeptonica_DIR=leptonica-$LEPT_VER/build - make From ddcac38ffc8d936bc3089059daed41cbd52bf42e Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 14:15:37 +0300 Subject: [PATCH 13/15] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6cfee649c3..8e24ac4356 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,5 +23,5 @@ before_build: build_script: - mkdir build - cd build - - cmake .. -G "%generator%" -DLeptonica_BUILD_DIR=leptonica-%LEPT_VER%/build -DSTATIC=1 + - cmake .. -G "%generator%" -DLeptonica_DIR=leptonica-%LEPT_VER%/build -DSTATIC=1 - msbuild tesseract.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" From 0970227ca74e6f05c5f7eb83ffc9b81e2e3e884f Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 14:28:41 +0300 Subject: [PATCH 14/15] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b59711441e..2f9fb25c8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ set(VERSION_PLAIN ${VERSION_MAJOR}.${VERSION_MINOR}) set(MINIMUM_LEPTONICA_VERSION 1.71) -if (NOT WIN32) +if (NOT Leptonica_DIR) find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED) else() find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG) From b48abd8e1794cd444112cab90e6c3be2b13a724c Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Tue, 26 Jan 2016 14:52:18 +0300 Subject: [PATCH 15/15] Improve leptonica search. --- CMakeLists.txt | 5 ++-- cmake/FindLeptonica.cmake | 52 --------------------------------------- 2 files changed, 3 insertions(+), 54 deletions(-) delete mode 100644 cmake/FindLeptonica.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f9fb25c8d..ad1d4ae1c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,8 +46,9 @@ set(VERSION_PLAIN ${VERSION_MAJOR}.${VERSION_MINOR}) set(MINIMUM_LEPTONICA_VERSION 1.71) -if (NOT Leptonica_DIR) -find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED) +if (NOT Leptonica_DIR AND NOT MSVC) +find_package(PkgConfig REQUIRED) +pkg_check_modules(Leptonica REQUIRED lept) else() find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG) endif() diff --git a/cmake/FindLeptonica.cmake b/cmake/FindLeptonica.cmake deleted file mode 100644 index 59723ed2e7..0000000000 --- a/cmake/FindLeptonica.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# -# Find Leptonica -# -# Exported variables: -# Leptonica_FOUND -# Leptonica_INCLUDE_DIRS -# Leptonica_LIBRARIES -# -# Leptonica_VERSION -# Leptonica_MAJOR_VERSION -# Leptonica_MINOR_VERSION -# - -find_path(Leptonica_INCLUDE_DIR leptonica/allheaders.h - HINTS - /usr/include - /usr/local/include - /opt/include - /opt/local/include - ${Leptonica_DIR}/include -) -if(NOT "${Leptonica_INCLUDE_DIR}" EQUAL "Leptonica_INCLUDE_DIR-NOTFOUND") - set(Leptonica_INCLUDE_DIRS ${Leptonica_INCLUDE_DIR}/leptonica) - file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MAJOR_VERSION REGEX "LIBLEPT_MAJOR_VERSION") - file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MINOR_VERSION REGEX "LIBLEPT_MINOR_VERSION") - string(REGEX MATCH "[0-9]+" Leptonica_MAJOR_VERSION ${Leptonica_MAJOR_VERSION}) - string(REGEX MATCH "[0-9]+" Leptonica_MINOR_VERSION ${Leptonica_MINOR_VERSION}) - set(Leptonica_VERSION ${Leptonica_MAJOR_VERSION}.${Leptonica_MINOR_VERSION}) -endif() - -find_library(Leptonica_LIBRARY NAMES lept liblept - HINTS - /usr/lib - /usr/local/lib - /opt/lib - /opt/local/lib - ${Leptonica_DIR}/lib -) -set(Leptonica_LIBRARIES ${Leptonica_LIBRARY}) - -include(FindPackageHandleStandardArgs) - -find_package_handle_standard_args(Leptonica - REQUIRED_VARS - Leptonica_INCLUDE_DIRS - Leptonica_LIBRARIES - VERSION_VAR Leptonica_VERSION - FAIL_MESSAGE "Try to set Leptonica_DIR or Leptonica_ROOT" -) - -mark_as_advanced(Leptonica_INCLUDE_DIRS Leptonica_LIBRARIES) -