Browse Source

Add support for system pkgs: OpenCV

feature/build-system-rewrite
Damien Nguyen 4 years ago
parent
commit
ba139e8d35
No known key found for this signature in database GPG Key ID: 1E9F14CEB9969EF8
10 changed files with 3124 additions and 41 deletions
  1. +30
    -40
      cmake/external_libs/opencv.cmake
  2. +3
    -1
      cmake/mind_expression.cmake
  3. +271
    -0
      cmake/modules/FindOpenCV.cmake
  4. +599
    -0
      cmake/modules/opencv/4.0.cmake
  5. +414
    -0
      cmake/modules/opencv/4.1.cmake
  6. +414
    -0
      cmake/modules/opencv/4.2.cmake
  7. +414
    -0
      cmake/modules/opencv/4.3.cmake
  8. +414
    -0
      cmake/modules/opencv/4.4.cmake
  9. +457
    -0
      cmake/modules/opencv/4.5.cmake
  10. +108
    -0
      cmake/modules/opencv/5.0.cmake

+ 30
- 40
cmake/external_libs/opencv.cmake View File

@@ -29,63 +29,53 @@ else()
set(MD5 "d3141f649ab2d76595fdd8991ee15c55")
endif()

set(
CMAKE_OPTION
-DCMAKE_BUILD_TYPE=Release
-DWITH_PROTOBUF=OFF
-DWITH_WEBP=OFF
-DWITH_IPP=OFF
-DWITH_ADE=OFF
-DBUILD_ZLIB=ON
-DBUILD_JPEG=ON
-DBUILD_PNG=ON
-DBUILD_OPENEXR=OFF
-DBUILD_TESTS=OFF
-DBUILD_PERF_TESTS=OFF
-DBUILD_opencv_apps=OFF
-DCMAKE_SKIP_RPATH=TRUE
-DBUILD_opencv_python3=OFF
-DWITH_FFMPEG=OFF
-DWITH_TIFF=ON
-DBUILD_TIFF=OFF
-DWITH_JASPER=OFF
-DBUILD_JASPER=OFF
-DCV_TRACE=OFF # cause memory usage increacing
-DTIFF_INCLUDE_DIR=${tiff_INC}
-DTIFF_LIBRARY=${tiff_LIB}
)
set(CMAKE_OPTION
-DCMAKE_BUILD_TYPE=Release
-DWITH_PROTOBUF=OFF
-DWITH_WEBP=OFF
-DWITH_IPP=OFF
-DWITH_ADE=OFF
-DBUILD_ZLIB=ON
-DBUILD_JPEG=ON
-DBUILD_PNG=ON
-DBUILD_OPENEXR=OFF
-DBUILD_TESTS=OFF
-DBUILD_PERF_TESTS=OFF
-DBUILD_opencv_apps=OFF
-DCMAKE_SKIP_RPATH=TRUE
-DBUILD_opencv_python3=OFF
-DWITH_FFMPEG=OFF
-DWITH_TIFF=ON
-DBUILD_TIFF=OFF
-DWITH_JASPER=OFF
-DBUILD_JASPER=OFF
-DCV_TRACE=OFF # cause memory usage increacing
-DTIFF_INCLUDE_DIR=${tiff_INC}
-DTIFF_LIBRARY=${tiff_LIB})

