Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.87 KB | None | 0 0
  1. diff --git CMakeLists.txt CMakeLists.txt
  2. index 4a2378b5e9..2ed0ccca4b 100644
  3. --- CMakeLists.txt
  4. +++ CMakeLists.txt
  5. @@ -54,0 +55 @@
  6. +  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${JASPER_LIBRARY})
  7. @@ -57,11 +58 @@
  8. -# paths from willuslib/wgs.c
  9. -find_program(GHOSTSCRIPT_EXECUTABLE gs
  10. -#  PATHS /usr/bin /usr/share/gs /usr/local/gs /opt/gs
  11. -#    /usr/share/gs* /usr/local/gs* /opt/gs*
  12. -)
  13. -if(GHOSTSCRIPT_EXECUTABLE)
  14. -  set(HAVE_GHOSTSCRIPT 1)
  15. -  message(STATUS "Found ghostscript executable")
  16. -else()
  17. -  message(STATUS "Could NOT find ghostscript executable")
  18. -endif(GHOSTSCRIPT_EXECUTABLE)
  19. +set(HAVE_GHOSTSCRIPT 1)
  20. @@ -70 +60,0 @@
  21. -# HAVE_GSL_LIB
  22. @@ -71,0 +62,6 @@
  23. +pkg_check_modules(GSL gsl)
  24. +if(GSL_FOUND)
  25. +  set(HAVE_GSL_LIB 1)
  26. +  include_directories(SYSTEM ${GSL_INCLUDEDIR})
  27. +  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GSL_LDFLAGS})
  28. +endif(GSL_FOUND)
  29. @@ -76,2 +71,0 @@
  30. -pkg_check_modules(MUPDF mupdf)
  31. -if(MUPDF_FOUND)
  32. @@ -79,7 +73 @@
  33. -  # (includes jbig2dec, openjpeg, freetype)
  34. -  include_directories(SYSTEM ${MUPDF_INCLUDEDIR})
  35. -  message(STATUS "mupdf libraries: ${MUPDF_LDFLAGS}")
  36. -  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${MUPDF_LDFLAGS}
  37. -    -lmupdf-js-none -lopenjpeg -ljbig2dec -ljpeg -lfreetype
  38. -  )
  39. -endif(MUPDF_FOUND)
  40. +set(K2PDFOPT_LIB ${K2PDFOPT_LIB} -pthread -lmupdf -lmupdf-third -lopenjp2 -ljbig2dec -lfreetype -lharfbuzz)
  41. @@ -95,2 +91,14 @@
  42. -# HAVE_LEPTONICA_LIB
  43. -# HAVE_TESSERACT_LIB
  44. +
  45. +pkg_check_modules(LEPTONICA lept)
  46. +if(LEPTONICA_FOUND)
  47. +  set(HAVE_LEPTONICA_LIB 1)
  48. +  include_directories(SYSTEM ${LEPTONICA_INCLUDEDIR})
  49. +  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${LEPTONICA_LDFLAGS} ${LEPTONICA_LIBRARIES})
  50. +endif(LEPTONICA_FOUND)
  51. +
  52. +pkg_check_modules(TESSERACT tesseract)
  53. +if(TESSERACT_FOUND)
  54. +  set(HAVE_TESSERACT_LIB 1)
  55. +  include_directories(SYSTEM ${TESSERACT_INCLUDEDIR})
  56. +  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${TESSERACT_LDFLAGS})
  57. +endif(TESSERACT_FOUND)
  58. @@ -100 +108 @@
  59. -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CMAKE -Wall")
  60. +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CMAKE -Wall -Wextra")
  61. @@ -108,0 +117,2 @@
  62. +include_directories(${PROJECT_BINARY_DIR})
  63. +
  64. @@ -112 +121,0 @@
  65. -# ms
  66. @@ -114 +123 @@
  67. -target_link_libraries (k2pdfopt k2pdfoptlib willuslib ${K2PDFOPT_LIB})
  68. +target_link_libraries(k2pdfopt k2pdfoptlib willuslib ${K2PDFOPT_LIB})
  69. @@ -115,0 +125 @@
  70. +install(TARGETS k2pdfopt RUNTIME DESTINATION bin)
  71. diff --git willuslib/CMakeLists.txt willuslib/CMakeLists.txt
  72. index 463bbc95e7..104d02e360 100644
  73. --- willuslib/CMakeLists.txt
  74. +++ willuslib/CMakeLists.txt
  75. @@ -9 +9 @@
  76. -    ocrjocr.c ocrtess.c pdfwrite.c point2d.c render.c strbuf.c string.c
  77. +    ocrgocr.c ocrtess.c pdfwrite.c point2d.c render.c strbuf.c string.c
  78. @@ -24,0 +25,4 @@
  79. +if(TESSERACT_FOUND)
  80. +  set(WILLUSLIB_SRC ${WILLUSLIB_SRC} ocrtess.c)
  81. +endif(TESSERACT_FOUND)
  82. +
  83. @@ -29,3 +33 @@
  84. -# HAVE_GOCR_LIB: ocrjocr.c
  85. -# HAVE_TESSERACT_LIB: ocrtess.c
  86. -
  87. +# HAVE_GOCR_LIB: ocrgocr.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement