Can't build CMake project with additional libs #281

Open
opened 2026-01-29 16:39:52 +00:00 by claunia · 0 comments
Owner

Originally created by @Izaron on GitHub (Feb 18, 2017).

CLion uses CMake, and I can't build it, for example, with OCR
I have installed tesseract and leptonica developer libraries

option (WITH_OCR "Build with OCR (Optical Character Recognition) feature" OFF)

When I trying to change "OFF" to "ON" and clean cmake and cmake folder, I get an errors

<...>
compilation terminated.
/bin/sh: -I/usr/include/leptonica: No such file or directory
lib_ccx/CMakeFiles/ccx.dir/build.make:62: recipe for target 'lib_ccx/CMakeFiles/ccx.dir/__/zvbi/decoder.c.o' failed
gmake[3]: *** [lib_ccx/CMakeFiles/ccx.dir/__/zvbi/decoder.c.o] Error 127
/bin/sh: -I/usr/include/leptonica: No such file or directory
gmake[3]: *** Waiting for unfinished jobs....
<...>

I tried change code in this part:

#if (WITH_OCR)
  find_package(PkgConfig)

  pkg_check_modules (TESSERACT REQUIRED tesseract)
  pkg_check_modules (LEPTONICA REQUIRED lept)

  set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_LIBRARIES})
  set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_LIBRARIES})
  include_directories (${TESSERACT_INCLUDE_DIRS} ${LEPTONICA_INCLUDE_DIRS})
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR")
#endif (WITH_OCR)

But got very strange behavior - this includies and define ENABLE_OCR is available only in ccextractor.c file.
Can anyone fix it? I would be very glad.

Originally created by @Izaron on GitHub (Feb 18, 2017). CLion uses CMake, and I can't build it, for example, with OCR I have installed tesseract and leptonica developer libraries ``` option (WITH_OCR "Build with OCR (Optical Character Recognition) feature" OFF) ``` When I trying to change "OFF" to "ON" and clean cmake and cmake folder, I get an errors ``` <...> compilation terminated. /bin/sh: -I/usr/include/leptonica: No such file or directory lib_ccx/CMakeFiles/ccx.dir/build.make:62: recipe for target 'lib_ccx/CMakeFiles/ccx.dir/__/zvbi/decoder.c.o' failed gmake[3]: *** [lib_ccx/CMakeFiles/ccx.dir/__/zvbi/decoder.c.o] Error 127 /bin/sh: -I/usr/include/leptonica: No such file or directory gmake[3]: *** Waiting for unfinished jobs.... <...> ``` I tried change code in this part: ``` #if (WITH_OCR) find_package(PkgConfig) pkg_check_modules (TESSERACT REQUIRED tesseract) pkg_check_modules (LEPTONICA REQUIRED lept) set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_LIBRARIES}) set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_LIBRARIES}) include_directories (${TESSERACT_INCLUDE_DIRS} ${LEPTONICA_INCLUDE_DIRS}) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR") #endif (WITH_OCR) ``` But got very strange behavior - this includies and define `ENABLE_OCR` is available only in ccextractor.c file. Can anyone fix it? I would be very glad.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#281