File: CMakeLists.txt

package info (click to toggle)
k2pdfopt 2.51+ds-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,480 kB
  • sloc: ansic: 81,694; cpp: 5,829; makefile: 5
file content (116 lines) | stat: -rw-r--r-- 2,592 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
project(k2pdfopt C)
cmake_minimum_required(VERSION 2.6)

# ---- Test for packages

include(FindPkgConfig)

set(K2PDFOPT_LIB "-lm")

# cmake -DCMAKE_BUILD_TYPE=Debug <path>

# TODO: configure flavour with opions
##
## option (USE_MUPDF
## 	"Use muPDF libraries" OFF)
## option (USE_GHOSTSCRIPT
## 	"Use Ghostscript executable" ON)
## option (USE_DJVU
## 	"" OFF)
## eoption (USE_GOCR
## 	"" OFF)
## option (USE_LEPTONICA
## 	"" OFF)
## option (USE_TESSERACT
## 	"" OFF)
## option (USE_JASPER
## 	"" OFF)
## option (USE_GSL
## 	"" OFF)

# HAVE_K2GUI

include(FindZLIB)
if(ZLIB_FOUND)
  set(HAVE_Z_LIB 1)
# include_directories(${ZLIB_INCLUDE_DIRS})
  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)

include(FindPNG)
if(PNG_FOUND)
  set(HAVE_PNG_LIB 1)
  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${PNG_LIBRARY_RELEASE})
endif(PNG_FOUND)

include(FindJPEG)
if(JPEG_FOUND)
  set(HAVE_JPEG_LIB 1)
  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${JPEG_LIBRARY})
endif(JPEG_FOUND)

include(FindJasper)
if(JASPER_FOUND)
  set(HAVE_JASPER_LIB 1)
endif(JASPER_FOUND)

set(HAVE_GHOSTSCRIPT 1)

# willus.h
# HAVE_GSL_LIB


# libfreetype6 (>= 2.3.9), libjbig2dec0, libjpeg8 (>= 8c), libx11-6, libxext6, zlib1g (>= 1:1.2.0)
# MUPDF_STATIC_LDFLAGS misses mupdf-js-none, and doubles libs ...


pkg_check_modules(DJVU ddjvuapi)
if(DJVU_FOUND)
  set(HAVE_DJVU_LIB 1)
  include_directories(SYSTEM ${DJVU_INCLUDEDIR})
  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${DJVU_LDFLAGS})
endif(DJVU_FOUND)

# HAVE_GOCR_LIB

pkg_check_modules(LEPTONICA lept)
if(LEPTONICA_FOUND)
  set(HAVE_LEPTONICA_LIB 1)
  include_directories(SYSTEM ${LEPTONICA_INCLUDEDIR})
  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${LEPTONICA_LDFLAGS})
endif(LEPTONICA_FOUND)

# HAVE_TESSERACT_LIB

# ---- Describe project

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CMAKE -Wall")

include_directories(. willuslib k2pdfoptlib)

configure_file (
  "${PROJECT_SOURCE_DIR}/config.h.in"
  "${PROJECT_BINARY_DIR}/config.h"
)
include_directories(${PROJECT_BINARY_DIR})

add_subdirectory(willuslib)
add_subdirectory(k2pdfoptlib)

# ms
add_executable(k2pdfopt k2pdfopt.c)
target_link_libraries (k2pdfopt k2pdfoptlib willuslib ${K2PDFOPT_LIB})

install(TARGETS k2pdfopt RUNTIME DESTINATION bin)

message("")
message("-- Summary --")
message("")
message("General:")
message("	C-flags:	'${CMAKE_C_FLAGS}' (-DCMAKE_C_FLAGS=\"...\")")
message("	Build type:	${CMAKE_BUILD_TYPE} (-DCMAKE_BUILD_TYPE=\"...\")")
message("")
message("Install:")
message("	Prefix:		'${CMAKE_INSTALL_PREFIX}' (-DCMAKE_INSTALL_PREFIX=...)")
message("	Doc path:	'${DOC_PATH}' (-DDOC_PATH=...)")
message("")