-
Notifications
You must be signed in to change notification settings - Fork 3
145 lines (130 loc) · 4.97 KB
/
build.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build App
on: [workflow_dispatch]
env:
BUILD_TYPE: Release
OPENCV_VERSION: 4.2.0
LEPTONICA_VERSION: 1.74.3
TESSERACT_VERSION: 3.05.02
TESSERACT_LANGUAGE: eng
REPO_NAME: ${{ github.event.repository.name }}
LEPTONICA_BUILD: ${{github.workspace}}/leptonica/build
TESSERACT_BUILD: ${{github.workspace}}/tesseract/build
OPENCV_BUILD: ${{github.workspace}}/opencv/build
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
repository: DanBloomberg/leptonica
ref: ${{env.LEPTONICA_VERSION}}
path: leptonica
- uses: actions/checkout@v3
with:
repository: tesseract-ocr/tesseract
ref: ${{env.TESSERACT_VERSION}}
path: tesseract
- uses: actions/checkout@v3
with:
repository: opencv/opencv
ref: ${{env.OPENCV_VERSION}}
path: opencv
- uses: actions/checkout@v3
with:
path: ${{env.REPO_NAME}}
- uses: ilammy/msvc-dev-cmd@v1
- name: Build Leptonica ${{env.LEPTONICA_VERSION}}
run: |
cd ${{github.workspace}}/leptonica
cmake -B ${{env.LEPTONICA_BUILD}} -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX=${{env.LEPTONICA_BUILD}} `
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON `
-DBUILD_PROG=OFF `
-DBUILD_UTILS=OFF `
-DSW_BUILD=OFF `
-DBUILD_SHARED_LIBS=OFF `
-DPNG=OFF `
-DJPEG=OFF `
-DTIFF=OFF `
-DZLIB=OFF `
-DWEBP=OFF `
-DGIF=OFF `
-DCMAKE_CXX_FLAGS=/DNO_CONSOLE_IO=1 `
-DCMAKE_CXX_FLAGS_RELEASE=/DMT `
-DCMAKE_CXX_FLAGS_DEBUG=/DMTd `
-DSTATIC=1
cmake --build ${{env.LEPTONICA_BUILD}} --config ${{env.BUILD_TYPE}} --target install
- name: Build Tesseract-OCR ${{env.TESSERACT_VERSION}}
run: |
cd ${{github.workspace}}/tesseract
cmake -B ${{env.TESSERACT_BUILD}} -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_PREFIX_PATH=${{env.LEPTONICA_BUILD}} `
-DCMAKE_INSTALL_PREFIX=${{env.TESSERACT_BUILD}} `
-DBUILD_TRAINING_TOOLS=OFF `
-DBUILD_TESTS=OFF `
-DBUILD_PROTOS=OFF `
-DBUILD_CONFIGS=OFF `
-DBUILD_DOCS=OFF `
-DBUILD_SHARED_LIBS=OFF `
-DDISABLE_CURL=ON `
-DCMAKE_CXX_FLAGS_RELEASE=/DMT `
-DCMAKE_CXX_FLAGS_DEBUG=/DMTd `
-DSTATIC=1
cmake --build ${{env.TESSERACT_BUILD}} --config ${{env.BUILD_TYPE}} --target install
- name: Build OpenCV ${{env.OPENCV_VERSION}}
run: |
cd ${{github.workspace}}/opencv
cmake -B ${{env.OPENCV_BUILD}} -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX=${{env.OPENCV_BUILD}} `
-DBUILD_LIST="core,imgproc" `
-DBUILD_opencv_apps=OFF `
-DBUILD_opencv_calib3d=OFF `
-DBUILD_opencv_dnn=OFF `
-DBUILD_opencv_features2d=OFF `
-DBUILD_opencv_flann=OFF `
-DBUILD_opencv_gapi=OFF `
-DBUILD_opencv_highgui=OFF `
-DBUILD_opencv_imgcodecs=OFF `
-DBUILD_opencv_ml=OFF `
-DBUILD_opencv_objdetect=OFF `
-DBUILD_opencv_photo=OFF `
-DBUILD_opencv_stitching=OFF `
-DBUILD_opencv_video=OFF `
-DBUILD_opencv_videoio=OFF `
-DBUILD_opencv_world=OFF `
-DWITH_FFMPEG=OFF `
-DWITH_GSTREAMER=OFF `
-DWITH_QT=OFF `
-DWITH_OPENEXR=OFF `
-DWITH_IPP=OFF `
-DWITH_TBB=OFF `
-DWITH_EIGEN=OFF `
-DWITH_PROTOBUF=OFF `
-DWITH_LAPACK=OFF `
-DWITH_1394=OFF `
-DWITH_VTK=OFF `
-DWITH_CUDA=OFF `
-DWITH_CUFFT=OFF `
-DWITH_NVCUVID=OFF `
-DWITH_OPENGL=OFF `
-DWITH_VULKAN=OFF `
-DWITH_DSHOW=OFF `
-DBUILD_SHARED_LIBS=OFF `
-DSTATIC=1
cmake --build ${{env.OPENCV_BUILD}} --config ${{env.BUILD_TYPE}} --target install
- name: Build ${{env.REPO_NAME}}
run: |
cd ${{github.workspace}}/${{env.REPO_NAME}}
cmake -B ${{github.workspace}}/${{env.REPO_NAME}}/build -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_PREFIX_PATH="${{env.LEPTONICA_BUILD}};${{env.TESSERACT_BUILD}};${{env.OPENCV_BUILD}}" `
-DTESSERACT_LANGUAGE=${{env.TESSERACT_LANGUAGE}}
cmake --build ${{github.workspace}}/${{env.REPO_NAME}}/build --config ${{env.BUILD_TYPE}}
- uses: actions/upload-artifact@master
if: always()
with:
name: ${{env.REPO_NAME}}-${{github.ref_name}}-build
path: ${{github.workspace}}/${{env.REPO_NAME}}/build/bin