forked from oreillymedia/Learning-OpenCV-3_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
175 lines (166 loc) · 7.93 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
cmake_minimum_required(VERSION 2.8)
project( examples )
find_package( OpenCV REQUIRED )
find_package( OpenGL )
if(OPENGL_FOUND)
include_directories( ${OpenCV_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} )
else()
include_directories( ${OpenCV_INCLUDE_DIRS} )
endif()
#########################
# FOR LEARNING OPENCV 3 #
#########################
###############
### COMPILE ###
###############
# COMPILE EXAMPLES
add_executable( example_02-01 example_02-01.cpp )
add_executable( example_02-02 example_02-02.cpp )
add_executable( example_02-03 example_02-03.cpp )
add_executable( example_02-04 example_02-04.cpp )
add_executable( example_02-05 example_02-05.cpp )
add_executable( example_02-06 example_02-06.cpp )
add_executable( example_02-07 example_02-07.cpp )
add_executable( example_02-08 example_02-08.cpp )
add_executable( example_02-09 example_02-09.cpp )
add_executable( example_02-10 example_02-10.cpp )
add_executable( example_02-11 example_02-11.cpp )
add_executable( example_04-01 example_04-01.cpp )
add_executable( example_04-02 example_04-02.cpp )
add_executable( example_04-03 example_04-03.cpp )
add_executable( example_04-04 example_04-04.cpp )
add_executable( example_05-01 example_05-01.cpp )
add_executable( example_07-01 example_07-01.cpp )
add_executable( example_08-01 example_08-01.cpp )
add_executable( example_08-02 example_08-02.cpp )
add_executable( example_08-03 example_08-03.cpp )
add_executable( example_09-01 example_09-01.cpp )
add_executable( example_09-02 example_09-02.cpp )
add_executable( example_09-03 example_09-03.cpp )
if(OPENGL_FOUND)
add_executable( example_09-04 example_09-04.cpp )
endif()
# Can only build if you have Qt installed add_executable( example_09-05 example_09-05.cpp )
add_executable( example_10-01 example_10-01.cpp )
add_executable( example_10-02 example_10-02.cpp )
add_executable( example_10-03 example_10-03.cpp )
add_executable( example_11-01 example_11-01.cpp )
add_executable( example_11-02 example_11-02.cpp )
add_executable( example_11-03 example_11-03.cpp )
add_executable( example_12-01 example_12-01.cpp )
add_executable( example_12-02 example_12-02.cpp )
add_executable( example_12-03 example_12-03.cpp )
add_executable( example_12-04 example_12-04.cpp )
add_executable( example_13-01 example_13-01.cpp )
add_executable( example_13-02 example_13-02.cpp )
add_executable( example_13-03 example_13-03.cpp )
add_executable( example_14-01 example_14-01.cpp )
add_executable( example_14-02 example_14-02.cpp )
add_executable( example_14-03 example_14-03.cpp )
add_executable( example_14-04 example_14-04.cpp )
add_executable( example_15-01 example_15-01.cpp )
add_executable( example_15-02 example_15-02.cpp )
add_executable( example_15-03 example_15-03.cpp )
add_executable( example_15-04 example_15-04.cpp )
add_executable( example_15-05 example_15-05.cpp )
add_executable( example_15-BackgroundSubtractor example_15-BackgroundSubtractor.cpp )
add_executable( example_16-01 example_16-01.cpp )
add_executable( example_16-02 example_16-02.cpp )
add_executable( example_17-01 example_17-01.cpp )
add_executable( example_17-02 example_17-02.cpp )
add_executable( example_18-01 example_18-01.cpp )
add_executable( example_18-01_from_disk example_18-01_from_disk.cpp )
add_executable( example_19-01 example_19-01.cpp )
add_executable( example_19-02 example_19-02.cpp )
add_executable( example_19-03 example_19-03.cpp )
add_executable( example_19-04 example_19-04.cpp )
add_executable( example_20-01 example_20-01.cpp )
add_executable( example_20-02 example_20-02.cpp )
add_executable( example_21-01 example_21-01.cpp )
add_executable( example_22-01 example_22-01.cpp )
# NOW COMPILE SOME ANSWERS TO EXERCISES:
add_executable( Exercises_5 Exercises_5.cpp )
add_executable( Exercises_7 Exercises_7.cpp )
add_executable( Exercises_8_1 Exercises_8_1.cpp )
add_executable( Exercises_9_1-2-10-11-12-15-16 Exercises_9_1-2-10-11-12-15-16.cpp )
add_executable( Exercises_9_4 Exercises_9_4.cpp )
add_executable( Exercises_9_5 Exercises_9_5.cpp )
add_executable( Exercises_11-1-2-5-6-7 Exercises_11-1-2-5-6-7.cpp )
################
### LINK ###
################
# FIRST LINK EXAMPLES:
target_link_libraries( example_02-01 ${OpenCV_LIBS} )
target_link_libraries( example_02-02 ${OpenCV_LIBS} )
target_link_libraries( example_02-03 ${OpenCV_LIBS} )
target_link_libraries( example_02-04 ${OpenCV_LIBS} )
target_link_libraries( example_02-05 ${OpenCV_LIBS} )
target_link_libraries( example_02-06 ${OpenCV_LIBS} )
target_link_libraries( example_02-07 ${OpenCV_LIBS} )
target_link_libraries( example_02-08 ${OpenCV_LIBS} )
target_link_libraries( example_02-09 ${OpenCV_LIBS} )
target_link_libraries( example_02-10 ${OpenCV_LIBS} )
target_link_libraries( example_02-11 ${OpenCV_LIBS} )
target_link_libraries( example_04-01 ${OpenCV_LIBS} )
target_link_libraries( example_04-02 ${OpenCV_LIBS} )
target_link_libraries( example_04-03 ${OpenCV_LIBS} )
target_link_libraries( example_04-04 ${OpenCV_LIBS} )
target_link_libraries( example_05-01 ${OpenCV_LIBS} )
target_link_libraries( example_07-01 ${OpenCV_LIBS} )
target_link_libraries( example_08-01 ${OpenCV_LIBS} )
target_link_libraries( example_08-02 ${OpenCV_LIBS} )
target_link_libraries( example_08-03 ${OpenCV_LIBS} )
target_link_libraries( example_09-01 ${OpenCV_LIBS} )
target_link_libraries( example_09-02 ${OpenCV_LIBS} )
target_link_libraries( example_09-03 ${OpenCV_LIBS} )
target_link_libraries( example_09-02 ${OpenCV_LIBS} )
target_link_libraries( example_09-03 ${OpenCV_LIBS} )
if(OPENGL_FOUND)
target_link_libraries( example_09-04 ${OpenCV_LIBS} ${OPENGL_LIBRARIES} )
endif()
# Need Qt target_link_libraries( example_09-05 ${OpenCV_LIBS} )
target_link_libraries( example_10-01 ${OpenCV_LIBS} )
target_link_libraries( example_10-02 ${OpenCV_LIBS} )
target_link_libraries( example_10-03 ${OpenCV_LIBS} )
target_link_libraries( example_11-01 ${OpenCV_LIBS} )
target_link_libraries( example_11-02 ${OpenCV_LIBS} )
target_link_libraries( example_11-03 ${OpenCV_LIBS} )
target_link_libraries( example_12-01 ${OpenCV_LIBS} )
target_link_libraries( example_12-02 ${OpenCV_LIBS} )
target_link_libraries( example_12-03 ${OpenCV_LIBS} )
target_link_libraries( example_12-04 ${OpenCV_LIBS} )
target_link_libraries( example_13-01 ${OpenCV_LIBS} )
target_link_libraries( example_13-02 ${OpenCV_LIBS} )
target_link_libraries( example_13-03 ${OpenCV_LIBS} )
target_link_libraries( example_14-01 ${OpenCV_LIBS} )
target_link_libraries( example_14-02 ${OpenCV_LIBS} )
target_link_libraries( example_14-03 ${OpenCV_LIBS} )
target_link_libraries( example_14-04 ${OpenCV_LIBS} )
target_link_libraries( example_15-01 ${OpenCV_LIBS} )
target_link_libraries( example_15-02 ${OpenCV_LIBS} )
target_link_libraries( example_15-03 ${OpenCV_LIBS} )
target_link_libraries( example_15-04 ${OpenCV_LIBS} )
target_link_libraries( example_15-05 ${OpenCV_LIBS} )
target_link_libraries( example_15-BackgroundSubtractor ${OpenCV_LIBS} )
target_link_libraries( example_16-01 ${OpenCV_LIBS} )
target_link_libraries( example_16-02 ${OpenCV_LIBS} )
target_link_libraries( example_17-01 ${OpenCV_LIBS} )
target_link_libraries( example_17-02 ${OpenCV_LIBS} )
target_link_libraries( example_18-01 ${OpenCV_LIBS} )
target_link_libraries( example_18-01_from_disk ${OpenCV_LIBS} )
target_link_libraries( example_19-01 ${OpenCV_LIBS} )
target_link_libraries( example_19-02 ${OpenCV_LIBS} )
target_link_libraries( example_19-03 ${OpenCV_LIBS} )
target_link_libraries( example_19-04 ${OpenCV_LIBS} )
target_link_libraries( example_20-01 ${OpenCV_LIBS} )
target_link_libraries( example_20-02 ${OpenCV_LIBS} )
target_link_libraries( example_21-01 ${OpenCV_LIBS} )
target_link_libraries( example_22-01 ${OpenCV_LIBS} )
# NOW LINK EXERCISES
target_link_libraries( Exercises_5 ${OpenCV_LIBS} )
target_link_libraries( Exercises_7 ${OpenCV_LIBS} )
target_link_libraries( Exercises_8_1 ${OpenCV_LIBS} )
target_link_libraries( Exercises_9_1-2-10-11-12-15-16 ${OpenCV_LIBS} )
target_link_libraries( Exercises_9_4 ${OpenCV_LIBS} )
target_link_libraries( Exercises_9_5 ${OpenCV_LIBS} )
target_link_libraries( Exercises_11-1-2-5-6-7 ${OpenCV_LIBS} )