-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
90 lines (72 loc) · 1.99 KB
/
CMakeLists.txt
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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
SET(ENV{LC_ALL} "C")
# Project propertyies
PROJECT(ImageReader)
# Definitions
SET(CMAKE_CXX_STANDARD 11)
SET(CXX_STANDARD_REQUIRED ON)
SET(MEMORY "ZZ_OCR_SPACE")
SET(IN_PATH "InPath")
SET(OUT_PATH "OutPath")
SET(PAGE_RANGE "PageRange")
SET(TESS_DATA "TessData")
SET(PROGRESS_INFO "ProgressInfo")
SET(TESS_LANG "eng")
SET(PDF_POST_PROCESS "PdfPostProcess")
CONFIGURE_FILE(
"Config.h.in"
"Config.h"
)
# Files
ADD_DEFINITIONS(-DDEBUG )
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
IF(NOT MSVC)
IF(WIN32)
ADD_DEFINITIONS(-DWIN32)
INCLUDE_DIRECTORIES(/usr/i686-w64-mingw32/sys-root/mingw/include)
ENDIF(WIN32)
# Dependencies
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(TESSERACT tesseract)
#EXIT()
SET(PODOFO_LDFLAGS -lpodofo)
INCLUDE_DIRECTORIES(${TESSERACT_INCLUDE_DIRS})
SET(CMAKE_AUTOMOC ON)
FIND_PACKAGE(OpenMP REQUIRED)
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5Xml REQUIRED)
FIND_PACKAGE(Qt5PrintSupport REQUIRED)
PKG_CHECK_MODULES(POPPLER REQUIRED poppler-qt5)
INCLUDE_DIRECTORIES(${POPPLER_INCLUDE_DIRS})
SET(ImageReader_LIBS ${POPPLER_LDFLAGS} ${PODOFO_LDFLAGS})
FILE(GLOB ImageReader_SRCS
*.cc
)
LIST(SORT ImageReader_SRCS)
FILE(GLOB ImageReader_HDRS
*.hh
)
LIST(SORT ImageReader_HDRS)
ADD_EXECUTABLE(EndProcess
${ImageReader_HDRS}
${ImageReader_SRCS}
)
ADD_EXECUTABLE(FrontUI front.cpp Interprocess)
TARGET_LINK_LIBRARIES(EndProcess
${TESSERACT_LDFLAGS}
${ImageReader_LIBS}
)
IF(NOT MINGW)
TARGET_LINK_LIBRARIES(EndProcess rt)
TARGET_LINK_LIBRARIES(FrontUI rt)
ELSE(NOT MINGW)
TARGET_LINK_LIBRARIES(EndProcess intl)
TARGET_LINK_LIBRARIES(FrontUI intl)
ENDIF(NOT MINGW)
TARGET_LINK_LIBRARIES(EndProcess Qt5::Widgets Qt5::Xml Qt5::PrintSupport pthread)
TARGET_LINK_LIBRARIES(FrontUI pthread)
ELSE(NOT MSVC)
ADD_EXECUTABLE(FrontUI front.cpp Interprocess.hh)
ENDIF(NOT MSVC)