From d5f23a61b36de564c660ce37fec28bbc2b58f1e1 Mon Sep 17 00:00:00 2001 From: zdenop Date: Wed, 24 Apr 2019 21:42:58 +0200 Subject: [PATCH] cmake: fixes #2337 Android cross-build --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bad8a98d0c..6e0425d5ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,7 @@ endif() ############################################################################### if(NOT CPPAN_BUILD) - if (NOT Leptonica_DIR AND NOT MSVC) + if (NOT Leptonica_DIR AND NOT MSVC AND COMMAND pkg_check_modules) find_package(PkgConfig REQUIRED) pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION}) link_directories(${Leptonica_LIBRARY_DIRS}) @@ -292,7 +292,11 @@ include_directories(src/textord) include_directories(src/viewer) include_directories(src/wordrec) if(CMAKE_EXPORT_COMPILE_COMMANDS) -include_directories(src/training) + include_directories(src/training) +endif() +if(ANDROID_TOOLCHAIN) + include_directories(${ANDROID_TOOLCHAIN}/sysroot/usr/include) + add_compile_definitions(__ANDROID_API_FUTURE__) endif() ########################################