DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.74k stars 387 forks source link

leptonica build problem while trying to build tesseract and opencv from source #654

Closed Zaryob closed 1 year ago

Zaryob commented 1 year ago

I'm trying to compile opencv with text support. I can build whether my system have leptonica dependency, but in windows, lack of leptonica problematic.

I want to compile both of them from source, with add_subdirectory strategy. I can build tesseract with following configuration

add_subdirectory(submodules/leptonica)
set(ENV{PKG_CONFIG_PATH} "${CMAKE_BINARY_DIR}/submodules/leptonica")
add_subdirectory(submodules/tesseract)

But when I add opencv in this build as shown below

add_subdirectory(submodules/leptonica)
set(ENV{PKG_CONFIG_PATH} "${CMAKE_BINARY_DIR}/submodules/leptonica")
option(BUILD_TRAINING_TOOLS "" OFF)
add_subdirectory(submodules/tesseract)
add_subdirectory(submodules/opencv)

I take this CMake out:

-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Detected processor: x86_64
-- Looking for ccache - not found
-- Found ZLIB: /lib64/libz.so (found suitable version "1.2.12", minimum required is "1.2.3") 
Cleaning INTERNAL cached variable: JPEG_LIBRARY
Cleaning INTERNAL cached variable: JPEG_INCLUDE_DIR
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
-- libjpeg-turbo: VERSION = 2.1.3, BUILD = opencv-4.6.0-dev-libjpeg-turbo
Cleaning INTERNAL cached variable: TIFF_LIBRARY
Cleaning INTERNAL cached variable: TIFF_INCLUDE_DIR
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) 
Cleaning INTERNAL cached variable: WEBP_LIBRARY
Cleaning INTERNAL cached variable: WEBP_INCLUDE_DIR
-- Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
-- OpenJPEG: VERSION = 2.4.0, BUILD = opencv-4.6.0-dev-openjp2-2.4.0
-- OpenJPEG libraries will be built from sources: libopenjp2 (version "2.4.0")
-- Found ZLIB: /lib64/libz.so (found version "1.2.12") 
-- libva: missing va.h header (VA_INCLUDE_DIR)
-- IPPICV: Downloading ippicv_2020_lnx_intel64_20191018_general.tgz from https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz
-- Try 1 failed
-- 
=======================================================================
  Couldn't download files from the Internet.
  Please check the Internet access on this host.
=======================================================================

CMake Warning at submodules/opencv/cmake/OpenCVDownload.cmake:248 (message):
  IPPICV: Download failed: 6;"Couldn't resolve host name"

  For details please refer to the download log file:

  /home/zaryob/Development/Qttoman/build/submodules/opencv/CMakeDownloadLog.txt

Call Stack (most recent call first):
  submodules/opencv/3rdparty/ippicv/ippicv.cmake:37 (ocv_download)
  submodules/opencv/cmake/OpenCVFindIPP.cmake:259 (download_ippicv)
  submodules/opencv/cmake/OpenCVFindLibsPerf.cmake:12 (include)
  submodules/opencv/CMakeLists.txt:747 (include)

-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY) 
-- Could NOT find BLAS (missing: BLAS_LIBRARIES) 
-- Could NOT find LAPACK (missing: LAPACK_LIBRARIES) 
    Reason given by package: LAPACK could not be found because dependency BLAS could not be found.

-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 AWT) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- ADE: Downloading v0.1.2a.zip from https://github.com/opencv/ade/archive/v0.1.2a.zip
-- Try 1 failed
-- 
=======================================================================
  Couldn't download files from the Internet.
  Please check the Internet access on this host.
=======================================================================

CMake Warning at submodules/opencv/cmake/OpenCVDownload.cmake:248 (message):
  ADE: Download failed: 6;"Couldn't resolve host name"

  For details please refer to the download log file:

  /home/zaryob/Development/Qttoman/build/submodules/opencv/CMakeDownloadLog.txt

