Warning, /graphics/digikam/core/cmake/macros/MacroOpenCV.cmake is written in an unsupported language. File is not indexed.
0001 # A macro wrapper to find OpenCV library 0002 # 0003 # Syntax: DETECT_OPENCV(OPENCV_MIN_VERSION OPENCV_REQUIRED_COMPONENTS) 0004 # 0005 # Example: DETECT_OPENCV(3.3.0 core highgui objdetect contrib) 0006 # which try to find OpenCV version 3.3.0 0007 # with internal components "core", "highgui", "objdetect", and "contrib". 0008 # 0009 # Once done this will be adjusted: 0010 # 0011 # OpenCV_FOUND - OpenCV detection flag 0012 # OpenCV_INCLUDE_DIRS - OpenCV include directories 0013 # OpenCV_LIBS - OpenCV libraries 0014 # 0015 # SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier, <caulier dot gilles at gmail dot com> 0016 # 0017 # SPDX-License-Identifier: BSD-3-Clause 0018 # 0019 0020 macro(DETECT_OPENCV OPENCV_MIN_VERSION) 0021 0022 # Reset to avoid picking up extra libraries 0023 set(OpenCV_LIBS) 0024 0025 set(OPENCV_REQUIRED_COMPONENTS "${ARGN}") 0026 0027 find_package(OpenCV COMPONENTS ${OPENCV_REQUIRED_COMPONENTS} PATHS /usr/local) 0028 0029 if(OpenCV_FOUND) 0030 0031 message(STATUS "OpenCV Root directory is: ${OpenCV_DIR}") 0032 0033 # check OpenCV version 0034 0035 if(OpenCV_VERSION) 0036 0037 message(STATUS "OpenCV: Found version ${OpenCV_VERSION} (required: ${OPENCV_MIN_VERSION})") 0038 0039 if(${OpenCV_VERSION} VERSION_LESS ${OPENCV_MIN_VERSION}) 0040 0041 message(WARNING "OpenCV: Version is too old.") 0042 set(OpenCV_FOUND FALSE) 0043 0044 endif() 0045 0046 else() 0047 0048 message(WARNING "OpenCV: Version information not found, your version is probably too old.") 0049 set(OpenCV_FOUND FALSE) 0050 0051 endif() 0052 0053 message(STATUS "OpenCV headers: ${OpenCV_INCLUDE_DIRS}") 0054 message(STATUS "OpenCV libs : ${OpenCV_LIBS}") 0055 0056 endif() 0057 0058 endmacro()