1 #########################################################################
2 # Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # Sets the following variables:
23 # OpenCV_FOUND - found flag
24 # OpenCV_INCLUDE_DIRS - path to the OpenCV include directories
25 # OpenCV_LIBS - path to the OpenCV libraries to be linked against
28 IF(NOT OpenCV_FIND_QUIETLY)
29 MESSAGE(STATUS "Check for OpenCV ...")
32 FIND_PATH(OpenCV_INCLUDE_DIRS opencv2/opencv.hpp)
34 SET(OpenCV_LIB_COMPONENTS videostab;video;ts;superres;stitching;photo;ocl;objdetect;ml;legacy;imgproc;highgui;gpu;flann;features2d;core;objdetect;imgcodecs;shape)
36 FOREACH(_compo ${OpenCV_LIB_COMPONENTS})
37 FIND_LIBRARY(OpenCV_${_compo} opencv_${_compo})
39 LIST(APPEND OpenCV_LIBRARIES ${OpenCV_${_compo}})
42 IF(OpenCV_LIBRARIES AND OpenCV_INCLUDE_DIRS)
44 SET(OpenCV_LIBS ${OpenCV_LIBRARIES})
48 IF(NOT OpenCV_FIND_QUIETLY)
49 MESSAGE("OpenCV found !")
52 IF(NOT OpenCV_FIND_QUIETLY)
53 MESSAGE("Could not find OpenCV ...")