if(MSVC)
set(LIBS opencv_core452.lib opencv_imgcodecs452.lib opencv_imgproc452.lib)
set(LIB_PATH LIB_PATH x64/*/lib)
list(APPEND CMAKE OPTION -DBUILD_opencv_videoio=OFF)
set(TARGET_ALIAS TARGET_ALIAS mindspore::opencv_core opencv::opencv_core452.lib)
list(APPEND TARGET_ALIAS TARGET_ALIAS mindspore::opencv_imgcodecs opencv::opencv_imgcodecs452.lib)
list(APPEND TARGET_ALIAS TARGET_ALIAS mindspore::opencv_imgproc opencv::opencv_imgproc452.lib)
elseif(WIN32)
set(LIBS libopencv_core452.dll.a libopencv_imgcodecs452.dll.a libopencv_imgproc452.dll.a)
set(LIB_PATH LIB_PATH x64/mingw/lib)
list(APPEND CMAKE_OPTION -DBUILD_opencv_videoio=OFF -DWITH_LAPACK=OFF)
set(TARGET_ALIAS TARGET_ALIAS mindspore::opencv_core opencv::libopencv_core452.dll.a)
list(APPEND TARGET_ALIAS TARGET_ALIAS mindspore::opencv_imgcodecs opencv::libopencv_imgcodecs452.dll.a)
list(APPEND TARGET_ALIAS TARGET_ALIAS mindspore::opencv_imgproc opencv::libopencv_imgproc452.dll.a)
else()
set(LIBS opencv_core opencv_imgcodecs opencv_imgproc)

list(APPEND CMAKE_OPTION -DWITH_LAPACK=OFF)
set(TARGET_ALIAS TARGET_ALIAS mindspore::opencv_core opencv::opencv_core)
list(APPEND TARGET_ALIAS TARGET_ALIAS mindspore::opencv_imgcodecs opencv::opencv_imgcodecs)
list(APPEND TARGET_ALIAS TARGET_ALIAS mindspore::opencv_imgproc opencv::opencv_imgproc)
endif()

mindspore_add_pkg(
opencv
OpenCV
VER 4.5.2
LIBS ${LIBS} ${LIB_PATH}
LIBS opencv_core opencv_imgcodecs opencv_imgproc
LIBS_CMAKE_NAMES core imgcodecs imgproc ${LIB_PATH}
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION ${CMAKE_OPTION} ${TARGET_ALIAS}
)
CMAKE_OPTION ${CMAKE_OPTION}
TARGET_ALIAS mindspore::opencv_core opencv_core
TARGET_ALIAS mindspore::opencv_imgcodecs opencv_imgcodecs
TARGET_ALIAS mindspore::opencv_imgproc opencv_imgproc)

if(MSVC)
include_directories(${opencv_INC})


+ 3
- 1
cmake/mind_expression.cmake View File

@@ -66,7 +66,9 @@ endif()

if(ENABLE_MINDDATA)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/icu4c.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/libtiff.cmake)
if(NOT MS_OPENCV_PREFER_SYSTEM)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/libtiff.cmake)
endif()
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/opencv.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/sqlite.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/tinyxml2.cmake)


+ 271
- 0
cmake/modules/FindOpenCV.cmake View File

@@ -0,0 +1,271 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

#[=======================================================================[.rst:
FindOpenCV
---------

Find OpenCV include dirs and libraries

Use this module by invoking :command:`find_package` with the form:

.. code-block:: cmake

find_package(OpenCV
[version] [EXACT] # Minimum or EXACT version e.g. 2020.03
[REQUIRED] # Fail with error if OpenCV is not found
[COMPONENTS <libs>...] # OpenCV libraries by their canonical name
)

This module finds headers and requested component libraries OR a CMake package configuration file provided by a "OpenCV
CMake" build. For the latter case skip to the :ref:`OpenCV CMake` section below.

Result Variables
^^^^^^^^^^^^^^^^

This module defines the following variables:

``OpenCV_FOUND``
True if headers and requested libraries were found.

``OpenCV_INCLUDE_DIRS``
OpenCV include directories.

``OpenCV_LIBRARY_DIRS``
Link directories for OpenCV libraries.

``OpenCV_LIBRARIES``
OpenCV component libraries to be linked.

``OpenCV_<COMPONENT>_FOUND``
True if component ``<COMPONENT>`` was found (``<COMPONENT>`` name is upper-case).

``OpenCV_<COMPONENT>_LIBRARY``
Libraries to link for component ``<COMPONENT>`` (may include :command:`target_link_libraries` debug/optimized
keywords).

``OpenCV_VERSION``
OpenCV version number in ``X.Y`` format.

``OpenCV_VERSION_MAJOR``
OpenCV major version number (``X`` in ``X.Y``).

``OpenCV_VERSION_MINOR``
OpenCV minor version number (``Y`` in ``X.Y``).

Cache variables
^^^^^^^^^^^^^^^

Search results are saved persistently in CMake cache entries:

``OpenCV_INCLUDE_DIR``
Directory containing OpenCV headers.

``OpenCV_LIBRARY_DIR_RELEASE``
Directory containing release OpenCV libraries.

``OpenCV_LIBRARY_DIR_DEBUG``
Directory containing debug OpenCV libraries.

``OpenCV_<COMPONENT>_LIBRARY_DEBUG``
Component ``<COMPONENT>`` library debug variant.

``OpenCV_<COMPONENT>_LIBRARY_RELEASE``
Component ``<COMPONENT>`` library release variant.

Hints
^^^^^

This module reads hints about search locations from variables:

``OpenCV_ROOT``, ``OpenCVROOT``
Preferred installation prefix.

``OpenCV_INCLUDEDIR``
Preferred include directory e.g. ``<prefix>/include``.

``OpenCV_LIBRARYDIR``
Preferred library directory e.g. ``<prefix>/lib``.

``OpenCV_NO_SYSTEM_PATHS``
Set to ``ON`` to disable searching in locations not specified by these hint variables. Default is ``OFF``.

Users may set these hints or results as ``CACHE`` entries. Projects should not read these entries directly but
instead use the above result variables. Note that some hint names start in upper-case ``OpenCV``. One may specify these
as environment variables if they are not specified as CMake variables or cache entries.

This module first searches for the OpenCV header files using the above hint variables (excluding ``OpenCV_LIBRARYDIR``) and
saves the result in ``OpenCV_INCLUDE_DIR``. Then it searches for requested component libraries using the above hints
(excluding ``OpenCV_INCLUDEDIR``), "lib" directories near ``OpenCV_INCLUDE_DIR``, and the library name configuration
settings below. It saves the library directories in ``OpenCV_LIBRARY_DIR_DEBUG`` and ``OpenCV_LIBRARY_DIR_RELEASE`` and
individual library locations in ``OpenCV_<COMPONENT>_LIBRARY_DEBUG`` and ``OpenCV_<COMPONENT>_LIBRARY_RELEASE``. When one
changes settings used by previous searches in the same build tree (excluding environment variables) this module
discards previous search results affected by the changes and searches again.

Imported Targets
^^^^^^^^^^^^^^^^

This module defines the following :prop_tgt:`IMPORTED` targets:

``OpenCV::<component>``
Target for specific component dependency (shared or static library); ``<component>`` name is lower-case.

It is important to note that the imported targets behave differently than variables created by this module: multiple
calls to :command:`find_package(OpenCV)` in the same directory or sub-directories with different options (e.g. static or
shared) will not override the values of the targets created by the first call.

Other Variables
^^^^^^^^^^^^^^^

OpenCV libraries come in many variants encoded in their file name. Users or projects may tell this module which variant
to find by setting variables:

``OpenCV_FIND_RELEASE_ONLY``
Set to ``ON`` or ``OFF`` to specify whether to restrict the search to release libraries only. Default is ``OFF``.

``OpenCV_USE_DEBUG_LIBS``
Set to ``ON`` or ``OFF`` to specify whether to search and use the debug libraries. Default is ``ON`` (except when
OpenCV_FIND_RELEASE_ONLY is ``ON``).

``OpenCV_USE_RELEASE_LIBS``
Set to ``ON`` or ``OFF`` to specify whether to search and use the release libraries. Default is ``ON``.

Other variables one may set to control this module are:

``OpenCV_DEBUG``
Set to ``ON`` to enable debug output from ``FindOpenCV``. Please enable this before filing any bug report.

``OpenCV_LIBRARY_DIR``
Default value for ``OpenCV_LIBRARY_DIR_RELEASE`` and ``OpenCV_LIBRARY_DIR_DEBUG``.


Examples
^^^^^^^^

Find OpenCV headers only:

.. code-block:: cmake

find_package(OpenCV 2.0.0)
if(OpenCV_FOUND)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo PUBLIC OpenCV::OpenCV)
endif()

Find OpenCV libraries and use imported targets:

.. code-block:: cmake

find_package(OpenCV 2.0.0 REQUIRED COMPONENTS OpenCV)
add_executable(foo foo.cc)
target_link_libraries(foo PUBLIC OpenCV::OpenCV)

Find OpenCV headers and some *static* (release only) libraries:

.. code-block:: cmake

set(OpenCV_USE_DEBUG_LIBS OFF) # ignore debug libs and
set(OpenCV_USE_RELEASE_LIBS ON) # only find release libs
find_package(OpenCV 2.0.0 COMPONENTS OpenCV)
if(OpenCV_FOUND)
add_executable(foo foo.cc)
target_link_libraries(foo PUBLIC OpenCV::OpenCV)
endif()

.. _`OpenCV CMake`:

OpenCV CMake
^^^^^^^^^^^

If OpenCV was built using CMake, it provides a package configuration file for use with find_package's config mode.
This module looks for the package configuration file called ``OpenCVConfig.cmake`` and stores the result in ``CACHE``
entry ``OpenCV_DIR``. If found, the package configuration file is loaded and this module returns with no further action.
See documentation of the OpenCV CMake package configuration for details on what it provides.

Set ``OpenCV_NO_CMAKE`` to ``ON``, to disable the search for the package using the CONFIG method.

.. _`OpenCV pkg-config`:

OpenCV CMake
^^^^^^^^^^^

If OpenCV was installed with its pkg-config files, this module may attempt to look for OpenCV by relying on pkg-config.
If the components are found using this method, this module returns with no further action.

Set ``OpenCV_NO_PKGCONFIG`` to ``ON``, to disable the search for the package using the pkg-config method.

#]=======================================================================]

# cmake-lint: disable=C0103

include(_find_utils_begin)

set(_pkg OpenCV)
set(${_pkg}_INCLUDE_FILE version.h)
set(${_pkg}_INCLUDE_PATH_SUFFIXES include/opencv2/core opencv2/core)
set(${_pkg}_DEFINE_PREFIX CV)
set(${_pkg}_INCLUDE_DIR_UP_INDEX 2)
set(${_pkg}_DEFAULT_COMPONENTS core)

if(WIN32)
# Extensions:
#
# * .ddl.a: shared libraries, MinGW flavor
# * .lib: shared libraries, MSVC flavor (static are *-static.a)
if(MSVC)
set(${_pkg}_FIND_LIBRARY_SUFFIXES .lib .a)
else()
set(${_pkg}_FIND_LIBRARY_SUFFIXES .dll .ddl.a .lib .a)
endif()
endif()

if(NOT OpenCV_FIND_VERSION_MAJOR)
set(OpenCV_FIND_VERSION_MAJOR 4)
endif()
if(NOT OpenCV_FIND_VERSION_MINOR)
set(OpenCV_FIND_VERSION_MINOR 5)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/opencv/${OpenCV_FIND_VERSION_MAJOR}.${OpenCV_FIND_VERSION_MINOR}.cmake)

# Update OPENCV library search directories with pre-built paths
function(OpenCV_update_library_search_dirs_with_prebuilt_paths componentlibvar basedir)
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
list(APPEND ${componentlibvar} ${basedir}/lib)
elseif(UNIX)
list(APPEND ${componentlibvar} ${basedir}/lib64)
list(APPEND ${componentlibvar} ${basedir}/lib)
list(APPEND ${componentlibvar} ${basedir}/lib/x86_64-linux-gnu)
endif()

set(${componentlibvar}
${${componentlibvar}}
PARENT_SCOPE)
endfunction()

function(OpenCV_post_process pkg)
foreach(_comp ${OpenCV_FIND_COMPONENTS})
if(NOT TARGET ${pkg}::${_comp} AND TARGET opencv_${_comp})
add_library(${pkg}::${_comp} ALIAS opencv_${_comp})
endif()
endforeach()
endfunction()

include(_find_utils_end)

# ==============================================================================

+ 599
- 0
cmake/modules/opencv/4.0.cmake View File

@@ -0,0 +1,599 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

if(NOT "${CMAKE_CUDA_COMPILER}" STREQUAL "")
set(_with_cuda TRUE)
else()
set(_with_cuda FALSE)
endif()

set(_comps
alphamat
aruco
barcode
bgsegm
bioinspired
calib3d
ccalib
core
correspondence
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
line_descriptor
mcc
ml
multiview
numeric
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
simple_pipeline
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto)

# Set names of each component of OpenCV 4.0
foreach(comp ${_comps})
set(${_pkg}_${comp}_NAMES opencv_${comp} opencv_${comp}401 opencv_${comp}400)
endforeach()

set(${_pkg}_alphamat_DEPENDENCIES core cudev imgproc)
set(${_pkg}_aruco_DEPENDENCIES
calib3d
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_barcode_DEPENDENCIES core cudev dnn imgproc)
set(${_pkg}_bgsegm_DEPENDENCIES
calib3d
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
video
videoio)
set(${_pkg}_bioinspired_DEPENDENCIES core cudev highgui imgcodecs imgproc videoio)
set(${_pkg}_calib3d_DEPENDENCIES
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_ccalib_DEPENDENCIES
calib3d
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_core_DEPENDENCIES cudev)
set(${_pkg}_cudaarithm_DEPENDENCIES core cudev)
set(${_pkg}_cudabgsegm_DEPENDENCIES
calib3d
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
video
videoio)
set(${_pkg}_cudacodec_DEPENDENCIES core cudev imgcodecs imgproc videoio)
set(${_pkg}_cudafeatures2d_DEPENDENCIES
core
cudaarithm
cudafilters
cudawarping
cudev
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_cudafilters_DEPENDENCIES core cudaarithm cudev imgproc)
set(${_pkg}_cudaimgproc_DEPENDENCIES core cudaarithm cudafilters cudev imgproc)
set(${_pkg}_cudalegacy_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudev
features2d
flann
highgui
imgcodecs
imgproc
objdetect
video
videoio)
set(${_pkg}_cudaobjdetect_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
cudev
features2d
flann
highgui
imgcodecs
imgproc
objdetect
video
videoio)
set(${_pkg}_cudaoptflow_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
cudev
features2d
flann
highgui
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
set(${_pkg}_cudastereo_DEPENDENCIES
calib3d
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_cudawarping_DEPENDENCIES core cudev imgproc)
set(${_pkg}_cvv_DEPENDENCIES
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_datasets_DEPENDENCIES
core
cudev
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
text
videoio)
set(${_pkg}_dnn_DEPENDENCIES core cudev imgproc)
set(${_pkg}_dnn_objdetect_DEPENDENCIES
core
cudev
dnn
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_dnn_superres_DEPENDENCIES core cudev dnn imgproc ml quality)
set(${_pkg}_dpm_DEPENDENCIES
calib3d
core
cudev
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_face_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
photo
videoio)
if(_with_cuda)
list(APPEND ${_pkg}_face_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_features2d_DEPENDENCIES core flann highgui imgcodecs imgproc videoio)
set(${_pkg}_flann_DEPENDENCIES core)
set(${_pkg}_freetype_DEPENDENCIES core imgproc)
set(${_pkg}_fuzzy_DEPENDENCIES core imgproc)
set(${_pkg}_gapi_DEPENDENCIES core imgproc)
set(${_pkg}_hdf_DEPENDENCIES core)
set(${_pkg}_hfs_DEPENDENCIES core imgproc)
set(${_pkg}_highgui_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_img_hash_DEPENDENCIES core imgproc)
set(${_pkg}_imgcodecs_DEPENDENCIES core imgproc)
set(${_pkg}_imgproc_DEPENDENCIES core)
set(${_pkg}_intensity_transform_DEPENDENCIES core imgproc)
set(${_pkg}_line_descriptor_DEPENDENCIES
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_mcc_DEPENDENCIES
calib3d
core
dnn
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_ml_DEPENDENCIES core)
set(${_pkg}_objdetect_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_optflow_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
video
videoio
ximgproc)
set(${_pkg}_ovis_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_phase_unwrapping_DEPENDENCIES core imgproc)
set(${_pkg}_photo_DEPENDENCIES core imgproc)
if(_with_cuda)
list(APPEND ${_pkg}_photo_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_plot_DEPENDENCIES core imgproc)
set(${_pkg}_quality_DEPENDENCIES core imgproc ml)
set(${_pkg}_rapid_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_reg_DEPENDENCIES core imgproc)
set(${_pkg}_rgbd_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio
viz)
set(${_pkg}_saliency_DEPENDENCIES
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_sfm_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
ml
shape
videoio
xfeatures2d)
if(_with_cuda)
list(APPEND ${_pkg}_sfm_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_shape_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_stereo_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
tracking
video
videoio)
set(${_pkg}_stitching_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
ml
objdetect
shape
video
videoio
xfeatures2d)
if(_with_cuda)
list(
APPEND
${_pkg}_stitching_DEPENDENCIES
cudaarithm
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudawarping)
endif()
set(${_pkg}_structured_light_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
phase_unwrapping
videoio
viz)
set(${_pkg}_superres_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_superres_DEPENDENCIES
cudaarithm
cudacodec
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_surface_matching_DEPENDENCIES core flann)
set(${_pkg}_text_DEPENDENCIES
core
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
videoio)
set(${_pkg}_tracking_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
video
videoio)
set(${_pkg}_video_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_videoio_DEPENDENCIES core imgcodecs imgproc)
set(${_pkg}_videostab_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
optflow
photo
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_videostab_DEPENDENCIES
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()

set(${_pkg}_viz_DEPENDENCIES core)
set(${_pkg}_wechat_qrcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_xfeatures2d_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
ml
shape
videoio)
if(_with_cuda)
list(APPEND ${_pkg}_xfeatures2d_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_ximgproc_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
video
videoio)
set(${_pkg}_xobjdetect_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_xphoto_DEPENDENCIES core imgproc photo)
if(_with_cuda)
list(APPEND ${_pkg}_xphoto_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()

if(_with_cuda)
foreach(comp ${_comps})
list(PREPEND ${_pkg}_${comp}_NAMES cudev)
endforeach()
endif()

+ 414
- 0
cmake/modules/opencv/4.1.cmake View File

@@ -0,0 +1,414 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

if(NOT "${CMAKE_CUDA_COMPILER}" STREQUAL "")
set(_with_cuda TRUE)
else()
set(_with_cuda FALSE)
endif()

set(_comps
alphamat
aruco
barcode
bgsegm
bioinspired
calib3d
ccalib
core
correspondence
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
line_descriptor
mcc
ml
multiview
numeric
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
simple_pipeline
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto)

# Set names of each component of OpenCV 4.1
foreach(comp ${_comps})
set(${_pkg}_${comp}_NAMES opencv_${comp} opencv_${comp}412 opencv_${comp}411 opencv_${comp}410)
endforeach()

set(${_pkg}_alphamat_DEPENDENCIES core imgproc)
set(${_pkg}_aruco_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_barcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_bgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_bioinspired_DEPENDENCIES core highgui imgcodecs imgproc videoio)
set(${_pkg}_calib3d_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_ccalib_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_core_DEPENDENCIES)
set(${_pkg}_cudaarithm_DEPENDENCIES core)
set(${_pkg}_cudabgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_cudacodec_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_cudafeatures2d_DEPENDENCIES
core
cudaarithm
cudafilters
cudawarping
features2d
flann
imgproc)
set(${_pkg}_cudafilters_DEPENDENCIES core cudaarithm imgproc)
set(${_pkg}_cudaimgproc_DEPENDENCIES core cudaarithm cudafilters imgproc)
set(${_pkg}_cudalegacy_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaobjdetect_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaoptflow_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
ximgproc)
set(${_pkg}_cudastereo_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_cudawarping_DEPENDENCIES core imgproc)
set(${_pkg}_cvv_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_datasets_DEPENDENCIES
core
dnn
features2d
flann
imgcodecs
imgproc
ml
text)
set(${_pkg}_dnn_DEPENDENCIES core imgproc)
set(${_pkg}_dnn_objdetect_DEPENDENCIES core dnn highgui imgcodecs imgproc videoio)
set(${_pkg}_dnn_superres_DEPENDENCIES core dnn imgproc ml quality)
set(${_pkg}_dpm_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_face_DEPENDENCIES
core
flann
imgproc
features2d
photo
calib3d
objdetect)
if(_with_cuda)
list(APPEND ${_pkg}_face_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_features2d_DEPENDENCIES core flann imgproc)
set(${_pkg}_flann_DEPENDENCIES core)
set(${_pkg}_freetype_DEPENDENCIES core imgproc)
set(${_pkg}_fuzzy_DEPENDENCIES core imgproc)
set(${_pkg}_gapi_DEPENDENCIES core imgproc)
set(${_pkg}_hdf_DEPENDENCIES core)
set(${_pkg}_hfs_DEPENDENCIES core imgproc)
set(${_pkg}_highgui_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_img_hash_DEPENDENCIES core imgproc)
set(${_pkg}_imgcodecs_DEPENDENCIES core imgproc)
set(${_pkg}_imgproc_DEPENDENCIES core)
set(${_pkg}_intensity_transform_DEPENDENCIES core imgproc)
set(${_pkg}_line_descriptor_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_mcc_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_ml_DEPENDENCIES core)
set(${_pkg}_objdetect_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_optflow_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video
ximgproc)
set(${_pkg}_ovis_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_phase_unwrapping_DEPENDENCIES core imgproc)
set(${_pkg}_photo_DEPENDENCIES core imgproc)
if(_with_cuda)
list(APPEND ${_pkg}_photo_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_plot_DEPENDENCIES core imgproc)
set(${_pkg}_quality_DEPENDENCIES core imgproc ml)
set(${_pkg}_rapid_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_reg_DEPENDENCIES core imgproc)
set(${_pkg}_rgbd_DEPENDENCIES calib3d core features2d flann imgproc viz)
set(${_pkg}_saliency_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_sfm_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
ml
shape
xfeatures2d)
if(_with_cuda)
list(APPEND ${_pkg}_sfm_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_shape_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_stereo_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
tracking
video
videoio)
set(${_pkg}_stitching_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
objdetect
shape
video
xfeatures2d)
if(_with_cuda)
list(
APPEND
${_pkg}_stitching_DEPENDENCIES
cudaarithm
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudawarping)
endif()
set(${_pkg}_structured_light_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
phase_unwrapping
viz)
set(${_pkg}_superres_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_superres_DEPENDENCIES
cudaarithm
cudacodec
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_surface_matching_DEPENDENCIES core flann)
set(${_pkg}_text_DEPENDENCIES core dnn features2d flann imgproc ml)
set(${_pkg}_tracking_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
video
videoio)
set(${_pkg}_video_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_videoio_DEPENDENCIES core imgcodecs imgproc)
set(${_pkg}_videostab_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
photo
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_videostab_DEPENDENCIES
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_viz_DEPENDENCIES core)
set(${_pkg}_wechat_qrcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_xfeatures2d_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
shape)
if(_with_cuda)
list(APPEND ${_pkg}_xfeatures2d_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_ximgproc_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video)
set(${_pkg}_xobjdetect_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect)
set(${_pkg}_xphoto_DEPENDENCIES core imgproc photo)
if(_with_cuda)
list(APPEND ${_pkg}_xphoto_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()

if(_with_cuda)
foreach(comp ${_comps})
list(PREPEND ${_pkg}_${comp}_NAMES cudev)
endforeach()
endif()

+ 414
- 0
cmake/modules/opencv/4.2.cmake View File

@@ -0,0 +1,414 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

if(NOT "${CMAKE_CUDA_COMPILER}" STREQUAL "")
set(_with_cuda TRUE)
else()
set(_with_cuda FALSE)
endif()

set(_comps
alphamat
aruco
barcode
bgsegm
bioinspired
calib3d
ccalib
core
correspondence
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
line_descriptor
mcc
ml
multiview
numeric
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
simple_pipeline
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto)

# Set names of each component of OpenCV 4.2
foreach(comp ${_comps})
set(${_pkg}_${comp}_NAMES opencv_${comp} opencv_${comp}420)
endforeach()

set(${_pkg}_alphamat_DEPENDENCIES core imgproc)
set(${_pkg}_aruco_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_barcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_bgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_bioinspired_DEPENDENCIES core highgui imgcodecs imgproc videoio)
set(${_pkg}_calib3d_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_ccalib_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_core_DEPENDENCIES)
set(${_pkg}_cudaarithm_DEPENDENCIES core)
set(${_pkg}_cudabgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_cudacodec_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_cudafeatures2d_DEPENDENCIES
core
cudaarithm
cudafilters
cudawarping
features2d
flann
imgproc)
set(${_pkg}_cudafilters_DEPENDENCIES core cudaarithm imgproc)
set(${_pkg}_cudaimgproc_DEPENDENCIES core cudaarithm cudafilters imgproc)
set(${_pkg}_cudalegacy_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaobjdetect_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaoptflow_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
ximgproc)
set(${_pkg}_cudastereo_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_cudawarping_DEPENDENCIES core imgproc)
set(${_pkg}_cvv_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_datasets_DEPENDENCIES
core
dnn
features2d
flann
imgcodecs
imgproc
ml
text)
set(${_pkg}_dnn_DEPENDENCIES core imgproc)
set(${_pkg}_dnn_objdetect_DEPENDENCIES core dnn highgui imgcodecs imgproc videoio)
set(${_pkg}_dnn_superres_DEPENDENCIES core dnn imgproc ml quality)
set(${_pkg}_dpm_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_face_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
objdetect
photo)
if(_with_cuda)
list(APPEND ${_pkg}_face_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_features2d_DEPENDENCIES core flann imgproc)
set(${_pkg}_flann_DEPENDENCIES core)
set(${_pkg}_freetype_DEPENDENCIES core imgproc)
set(${_pkg}_fuzzy_DEPENDENCIES core imgproc)
set(${_pkg}_gapi_DEPENDENCIES core imgproc)
set(${_pkg}_hdf_DEPENDENCIES core)
set(${_pkg}_hfs_DEPENDENCIES core imgproc)
set(${_pkg}_highgui_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_img_hash_DEPENDENCIES core imgproc)
set(${_pkg}_imgcodecs_DEPENDENCIES core imgproc)
set(${_pkg}_imgproc_DEPENDENCIES core)
set(${_pkg}_intensity_transform_DEPENDENCIES core imgproc)
set(${_pkg}_line_descriptor_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_mcc_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_ml_DEPENDENCIES core)
set(${_pkg}_objdetect_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_optflow_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video
ximgproc)
set(${_pkg}_ovis_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_phase_unwrapping_DEPENDENCIES core imgproc)
set(${_pkg}_photo_DEPENDENCIES core imgproc)
if(_with_cuda)
list(APPEND ${_pkg}_photo_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_plot_DEPENDENCIES core imgproc)
set(${_pkg}_quality_DEPENDENCIES core imgproc ml)
set(${_pkg}_rapid_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_reg_DEPENDENCIES core imgproc)
set(${_pkg}_rgbd_DEPENDENCIES calib3d core features2d flann imgproc viz)
set(${_pkg}_saliency_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_sfm_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
ml
shape
xfeatures2d)
if(_with_cuda)
list(APPEND ${_pkg}_sfm_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_shape_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_stereo_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
tracking
video
videoio)
set(${_pkg}_stitching_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
objdetect
shape
video
xfeatures2d)
if(_with_cuda)
list(
APPEND
${_pkg}_stitching_DEPENDENCIES
cudaarithm
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudawarping)
endif()
set(${_pkg}_structured_light_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
phase_unwrapping
viz)
set(${_pkg}_superres_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_superres_DEPENDENCIES
cudaarithm
cudacodec
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_surface_matching_DEPENDENCIES core flann)
set(${_pkg}_text_DEPENDENCIES core dnn features2d flann imgproc ml)
set(${_pkg}_tracking_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
video
videoio)
set(${_pkg}_video_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_videoio_DEPENDENCIES core imgcodecs imgproc)
set(${_pkg}_videostab_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
photo
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_videostab_DEPENDENCIES
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_viz_DEPENDENCIES core)
set(${_pkg}_wechat_qrcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_xfeatures2d_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
shape)
if(_with_cuda)
list(APPEND ${_pkg}_xfeatures2d_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_ximgproc_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video)
set(${_pkg}_xobjdetect_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect)
set(${_pkg}_xphoto_DEPENDENCIES core imgproc photo)
if(_with_cuda)
list(APPEND ${_pkg}_xphoto_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()

if(_with_cuda)
foreach(comp ${_comps})
list(PREPEND ${_pkg}_${comp}_NAMES cudev)
endforeach()
endif()

+ 414
- 0
cmake/modules/opencv/4.3.cmake View File

@@ -0,0 +1,414 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

if(NOT "${CMAKE_CUDA_COMPILER}" STREQUAL "")
set(_with_cuda TRUE)
else()
set(_with_cuda FALSE)
endif()

set(_comps
alphamat
aruco
barcode
bgsegm
bioinspired
calib3d
ccalib
core
correspondence
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
line_descriptor
mcc
ml
multiview
numeric
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
simple_pipeline
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto)

# Set names of each component of OpenCV 4.3
foreach(comp ${_comps})
set(${_pkg}_${comp}_NAMES opencv_${comp} opencv_${comp}430)
endforeach()

set(${_pkg}_alphamat_DEPENDENCIES core imgproc)
set(${_pkg}_aruco_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_barcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_bgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_bioinspired_DEPENDENCIES core highgui imgcodecs imgproc videoio)
set(${_pkg}_calib3d_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_ccalib_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_core_DEPENDENCIES)
set(${_pkg}_cudaarithm_DEPENDENCIES core)
set(${_pkg}_cudabgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_cudacodec_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_cudafeatures2d_DEPENDENCIES
core
cudaarithm
cudafilters
cudawarping
features2d
flann
imgproc)
set(${_pkg}_cudafilters_DEPENDENCIES core cudaarithm imgproc)
set(${_pkg}_cudaimgproc_DEPENDENCIES core cudaarithm cudafilters imgproc)
set(${_pkg}_cudalegacy_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaobjdetect_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaoptflow_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
ximgproc)
set(${_pkg}_cudastereo_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_cudawarping_DEPENDENCIES core imgproc)
set(${_pkg}_cvv_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_datasets_DEPENDENCIES
core
dnn
features2d
flann
imgcodecs
imgproc
ml
text)
set(${_pkg}_dnn_DEPENDENCIES core imgproc)
set(${_pkg}_dnn_objdetect_DEPENDENCIES core dnn highgui imgcodecs imgproc videoio)
set(${_pkg}_dnn_superres_DEPENDENCIES core dnn imgproc ml quality)
set(${_pkg}_dpm_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_face_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
objdetect
photo)
if(_with_cuda)
list(APPEND ${_pkg}_face_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_features2d_DEPENDENCIES core flann imgproc)
set(${_pkg}_flann_DEPENDENCIES core)
set(${_pkg}_freetype_DEPENDENCIES core imgproc)
set(${_pkg}_fuzzy_DEPENDENCIES core imgproc)
set(${_pkg}_gapi_DEPENDENCIES core imgproc)
set(${_pkg}_hdf_DEPENDENCIES core)
set(${_pkg}_hfs_DEPENDENCIES core imgproc)
set(${_pkg}_highgui_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_img_hash_DEPENDENCIES core imgproc)
set(${_pkg}_imgcodecs_DEPENDENCIES core imgproc)
set(${_pkg}_imgproc_DEPENDENCIES core)
set(${_pkg}_intensity_transform_DEPENDENCIES core imgproc)
set(${_pkg}_line_descriptor_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_mcc_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_ml_DEPENDENCIES core)
set(${_pkg}_objdetect_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_optflow_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video
ximgproc)
set(${_pkg}_ovis_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_phase_unwrapping_DEPENDENCIES core imgproc)
set(${_pkg}_photo_DEPENDENCIES core imgproc)
if(_with_cuda)
list(APPEND ${_pkg}_photo_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_plot_DEPENDENCIES core imgproc)
set(${_pkg}_quality_DEPENDENCIES core imgproc ml)
set(${_pkg}_rapid_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_reg_DEPENDENCIES core imgproc)
set(${_pkg}_rgbd_DEPENDENCIES calib3d core features2d flann imgproc viz)
set(${_pkg}_saliency_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_sfm_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
ml
shape
xfeatures2d)
if(_with_cuda)
list(APPEND ${_pkg}_sfm_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_shape_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_stereo_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
tracking
video
videoio)
set(${_pkg}_stitching_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
objdetect
shape
video
xfeatures2d)
if(_with_cuda)
list(
APPEND
${_pkg}_stitching_DEPENDENCIES
cudaarithm
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudawarping)
endif()
set(${_pkg}_structured_light_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
phase_unwrapping
viz)
set(${_pkg}_superres_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_superres_DEPENDENCIES
cudaarithm
cudacodec
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_surface_matching_DEPENDENCIES core flann)
set(${_pkg}_text_DEPENDENCIES core dnn features2d flann imgproc ml)
set(${_pkg}_tracking_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
video
videoio)
set(${_pkg}_video_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_videoio_DEPENDENCIES core imgcodecs imgproc)
set(${_pkg}_videostab_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
photo
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_videostab_DEPENDENCIES
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_viz_DEPENDENCIES core)
set(${_pkg}_wechat_qrcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_xfeatures2d_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
shape)
if(_with_cuda)
list(APPEND ${_pkg}_xfeatures2d_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_ximgproc_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video)
set(${_pkg}_xobjdetect_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect)
set(${_pkg}_xphoto_DEPENDENCIES core imgproc photo)
if(_with_cuda)
list(APPEND ${_pkg}_xphoto_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()

if(_with_cuda)
foreach(comp ${_comps})
list(PREPEND ${_pkg}_${comp}_NAMES cudev)
endforeach()
endif()

+ 414
- 0
cmake/modules/opencv/4.4.cmake View File

@@ -0,0 +1,414 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

if(NOT "${CMAKE_CUDA_COMPILER}" STREQUAL "")
set(_with_cuda TRUE)
else()
set(_with_cuda FALSE)
endif()

set(_comps
alphamat
aruco
barcode
bgsegm
bioinspired
calib3d
ccalib
core
correspondence
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
line_descriptor
mcc
ml
multiview
numeric
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
simple_pipeline
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto)

# Set names of each component of OpenCV 4.4
foreach(comp ${_comps})
set(${_pkg}_${comp}_NAMES opencv_${comp} opencv_${comp}440)
endforeach()

set(${_pkg}_alphamat_DEPENDENCIES core imgproc)
set(${_pkg}_aruco_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_barcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_bgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_bioinspired_DEPENDENCIES core highgui imgcodecs imgproc videoio)
set(${_pkg}_calib3d_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_ccalib_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_core_DEPENDENCIES)
set(${_pkg}_cudaarithm_DEPENDENCIES core)
set(${_pkg}_cudabgsegm_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_cudacodec_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_cudafeatures2d_DEPENDENCIES
core
cudaarithm
cudafilters
cudawarping
features2d
flann
imgproc)
set(${_pkg}_cudafilters_DEPENDENCIES core cudaarithm imgproc)
set(${_pkg}_cudaimgproc_DEPENDENCIES core cudaarithm cudafilters imgproc)
set(${_pkg}_cudalegacy_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaobjdetect_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaoptflow_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
ximgproc)
set(${_pkg}_cudastereo_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_cudawarping_DEPENDENCIES core imgproc)
set(${_pkg}_cvv_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_datasets_DEPENDENCIES
core
dnn
features2d
flann
imgcodecs
imgproc
ml
text)
set(${_pkg}_dnn_DEPENDENCIES core imgproc)
set(${_pkg}_dnn_objdetect_DEPENDENCIES core dnn highgui imgcodecs imgproc videoio)
set(${_pkg}_dnn_superres_DEPENDENCIES core dnn imgproc ml quality)
set(${_pkg}_dpm_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_face_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
objdetect
photo)
if(_with_cuda)
list(APPEND ${_pkg}_face_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_features2d_DEPENDENCIES core flann imgproc)
set(${_pkg}_flann_DEPENDENCIES core)
set(${_pkg}_freetype_DEPENDENCIES core imgproc)
set(${_pkg}_fuzzy_DEPENDENCIES core imgproc)
set(${_pkg}_gapi_DEPENDENCIES calib3d core features2d flann imgproc video)
set(${_pkg}_hdf_DEPENDENCIES core)
set(${_pkg}_hfs_DEPENDENCIES core imgproc)
set(${_pkg}_highgui_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_img_hash_DEPENDENCIES core imgproc)
set(${_pkg}_imgcodecs_DEPENDENCIES core imgproc)
set(${_pkg}_imgproc_DEPENDENCIES core)
set(${_pkg}_intensity_transform_DEPENDENCIES core imgproc)
set(${_pkg}_line_descriptor_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_mcc_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_ml_DEPENDENCIES core)
set(${_pkg}_objdetect_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_optflow_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video
ximgproc)
set(${_pkg}_ovis_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_phase_unwrapping_DEPENDENCIES core imgproc)
set(${_pkg}_photo_DEPENDENCIES core imgproc)
if(_with_cuda)
list(APPEND ${_pkg}_photo_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_plot_DEPENDENCIES core imgproc)
set(${_pkg}_quality_DEPENDENCIES core imgproc ml)
set(${_pkg}_rapid_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_reg_DEPENDENCIES core imgproc)
set(${_pkg}_rgbd_DEPENDENCIES calib3d core features2d flann imgproc viz)
set(${_pkg}_saliency_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_sfm_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
ml
shape
xfeatures2d)
if(_with_cuda)
list(APPEND ${_pkg}_sfm_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_shape_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_stereo_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
tracking
video
videoio)
set(${_pkg}_stitching_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
objdetect
shape
video
xfeatures2d)
if(_with_cuda)
list(
APPEND
${_pkg}_stitching_DEPENDENCIES
cudaarithm
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudawarping)
endif()
set(${_pkg}_structured_light_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
phase_unwrapping
viz)
set(${_pkg}_superres_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_superres_DEPENDENCIES
cudaarithm
cudacodec
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_surface_matching_DEPENDENCIES core flann)
set(${_pkg}_text_DEPENDENCIES core dnn features2d flann imgproc ml)
set(${_pkg}_tracking_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
video
videoio)
set(${_pkg}_video_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_videoio_DEPENDENCIES core imgcodecs imgproc)
set(${_pkg}_videostab_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect
optflow
photo
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_videostab_DEPENDENCIES
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_viz_DEPENDENCIES core)
set(${_pkg}_wechat_qrcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_xfeatures2d_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
shape)
if(_with_cuda)
list(APPEND ${_pkg}_xfeatures2d_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_ximgproc_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
video)
set(${_pkg}_xobjdetect_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
objdetect)
set(${_pkg}_xphoto_DEPENDENCIES core imgproc photo)
if(_with_cuda)
list(APPEND ${_pkg}_xphoto_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()

if(_with_cuda)
foreach(comp ${_comps})
list(PREPEND ${_pkg}_${comp}_NAMES cudev)
endforeach()
endif()

+ 457
- 0
cmake/modules/opencv/4.5.cmake View File

@@ -0,0 +1,457 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

if(NOT "${CMAKE_CUDA_COMPILER}" STREQUAL "")
set(_with_cuda TRUE)
else()
set(_with_cuda FALSE)
endif()

set(_comps
alphamat
aruco
barcode
bgsegm
bioinspired
calib3d
ccalib
core
correspondence
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
line_descriptor
mcc
ml
multiview
numeric
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
simple_pipeline
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto)

# Set names of each component of OpenCV 4.5
foreach(comp ${_comps})
set(${_pkg}_${comp}_NAMES
opencv_${comp}
opencv_${comp}459
opencv_${comp}458
opencv_${comp}457
opencv_${comp}456
opencv_${comp}455
opencv_${comp}454
opencv_${comp}453
opencv_${comp}452
opencv_${comp}451
opencv_${comp}450)
endforeach()

set(${_pkg}_alphamat_DEPENDENCIES core imgproc)
set(${_pkg}_aruco_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_barcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_bgsegm_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgproc
video)
set(${_pkg}_bioinspired_DEPENDENCIES core highgui imgcodecs imgproc videoio)
set(${_pkg}_calib3d_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_ccalib_DEPENDENCIES
calib3d
core
features2d
flann
highgui
imgcodecs
imgproc
videoio)
set(${_pkg}_core_DEPENDENCIES)
set(${_pkg}_cudaarithm_DEPENDENCIES core)
set(${_pkg}_cudabgsegm_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgproc
video)
set(${_pkg}_cudacodec_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_cudafeatures2d_DEPENDENCIES
core
cudaarithm
cudafilters
cudawarping
features2d
flann
imgproc)
set(${_pkg}_cudafilters_DEPENDENCIES core cudaarithm imgproc)
set(${_pkg}_cudaimgproc_DEPENDENCIES core cudaarithm cudafilters imgproc)
set(${_pkg}_cudalegacy_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
dnn
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaobjdetect_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
dnn
features2d
flann
imgproc
objdetect
video)
set(${_pkg}_cudaoptflow_DEPENDENCIES
calib3d
core
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudawarping
dnn
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
ximgproc)
set(${_pkg}_cudastereo_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_cudawarping_DEPENDENCIES core imgproc)
set(${_pkg}_cvv_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_datasets_DEPENDENCIES
core
dnn
features2d
flann
imgcodecs
imgproc
ml
text)
set(${_pkg}_dnn_DEPENDENCIES core imgproc)
set(${_pkg}_dnn_objdetect_DEPENDENCIES core dnn highgui imgcodecs imgproc videoio)
set(${_pkg}_dnn_superres_DEPENDENCIES core dnn imgproc ml quality)
set(${_pkg}_dpm_DEPENDENCIES
calib3d
core
dnn
features2d
flann
highgui
imgcodecs
imgproc
objdetect
videoio)
set(${_pkg}_face_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgproc
objdetect
photo)
if(_with_cuda)
list(APPEND ${_pkg}_face_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_features2d_DEPENDENCIES core flann imgproc)
set(${_pkg}_flann_DEPENDENCIES core)
set(${_pkg}_freetype_DEPENDENCIES core imgproc)
set(${_pkg}_fuzzy_DEPENDENCIES core imgproc)
set(${_pkg}_gapi_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgproc
video)
set(${_pkg}_hdf_DEPENDENCIES core)
set(${_pkg}_hfs_DEPENDENCIES core imgproc)
set(${_pkg}_highgui_DEPENDENCIES core imgcodecs imgproc videoio)
set(${_pkg}_img_hash_DEPENDENCIES core imgproc)
set(${_pkg}_imgcodecs_DEPENDENCIES core imgproc)
set(${_pkg}_imgproc_DEPENDENCIES core)
set(${_pkg}_intensity_transform_DEPENDENCIES core imgproc)
set(${_pkg}_line_descriptor_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_mcc_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_ml_DEPENDENCIES core)
set(${_pkg}_objdetect_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_optflow_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgcodecs
imgproc
video
ximgproc)
set(${_pkg}_ovis_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_phase_unwrapping_DEPENDENCIES core imgproc)
set(${_pkg}_photo_DEPENDENCIES core imgproc)
if(_with_cuda)
list(APPEND ${_pkg}_photo_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()
set(${_pkg}_plot_DEPENDENCIES core imgproc)
set(${_pkg}_quality_DEPENDENCIES core imgproc ml)
set(${_pkg}_rapid_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_reg_DEPENDENCIES core imgproc)
set(${_pkg}_rgbd_DEPENDENCIES calib3d core features2d flann imgproc viz)
set(${_pkg}_saliency_DEPENDENCIES core features2d flann imgproc)
set(${_pkg}_sfm_DEPENDENCIES
calib3d
core
features2d
flann
imgcodecs
imgproc
ml
shape
xfeatures2d)
if(_with_cuda)
list(APPEND ${_pkg}_sfm_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_shape_DEPENDENCIES calib3d core features2d flann imgproc)
set(${_pkg}_stereo_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
tracking
video
videoio)
set(${_pkg}_stitching_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgproc
ml
objdetect
shape
video
xfeatures2d)
if(_with_cuda)
list(
APPEND
${_pkg}_stitching_DEPENDENCIES
cudaarithm
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudawarping)
endif()
set(${_pkg}_structured_light_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
phase_unwrapping
viz)
set(${_pkg}_superres_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgcodecs
imgproc
objdetect
optflow
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_superres_DEPENDENCIES
cudaarithm
cudacodec
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_surface_matching_DEPENDENCIES core flann)
set(${_pkg}_text_DEPENDENCIES core dnn features2d flann imgproc ml)
set(${_pkg}_tracking_DEPENDENCIES
calib3d
core
datasets
dnn
features2d
flann
highgui
imgcodecs
imgproc
ml
plot
text
video
videoio)
set(${_pkg}_video_DEPENDENCIES calib3d core dnn features2d flann imgproc)
set(${_pkg}_videoio_DEPENDENCIES core imgcodecs imgproc)
set(${_pkg}_videostab_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgcodecs
imgproc
objdetect
optflow
photo
video
videoio
ximgproc)
if(_with_cuda)
list(
APPEND
${_pkg}_videostab_DEPENDENCIES
cudaarithm
cudafilters
cudaimgproc
cudalegacy
cudaoptflow
cudawarping)
endif()
set(${_pkg}_viz_DEPENDENCIES core)
set(${_pkg}_wechat_qrcode_DEPENDENCIES core dnn imgproc)
set(${_pkg}_xfeatures2d_DEPENDENCIES
calib3d
core
features2d
flann
imgproc
ml
shape)
if(_with_cuda)
list(APPEND ${_pkg}_xfeatures2d_DEPENDENCIES cudaarithm)
endif()
set(${_pkg}_ximgproc_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgcodecs
imgproc
video)
set(${_pkg}_xobjdetect_DEPENDENCIES
calib3d
core
dnn
features2d
flann
imgcodecs
imgproc
objdetect)
set(${_pkg}_xphoto_DEPENDENCIES core imgproc photo)
if(_with_cuda)
list(APPEND ${_pkg}_xphoto_DEPENDENCIES cudaarithm cudafilters cudaimgproc)
endif()

if(_with_cuda)
foreach(comp ${_comps})
list(PREPEND ${_pkg}_${comp}_NAMES cudev)
endforeach()
endif()

+ 108
- 0
cmake/modules/opencv/5.0.cmake View File

@@ -0,0 +1,108 @@
# ==============================================================================
#
# Copyright 2022 <Huawei Technologies Co., Ltd>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ==============================================================================

# Set names of each component of OpenCV 5.0-pre
foreach(
comp
3d
alphamat
aruco
barcode
bgsegm
bioinspired
calib
ccalib
core
cudaarithm
cudabgsegm
cudacodec
cudafeatures2d
cudafilters
cudaimgproc
cudalegacy
cudaobjdetect
cudaoptflow
cudastereo
cudawarping
cudev
cvv
datasets
dnn
dnn_objdetect
dnn_superres
dpm
face
features2d
flann
freetype
fuzzy
gapi
hdf
hfs
highgui
img_hash
imgcodecs
imgproc
intensity_transform
julia
line_descriptor
mcc
ml
objdetect
optflow
ovis
phase_unwrapping
photo
plot
quality
rapid
reg
rgbd
saliency
sfm
shape
stereo
stitching
structured_light
superres
surface_matching
text
tracking
video
videoio
videostab
viz
wechat_qrcode
xfeatures2d
ximgproc
xobjdetect
xphoto
xstereo)
set(${_pkg}_${comp}_NAMES
opencv_${comp}
opencv_${comp}509
opencv_${comp}508
opencv_${comp}507
opencv_${comp}506
opencv_${comp}505
opencv_${comp}504
opencv_${comp}503
opencv_${comp}502
opencv_${comp}501
opencv_${comp}500)
endforeach()

Loading…
Cancel
Save