-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathOpenCV.cmake
73 lines (66 loc) · 3.47 KB
/
OpenCV.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
############################################################################
# Copyright 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
############################################################################
# This file is part of DUNE: Unified Navigation Environment. #
# #
# Commercial Licence Usage #
# Licencees holding valid commercial DUNE licences may use this file in #
# accordance with the commercial licence agreement provided with the #
# Software or, alternatively, in accordance with the terms contained in a #
# written agreement between you and Faculdade de Engenharia da #
# Universidade do Porto. For licensing terms, conditions, and further #
# information contact [email protected]. #
# #
# Modified European Union Public Licence - EUPL v.1.1 Usage #
# Alternatively, this file may be used under the terms of the Modified #
# EUPL, Version 1.1 only (the "Licence"), appearing in the file LICENCE.md #
# included in the packaging of this file. You may not use this work #
# except in compliance with the Licence. Unless required by applicable #
# law or agreed to in writing, software distributed under the Licence is #
# distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF #
# ANY KIND, either express or implied. See the Licence for the specific #
# language governing permissions and limitations at #
# https://github.com/LSTS/dune/blob/master/LICENCE.md and #
# http://ec.europa.eu/idabc/eupl.html. #
############################################################################
# Author: Kristian Klausen #
############################################################################
if(OPENCV)
CHECK_LIBRARY_EXISTS(opencv_core cvGetImage "" HAVE_LIB_OPENCV)
if(HAVE_LIB_OPENCV)
# OpenCV Present
set(DUNE_SYS_HAS_OPENCV 1 CACHE INTERNAL "OpenCV library")
set(DUNE_USING_OPENCV 1 CACHE INTERNAL "OpenCV library")
# FIND_PACKAGE(OpenCV REQUIRED)
dune_add_lib(opencv_calib3d)
dune_add_lib(opencv_core)
dune_add_lib(opencv_features2d)
dune_add_lib(opencv_flann)
dune_add_lib(opencv_highgui)
dune_add_lib(opencv_imgproc)
dune_add_lib(opencv_ml)
dune_add_lib(opencv_video)
dune_add_lib(opencv_videoio)
dune_add_lib(opencv_objdetect)
dune_add_lib(opencv_photo)
dune_add_lib(opencv_stitching)
#dune_add_lib(opencv_ts)
#dune_add_lib(opencv_videostab)
#dune_add_lib(opencv_nonfree)
#dune_add_lib(opencv_contrib)
#dune_add_lib(opencv_gpu)
#dune_add_lib(opencv_legacy)
# Check Header
dune_test_header(opencv2/opencv.hpp)
dune_test_header(opencv2/imgcodecs.hpp)
if(DUNE_SYS_HAS_OPENCV2_IMGCODECS_HPP)
dune_add_lib(opencv_imgcodecs)
endif(DUNE_SYS_HAS_OPENCV2_IMGCODECS_HPP)
else(HAVE_LIB_OPENCV)
# OpenCV not found on the system.
message(SEND_ERROR "OpenCV was not found on the system.")
set(DUNE_SYS_HAS_OPENCV 0 CACHE INTERNAL "OpenCV library")
set(DUNE_USING_OPENCV 0 CACHE INTERNAL "OpenCV library")
endif(HAVE_LIB_OPENCV)
endif(OPENCV)