From 4ee9c847da0e6e4b01b1645502e2177e57835908 Mon Sep 17 00:00:00 2001 From: Evgeny Shulgin Date: Mon, 20 Feb 2017 19:31:58 +0300 Subject: [PATCH] Fixed CMake for OCR --- src/CMakeLists.txt | 4 ++-- src/lib_ccx/CMakeLists.txt | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2041f21..56e06fc0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,7 @@ option (WITH_SHARING "Build with sharing and translation support" OFF) # Version number set (CCEXTRACTOR_VERSION_MAJOR 0) -set (CCEXTRACTOR_VERSION_MINOR 77) +set (CCEXTRACTOR_VERSION_MINOR 85) # configure a header file to pass some of the CMake settings # to the source code @@ -92,7 +92,7 @@ if (WITH_OCR) set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES}) set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES}) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR ${TESSERACT_CFLAGS} ${LEPTONICA_CFLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR") endif (WITH_OCR) ######################################################## diff --git a/src/lib_ccx/CMakeLists.txt b/src/lib_ccx/CMakeLists.txt index 4e04ebe7..ca8f64fd 100644 --- a/src/lib_ccx/CMakeLists.txt +++ b/src/lib_ccx/CMakeLists.txt @@ -9,12 +9,16 @@ endif (WITH_FFMPEG) if (WITH_OCR) find_package(PkgConfig) - pkg_check_modules(TESSERACT REQUIRED tesseract) - pkg_check_modules(LEPTONICA REQUIRED lept) + pkg_check_modules (TESSERACT REQUIRED tesseract) + pkg_check_modules (LEPTONICA REQUIRED lept) + + set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${TESSERACT_INCLUDE_DIRS}) + set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${LEPTONICA_INCLUDE_DIRS}) set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES}) set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES}) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR ${TESSERACT_CFLAGS} ${LEPTONICA_CFLAGS}") + + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR") endif (WITH_OCR) if (WITH_SHARING) @@ -25,6 +29,8 @@ aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_ccx/" SOURCEFILE) aux_source_directory ("${PROJECT_SOURCE_DIR}/gpacmp4/" SOURCEFILE) add_library (ccx ${SOURCEFILE} ccx_dtvcc.h ccx_dtvcc.c) +target_link_libraries (ccx ${EXTRA_LIBS}) +target_include_directories (ccx PUBLIC ${EXTRA_INCLUDES}) if (MINGW OR CYGWIN) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGPAC_CONFIG_WIN32")