Call Stack (most recent call first):
  submodules/opencv/modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
  submodules/opencv/modules/gapi/cmake/init.cmake:20 (include)
  submodules/opencv/cmake/OpenCVModule.cmake:298 (include)
  submodules/opencv/cmake/OpenCVModule.cmake:361 (_add_modules_1)
  submodules/opencv/cmake/OpenCVModule.cmake:385 (ocv_glob_modules)
  submodules/opencv/CMakeLists.txt:945 (ocv_register_modules)

-- Checking for module 'gtk+-3.0'
--   Package 'gtk+-3.0', required by 'virtual:world', not found
-- Checking for module 'gtk+-2.0'
--   Package 'gtk+-2.0', required by 'virtual:world', not found
-- Checking for modules 'libavcodec;libavformat;libavutil;libswscale'
--   Package 'libavcodec', required by 'virtual:world', not found
--   Package 'libavformat', required by 'virtual:world', not found
--   Package 'libavutil', required by 'virtual:world', not found
--   Package 'libswscale', required by 'virtual:world', not found
-- FFMPEG is disabled. Required libraries: libavcodec;libavformat;libavutil;libswscale. Missing libraries: libavcodec;libavformat;libavutil;libswscale
-- Checking for module 'gstreamer-base-1.0'
--   Package 'gstreamer-base-1.0', required by 'virtual:world', not found
-- Checking for module 'gstreamer-app-1.0'
--   Package 'gstreamer-app-1.0', required by 'virtual:world', not found
-- Checking for module 'gstreamer-riff-1.0'
--   Package 'gstreamer-riff-1.0', required by 'virtual:world', not found
-- Checking for module 'gstreamer-pbutils-1.0'
--   Package 'gstreamer-pbutils-1.0', required by 'virtual:world', not found
-- Checking for module 'gstreamer-video-1.0'
--   Package 'gstreamer-video-1.0', required by 'virtual:world', not found
-- Checking for module 'gstreamer-audio-1.0'
--   Package 'gstreamer-audio-1.0', required by 'virtual:world', not found
-- Checking for module 'libdc1394-2'
--   Package 'libdc1394-2', required by 'virtual:world', not found
-- Allocator metrics storage type: 'long long'
-- Excluding from source files list: modules/imgproc/src/imgwarp.lasx.cpp
-- Excluding from source files list: modules/imgproc/src/resize.lasx.cpp
-- Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /home/zaryob/Development/Qttoman/submodules/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- opencv_dnn: filter out cuda4dnn source code
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.rvv.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.lasx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/int8layers/layers_common.lasx.cpp
-- imgcodecs: OpenEXR codec is disabled in runtime. Details: https://github.com/opencv/opencv/issues/21326
-- highgui: using builtin backend: NONE
-- Found 'misc' Python modules from /home/zaryob/Development/Qttoman/submodules/opencv/modules/python/package/extra_modules
-- Found 'mat_wrapper;utils' Python modules from /home/zaryob/Development/Qttoman/submodules/opencv/modules/core/misc/python/package
-- 
-- General configuration for OpenCV 4.6.0-dev =====================================
--   Version control:               b16f76eedef6
-- 
--   Platform:
--     Timestamp:                   2022-12-04T22:10:24Z
--     Host:                        Linux 6.0.10-300.fc37.x86_64 x86_64
--     CMake:                       3.24.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               Release
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (16 files):         + SSSE3 SSE4_1
--       SSE4_2 (2 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (1 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (5 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (32 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (8 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                17
--     C++ Compiler:                /usr/bin/c++  (ver 12.2.1)
--     C++ flags (Release):         -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc ml objdetect photo stitching ts video videoio
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 gapi java python2 python3
--     Applications:                tests perf_tests apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           NONE
--     GTK+:                        NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /lib64/libz.so (ver 1.2.12)
--     JPEG:                        libjpeg-turbo (ver 2.1.3-62)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /lib64/libpng.so (ver 1.6.37)
--     TIFF:                        build (ver 42 - 4.2.0)
--     JPEG 2000:                   build (ver 2.4.0)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      NO
--       avcodec:                   NO
--       avformat:                  NO
--       avutil:                    NO
--       swscale:                   NO
--       avresample:                NO
--     GStreamer:                   NO
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     VA:                          NO
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.19.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/zaryob/Development/Qttoman/submodules/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) 
-- Can not find: /webp/mux.h
CMAKE_BUILD_TYPE = Release
-- 
-- General configuration for Leptonica 1.82.0
-- --------------------------------------------------------
-- Build type: Release
-- Compiler: GNU
-- C compiler options:  
-- Linker options:  
-- Install directory: /usr/local
-- 
-- Build with sw [SW_BUILD]: OFF
-- Build utility programs [BUILD_PROG]: OFF
-- Used ZLIB library: /lib64/libz.so
-- Used PNG library:  /lib64/libpng.so;/lib64/libz.so
-- Used JPEG library: libjpeg-turbo
-- Used JP2K library: 
-- Used TIFF library: libtiff
-- Used GIF library:  
-- Used WEBP library: libwebp
-- --------------------------------------------------------
-- 
-- Configuring tesseract version 5.2.0...
-- IPO / LTO supported
-- CMAKE_SYSTEM_PROCESSOR=<x86_64>
-- Could NOT find Leptonica (missing: Leptonica_DIR)
-- Checking for module 'lept>=1.74'
--   Found lept, version 1.82.0
-- Could NOT find LibArchive (missing: LibArchive_LIBRARY LibArchive_INCLUDE_DIR) (found version "")
-- Checking for module 'libarchive'
--   Package 'libarchive', required by 'virtual:world', not found
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) 
-- Checking for module 'libcurl'
--   Package 'libcurl', required by 'virtual:world', not found
-- 
-- General configuration for Tesseract 5.2.0
-- --------------------------------------------------------
-- Build type: Release 64 bits
-- Compiler: GNU
-- Used standard: C++17
-- CXX compiler options:  -O3 -DNDEBUG
-- Compile definitions = HAVE_AVX;HAVE_AVX2;HAVE_AVX512F;HAVE_FMA;HAVE_SSE4_1;CMAKE_BUILD;HAVE_CONFIG_H
-- Linker options:  
-- Install directory: /usr/local
-- HAVE_AVX: 1
-- HAVE_AVX2: 1
-- HAVE_AVX512F: 1
-- HAVE_FMA: 1
-- HAVE_SSE4_1: 1
-- MARCH_NATIVE_OPT: ON
-- HAVE_NEON: FALSE
-- Link-time optimization: FALSE
-- --------------------------------------------------------
-- Build with sw [SW_BUILD]: OFF
-- Build with openmp support [OPENMP_BUILD]: OFF
-- Build with libarchive support [HAVE_LIBARCHIVE]: 
-- Build with libcurl support [HAVE_LIBCURL]: 
-- Enable float for LSTM [FAST_FLOAT]: ON
-- Disable disable graphics (ScrollView) [GRAPHICS_DISABLED]: OFF
-- Disable the legacy OCR engine [DISABLED_LEGACY_ENGINE]: OFF
-- Build training tools [BUILD_TRAINING_TOOLS]: OFF
-- Build tests [BUILD_TESTS]: ON
-- Use system ICU Library [USE_SYSTEM_ICU]: OFF
-- Install tesseract configs [INSTALL_CONFIGS]: ON
-- --------------------------------------------------------
-- 
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/home/zaryob/Development/Qttoman/submodules/leptonica/src/WEBPMUX_INCLUDE_DIR
   used as include directory in directory /home/zaryob/Development/Qttoman/submodules/leptonica/src

CMake Warning (dev) in submodules/opencv/modules/core/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/core/opencl_kernels_core.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/core/opencl_kernels_core.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/imgproc/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/imgproc/opencl_kernels_imgproc.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/imgproc/opencl_kernels_imgproc.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/photo/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/photo/opencl_kernels_photo.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/photo/opencl_kernels_photo.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/dnn/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/dnn/opencl_kernels_dnn.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/dnn/opencl_kernels_dnn.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/features2d/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/features2d/opencl_kernels_features2d.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/features2d/opencl_kernels_features2d.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/calib3d/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/calib3d/opencl_kernels_calib3d.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/calib3d/opencl_kernels_calib3d.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/objdetect/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/objdetect/opencl_kernels_objdetect.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/objdetect/opencl_kernels_objdetect.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/stitching/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/stitching/opencl_kernels_stitching.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/stitching/opencl_kernels_stitching.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in submodules/opencv/modules/video/CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/video/opencl_kernels_video.cpp"
    "/home/zaryob/Development/Qttoman/build/submodules/opencv/modules/video/opencl_kernels_video.hpp"

  from processing by AUTOMOC and AUTOUIC.  If any of the files should be
  processed, set CMP0071 to NEW.  If any of the files should not be
  processed, explicitly exclude them by setting the source file property
  SKIP_AUTOGEN:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  Target "leptonica" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/submodules/opencv/3rdparty/libjpeg-turbo/src"

  which is prefixed in the source directory.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  Target "leptonica" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/submodules/opencv/3rdparty/libtiff"

  which is prefixed in the source directory.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  Target "leptonica" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/3rdparty/libtiff"

  which is prefixed in the build directory.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  Target "leptonica" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/3rdparty/libtiff"

  which is prefixed in the build directory.Target "leptonica"
  INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/build/submodules/opencv/3rdparty/libtiff"

  which is prefixed in the source directory.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  Target "leptonica" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/submodules/opencv/3rdparty/libwebp/src"

  which is prefixed in the source directory.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  Target "leptonica" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/zaryob/Development/Qttoman/submodules/leptonica/src/WEBPMUX_INCLUDE_DIR-NOTFOUND"

  which is prefixed in the source directory.

CMake Error: install(EXPORT "LeptonicaTargets" ...) includes target "leptonica" which requires target "libjpeg-turbo" that is not in any export set.
CMake Error: install(EXPORT "LeptonicaTargets" ...) includes target "leptonica" which requires target "libtiff" that is not in any export set.
CMake Error: install(EXPORT "LeptonicaTargets" ...) includes target "leptonica" which requires target "libwebp" that is not in any export set.
CMake Error in submodules/leptonica/src/CMakeLists.txt:
  export called with target "leptonica" which requires target "libjpeg-turbo"
  that is not in any export set.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  export called with target "leptonica" which requires target "libtiff" that
  is not in any export set.

CMake Error in submodules/leptonica/src/CMakeLists.txt:
  export called with target "leptonica" which requires target "libwebp" that
  is not in any export set.

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

When I remove lines 38-41 50-L57 in "src/CMakeLists.txt" this cmake configuration error goes but in this time, compilation failed:

In file included from submodules/leptonica/src/webpio.c:55:
/home/zaryob/proj/submodules/leptonica/src/webpio.c:55:10: fatal error: "webp/decode.h": No such file or directory
#include "webp/decode.h"

Is there any way to deal with that problem??

DanBloomberg commented 1 year ago

This is not a leptonica issue.

I have no idea what you did, but suggest you build tesseract in a standard way according to instructions in the tesseract project. Then if you want to change the configuration, you're starting from a place where the build succeeds.

Zaryob commented 1 year ago

actually I add opencv and tesseract as submodules in my CMakeLists.txt file, actually I want to compile my program without using tesseract and opencv in my system. conflict I think when compiled with flags like JPEG_LIBRARIES, the targets of opencv and leptonica conflict with each other. I will try different things and let you know :)

Zaryob commented 1 year ago

I found cause of this issue. When I add OpenCV as subdirectory 3rdParty libraries of OpenCV affects leptonica's install targets. It is related with CMake's itself. So, its not about the Leptonica.