-
Notifications
You must be signed in to change notification settings - Fork 14
/
FindOpenCV.cmake
463 lines (429 loc) · 15.2 KB
/
FindOpenCV.cmake
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# - Try to find OpenCV library installation
# See http://sourceforge.net/projects/opencvlibrary/
#
# The follwoing variables are optionally searched for defaults
# OpenCV_ROOT_DIR: Base directory of OpenCv tree to use.
# OpenCV_FIND_REQUIRED_COMPONENTS : FIND_PACKAGE(OpenCV COMPONENTS ..)
# compatible interface. typically CV CXCORE CVAUX HIGHGUI CVCAM .. etc.
#
# The following are set after configuration is done:
# OpenCV_FOUND
# OpenCV_INCLUDE_DIR
# OpenCV_LIBRARIES
# OpenCV_LINK_DIRECTORIES
#
# deprecated:
# OPENCV_* uppercase replaced by case sensitive OpenCV_*
# OPENCV_EXE_LINKER_FLAGS
# OPENCV_INCLUDE_DIR : replaced by plural *_DIRS
#
# 2004/05 Jan Woetzel, Friso, Daniel Grest
# 2006/01 complete rewrite by Jan Woetzel
# 1006/09 2nd rewrite introducing ROOT_DIR and PATH_SUFFIXES
# to handle multiple installed versions gracefully by Jan Woetzel
#
# tested with:
# -OpenCV 0.97 (beta5a): MSVS 7.1, gcc 3.3, gcc 4.1
# -OpenCV 0.99 (1.0rc1): MSVS 7.1, MSVS 8.0
#
# 20 Nov 2008: Changes by Jose Luis Blanco Claraco <http://www.isa.uma.es/jlblanco>
# - Updated for finding OpenCV1.1.0-pre under Windows in the system
# registry (It can be installed along 1.0.0 without problems)
# - Finds and uses debug libraries and DLLs (Windows).
#
# www.mip.informatik.uni-kiel.de/~jw
# --------------------------------
# NOTES
# NO_CMAKE_SYSTEM_PATH is required to bypass searching in CMAKE_SYSTEM_LIBRARY_PATH
# because it defaults to $ENV{ProgramFiles} in WindowsPaths.cmake
# which corrupts the order of BIAS_EXTERN_LIBS (JW 02/2007)
MACRO(DBG_MSG _MSG)
#MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):\n${_MSG}")
ENDMACRO(DBG_MSG)
# required cv components with header and library if COMPONENTS unspecified
IF (NOT OpenCV_FIND_COMPONENTS)
# default
SET(OpenCV_FIND_REQUIRED_COMPONENTS HIGHGUI CXCORE IMGPROC)
ENDIF (NOT OpenCV_FIND_COMPONENTS)
# typical root dirs of installations, exactly one of them is used
FILE(GLOB OPENCV2_PATHS "$ENV{ProgramFiles}/../OpenCV*.*")
# typical root dirs of installations, exactly one of them is used
SET (OpenCV_POSSIBLE_ROOT_DIRS
"/usr/local"
)
#
# select exactly ONE OpenCV base directory/tree
# to avoid mixing different version headers and libs
#
FIND_PATH(OpenCV_ROOT_DIR
NAMES
cv/include/cv.h # windows
include/opencv/cv.h # linux /opt/net
include/cv/cv.h
include/cv.h
PATHS ${OpenCV_POSSIBLE_ROOT_DIRS})
DBG_MSG("OpenCV_ROOT_DIR=${OpenCV_ROOT_DIR}")
# header include dir suffixes appended to OpenCV_ROOT_DIR
SET(OpenCV_INCDIR_SUFFIXES
include/opencv
)
#message(STATUS "OpenCV_INCDIR_SUFFIXES=${OpenCV_INCDIR_SUFFIXES}")
# library linkdir suffixes appended to OpenCV_ROOT_DIR
SET(OpenCV_LIBDIR_SUFFIXES
lib
)
#message(STATUS "OpenCV_LIBDIR_SUFFIXES=${OpenCV_LIBDIR_SUFFIXES}")
#
# find incdir for each lib
#
#message(STATUS "Opencv_ROOT_DIR: " ${OpenCV_ROOT_DIR})
FIND_PATH(OpenCV_CV_INCLUDE_DIR
NAMES cv.h
PATHS ${OpenCV_ROOT_DIR}
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
FIND_PATH(OpenCV_CXCORE_INCLUDE_DIR
NAMES cxcore.h
PATHS ${OpenCV_ROOT_DIR}
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
FIND_PATH(OpenCV_CVAUX_INCLUDE_DIR
NAMES cvaux.h
PATHS ${OpenCV_ROOT_DIR}
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR
NAMES highgui.h
PATHS ${OpenCV_ROOT_DIR}
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
#FIND_PATH(OpenCV_CVCAM_INCLUDE_DIR
# NAMES cvcam.h
# PATHS ${OpenCV_ROOT_DIR}
# PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
FIND_LIBRARY(OpenCV_HIGHGUI_LIBRARY
NAMES libopencv_highgui.so
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES}
NO_CMAKE_SYSTEM_PATH )
#message(STATUS "OpenCV_HIGHGUI_LIBRARY=${OpenCV_HIGHGUI_LIBRARY}")
#
# Logic selecting required libs and headers
#
FIND_LIBRARY(OpenCV_CXCORE_LIBRARY
NAMES libopencv_core.so
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES}
NO_CMAKE_SYSTEM_PATH )
#message(STATUS "OpenCV_CXCORE_LIBRARY=${OpenCV_CXCORE_LIBRARY}")
FIND_LIBRARY(OpenCV_IMGPROC_LIBRARY
NAMES libopencv_imgproc.so
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES}
NO_CMAKE_SYSTEM_PATH )
message(STATUS "OpenCV_IMGPROC_LIBRARY=${OpenCV_IMGPROC_LIBRARY}")
SET(OpenCV_FOUND ON)
message(STATUS "OpenCV_FIND_REQUIRED_COMPONENTS=${OpenCV_FIND_REQUIRED_COMPONENTS}")
FOREACH(NAME ${OpenCV_FIND_REQUIRED_COMPONENTS} )
# only good if header and library both found
IF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
LIST(APPEND OpenCV_INCLUDE_DIRS ${OpenCV_${NAME}_INCLUDE_DIR} )
IF (EXISTS "${OpenCV_${NAME}_LIBRARY}" AND EXISTS "${OpenCV_${NAME}d_LIBRARY}")
#MESSAGE(STATUS "DEBUG *************** ${OpenCV_${NAME}d_LIBRARY}")
LIST(APPEND OpenCV_LIBRARIES debug;${OpenCV_${NAME}d_LIBRARY};optimized;${OpenCV_${NAME}_LIBRARY} )
ELSE(EXISTS "${OpenCV_${NAME}_LIBRARY}" AND EXISTS "${OpenCV_${NAME}d_LIBRARY}")
LIST(APPEND OpenCV_LIBRARIES ${OpenCV_${NAME}_LIBRARY} )
ENDIF(EXISTS "${OpenCV_${NAME}_LIBRARY}" AND EXISTS "${OpenCV_${NAME}d_LIBRARY}")
# message(STATUS "appending for NAME=${NAME} ${OpenCV_${NAME}_INCLUDE_DIR} and ${OpenCV_${NAME}_LIBRARY}" )
ELSE (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
# message(STATUS "OpenCV component NAME=${NAME} not found! "
# "\nOpenCV_${NAME}_INCLUDE_DIR=${OpenCV_${NAME}_INCLUDE_DIR} "
# "\nOpenCV_${NAME}_LIBRARY=${OpenCV_${NAME}_LIBRARY} ")
SET(OpenCV_FOUND OFF)
ENDIF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
ENDFOREACH(NAME)
LIST(APPEND OpenCV_LIBRARIES ${OpenCV_IMGPROC_LIBRARY})
#message(STATUS "OpenCV_INCLUDE_DIRS=${OpenCV_INCLUDE_DIRS}")
#message(STATUS "OpenCV_LIBRARIES=${OpenCV_LIBRARIES}")
# get the link directory for rpath to be used with LINK_DIRECTORIES:
IF (OpenCV_CV_LIBRARY)
GET_FILENAME_COMPONENT(OpenCV_LINK_DIRECTORIES ${OpenCV_CV_LIBRARY} PATH)
ENDIF (OpenCV_CV_LIBRARY)
MARK_AS_ADVANCED(
OpenCV_ROOT_DIR
OpenCV_INCLUDE_DIRS
OpenCV_CV_INCLUDE_DIR
OpenCV_CXCORE_INCLUDE_DIR
OpenCV_CVAUX_INCLUDE_DIR
OpenCV_CVCAM_INCLUDE_DIR
OpenCV_HIGHGUI_INCLUDE_DIR
OpenCV_LIBRARIES
OpenCV_HIGHGUI_LIBRARY
OpenCV_CXCORE_LIBRARY
OpenCV_IMGPROC_LIBRARY
)
# be backward compatible:
SET(OPENCV_LIBRARIES ${OpenCV_LIBRARIES} )
SET(OPENCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS} )
SET(OPENCV_FOUND ${OpenCV_FOUND})
SET(OpenCV_LIBS ${OpenCV_LIBRARIES} )
# display help message
IF(NOT OpenCV_FOUND)
# make FIND_PACKAGE friendly
IF(NOT OpenCV_FIND_QUIETLY)
IF(OpenCV_FIND_REQUIRED)
MESSAGE(FATAL_ERROR
"OpenCV required but some headers or libs not found. Please specify it's location with OpenCV_ROOT_DIR env. variable.")
ELSE(OpenCV_FIND_REQUIRED)
MESSAGE(STATUS
"ERROR: OpenCV was not found.")
ENDIF(OpenCV_FIND_REQUIRED)
ENDIF(NOT OpenCV_FIND_QUIETLY)
ENDIF(NOT OpenCV_FOUND)
# make FIND_PACKAGE case sensitive compatible
SET(OpenCV_FOUND ${OPENCV_FOUND})
SET(OpenCV_LIBRARIES ${OPENCV_LIBRARIES})
SET(OpenCV_INCLUDE_DIR ${OPENCV_INCLUDE_DIR})
## - Try to find OpenCV library installation
## See http://sourceforge.net/projects/opencvlibrary/
##
## The follwoing variables are optionally searched for defaults
## OpenCV_ROOT_DIR: Base directory of OpenCv tree to use.
## OpenCV_FIND_REQUIRED_COMPONENTS : FIND_PACKAGE(OpenCV COMPONENTS ..)
## compatible interface. typically CV CXCORE CVAUX HIGHGUI CVCAM .. etc.
##
## The following are set after configuration is done:
## OpenCV_FOUND
## OpenCV_INCLUDE_DIR
## OpenCV_LIBRARIES
## OpenCV_LINK_DIRECTORIES
##
## deprecated:
## OPENCV_* uppercase replaced by case sensitive OpenCV_*
## OPENCV_EXE_LINKER_FLAGS
## OPENCV_INCLUDE_DIR : replaced by plural *_DIRS
##
## 2004/05 Jan Woetzel, Friso, Daniel Grest
## 2006/01 complete rewrite by Jan Woetzel
## 1006/09 2nd rewrite introducing ROOT_DIR and PATH_SUFFIXES
## to handle multiple installed versions gracefully by Jan Woetzel
##
## tested with:
## -OpenCV 0.97 (beta5a): MSVS 7.1, gcc 3.3, gcc 4.1
## -OpenCV 0.99 (1.0rc1): MSVS 7.1
##
## www.mip.informatik.uni-kiel.de/~jw
## --------------------------------
#
#
#MACRO(DBG_MSG _MSG)
# # MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):\n${_MSG}")
#ENDMACRO(DBG_MSG)
#
#
#
## required cv components with header and library if COMPONENTS unspecified
#IF (NOT OpenCV_FIND_COMPONENTS)
# # default
# SET(OpenCV_FIND_REQUIRED_COMPONENTS CV CXCORE CVAUX HIGHGUI )
## IF (WIN32)
## LIST(APPEND OpenCV_FIND_REQUIRED_COMPONENTS CVCAM ) # WIN32 only actually
## ENDIF(WIN32)
#ENDIF (NOT OpenCV_FIND_COMPONENTS)
#
#FILE(GLOB OPENCV2_PATHS "$ENV{ProgramFiles}/../OpenCV*.*")
#
## typical root dirs of installations, exactly one of them is used
#SET (OpenCV_POSSIBLE_ROOT_DIRS
# "${OpenCV_ROOT_DIR}"
# "$ENV{OpenCV_ROOT_DIR}"
# "$ENV{OPENCV_DIR}" # only for backward compatibility deprecated by ROOT_DIR
# "$ENV{OPENCV_HOME}" # only for backward compatibility
# "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Intel(R) Open Source Computer Vision Library_is1;Inno Setup: App Path]"
# "$ENV{ProgramFiles}/OpenCV"
# "${OPENCV2_PATHS}"
# /usr/local
# /usr
# )
#
#
## MIP Uni Kiel /opt/net network installation
## get correct prefix for current gcc compiler version for gcc 3.x 4.x
#IF (${CMAKE_COMPILER_IS_GNUCXX})
# IF (NOT OpenCV_FIND_QUIETLY)
# MESSAGE(STATUS "Checking GNUCXX version 3/4 to determine OpenCV /opt/net/ path")
# ENDIF (NOT OpenCV_FIND_QUIETLY)
# EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE CXX_COMPILER_VERSION)
# IF (CXX_COMPILER_VERSION MATCHES ".*3\\.[0-9].*")
# SET(IS_GNUCXX3 TRUE)
# LIST(APPEND OpenCV_POSSIBLE_ROOT_DIRS /opt/net/gcc33/OpenCV )
# ENDIF(CXX_COMPILER_VERSION MATCHES ".*3\\.[0-9].*")
# IF (CXX_COMPILER_VERSION MATCHES ".*4\\.[0-9].*")
# SET(IS_GNUCXX4 TRUE)
# LIST(APPEND OpenCV_POSSIBLE_ROOT_DIRS /opt/net/gcc41/OpenCV )
# ENDIF(CXX_COMPILER_VERSION MATCHES ".*4\\.[0-9].*")
#ENDIF (${CMAKE_COMPILER_IS_GNUCXX})
#
##DBG_MSG("DBG (OpenCV_POSSIBLE_ROOT_DIRS=${OpenCV_POSSIBLE_ROOT_DIRS}")
#
##
## select exactly ONE OpenCV base directory/tree
## to avoid mixing different version headers and libs
##
#FIND_PATH(OpenCV_ROOT_DIR
# NAMES
# cv/include/cv.h # windows
# include/opencv/cv.h # linux /opt/net
# include/cv/cv.h
# include/cv.h
# PATHS ${OpenCV_POSSIBLE_ROOT_DIRS})
#DBG_MSG("OpenCV_ROOT_DIR=${OpenCV_ROOT_DIR}")
#
#
## header include dir suffixes appended to OpenCV_ROOT_DIR
#SET(OpenCV_INCDIR_SUFFIXES
# include
# include/cv
# include/opencv
# cv/include
# cxcore/include
# cvaux/include
# otherlibs/cvcam/include
# otherlibs/highgui
# otherlibs/highgui/include
# otherlibs/_graphics/include
# )
#
## library linkdir suffixes appended to OpenCV_ROOT_DIR
#SET(OpenCV_LIBDIR_SUFFIXES
# lib
# OpenCV/lib
# otherlibs/_graphics/lib
# )
##DBG_MSG("OpenCV_LIBDIR_SUFFIXES=${OpenCV_LIBDIR_SUFFIXES}")
#
#
##
## find incdir for each lib
##
#FIND_PATH(OpenCV_CV_INCLUDE_DIR
# NAMES cv.h
# PATHS ${OpenCV_ROOT_DIR}
# PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
#FIND_PATH(OpenCV_CXCORE_INCLUDE_DIR
# NAMES cxcore.h
# PATHS ${OpenCV_ROOT_DIR}
# PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
#FIND_PATH(OpenCV_CVAUX_INCLUDE_DIR
# NAMES cvaux.h
# PATHS ${OpenCV_ROOT_DIR}
# PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
#FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR
# NAMES highgui.h
# PATHS ${OpenCV_ROOT_DIR}
# PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
##FIND_PATH(OpenCV_CVCAM_INCLUDE_DIR
## NAMES cvcam.h
## PATHS ${OpenCV_ROOT_DIR}
## PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
#
##
## find sbsolute path to all libraries
## some are optionally, some may not exist on Linux
##
#
#FIND_LIBRARY(OpenCV_CV_LIBRARY
# NAMES cv opencv cv200 cv210
# PATHS ${OpenCV_ROOT_DIR}
# PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
#FIND_LIBRARY(OpenCV_CVAUX_LIBRARY
# NAMES cvaux cvaux200 cvaux210
# PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
##FIND_LIBRARY(OpenCV_CVCAM_LIBRARY
## NAMES cvcam
## PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
##FIND_LIBRARY(OpenCV_CVHAARTRAINING_LIBRARY
## NAMES cvhaartraining
## PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
#FIND_LIBRARY(OpenCV_CXCORE_LIBRARY
# NAMES cxcore cxcore200 cxcore210
# PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
##FIND_LIBRARY(OpenCV_CXTS_LIBRARY
## NAMES cxts
## PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
#FIND_LIBRARY(OpenCV_HIGHGUI_LIBRARY
# NAMES highgui highgui200 highgui200d
# PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
##FIND_LIBRARY(OpenCV_ML_LIBRARY
## NAMES ml
## PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
##FIND_LIBRARY(OpenCV_TRS_LIBRARY
## NAMES trs
## PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
#
#
##
## Logic selecting required libs and headers
##
#SET(OpenCV_FOUND ON)
#DBG_MSG("OpenCV_FIND_REQUIRED_COMPONENTS=${OpenCV_FIND_REQUIRED_COMPONENTS}")
#FOREACH(NAME ${OpenCV_FIND_REQUIRED_COMPONENTS} )
#
# # only good if header and library both found
# IF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
# LIST(APPEND OpenCV_INCLUDE_DIRS ${OpenCV_${NAME}_INCLUDE_DIR} )
# LIST(APPEND OpenCV_LIBRARIES ${OpenCV_${NAME}_LIBRARY} )
# #DBG_MSG("appending for NAME=${NAME} ${OpenCV_${NAME}_INCLUDE_DIR} and ${OpenCV_${NAME}_LIBRARY}" )
# ELSE (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
# DBG_MSG("OpenCV component NAME=${NAME} not found! "
# "\nOpenCV_${NAME}_INCLUDE_DIR=${OpenCV_${NAME}_INCLUDE_DIR} "
# "\nOpenCV_${NAME}_LIBRARY=${OpenCV_${NAME}_LIBRARY} ")
# SET(OpenCV_FOUND OFF)
# ENDIF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
#
#ENDFOREACH(NAME)
#
#DBG_MSG("OpenCV_INCLUDE_DIRS=${OpenCV_INCLUDE_DIRS}")
#DBG_MSG("OpenCV_LIBRARIES=${OpenCV_LIBRARIES}")
#
## get the link directory for rpath to be used with LINK_DIRECTORIES:
#IF (OpenCV_CV_LIBRARY)
# GET_FILENAME_COMPONENT(OpenCV_LINK_DIRECTORIES ${OpenCV_CV_LIBRARY} PATH)
#ENDIF (OpenCV_CV_LIBRARY)
#
#MARK_AS_ADVANCED(
# OpenCV_ROOT_DIR
# OpenCV_INCLUDE_DIRS
# OpenCV_CV_INCLUDE_DIR
# OpenCV_CXCORE_INCLUDE_DIR
# OpenCV_CVAUX_INCLUDE_DIR
# OpenCV_CVCAM_INCLUDE_DIR
# OpenCV_HIGHGUI_INCLUDE_DIR
# OpenCV_LIBRARIES
# OpenCV_CV_LIBRARY
# OpenCV_CXCORE_LIBRARY
# OpenCV_CVAUX_LIBRARY
# OpenCV_CVCAM_LIBRARY
# OpenCV_CVHAARTRAINING_LIBRARY
# OpenCV_CXTS_LIBRARY
# OpenCV_HIGHGUI_LIBRARY
# OpenCV_ML_LIBRARY
# OpenCV_TRS_LIBRARY
# )
#
#
## be backward compatible:
#SET(OPENCV_LIBRARIES ${OpenCV_LIBRARIES} )
#SET(OPENCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS} )
#SET(OPENCV_FOUND ${OpenCV_FOUND})
#SET(OpenCV_LIBS ${OpenCV_LIBRARIES} )
##SET(OpenCV_INCLUDE_DIRS )
##SET(OpenCV_LIBRARY_DIRS )
#
#
#
## display help message
#IF(NOT OpenCV_FOUND)
# # make FIND_PACKAGE friendly
# IF(NOT OpenCV_FIND_QUIETLY)
# IF(OpenCV_FIND_REQUIRED)
# MESSAGE(FATAL_ERROR
# "OpenCV required but some headers or libs not found. Please specify it's location with OpenCV_ROOT_DIR env. variable.")
# ELSE(OpenCV_FIND_REQUIRED)
# MESSAGE(STATUS
# "ERROR: OpenCV was not found.")
# ENDIF(OpenCV_FIND_REQUIRED)
# ENDIF(NOT OpenCV_FIND_QUIETLY)