[ffmpeg/opencv4] Update opencv4 feature dependency and remove ffmpeg feature 'postproc' from default feature (#19358)

* [ffmpeg/opencv4] Update opencv4 feature dependency and remove ffmpeg feature 'postproc' from default feature

* Update the baseline version

* [opencv3] Update the feature dependency

* Update the baseline

* [opencv2] Update the feature dependency

* Update the baseline version

* Fix uwp build failures

* Update the baseline version

* Fix opencv2 version

* update the baseline version

* update the baseline version

* Un-edit git-tree.

* Update cuda feature

* Update the baseline

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Phoebe 2021-08-13 23:46:11 +08:00 committed by GitHub
parent 7bdf2f8e85
commit eb9cb29166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 240 additions and 104 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4",
"port-version": 13,
"port-version": 14,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
@ -22,7 +22,6 @@
"avdevice",
"avfilter",
"avformat",
"postproc",
"swresample",
"swscale"
],

View File

@ -1,49 +0,0 @@
Source: opencv2
Version: 2.4.13.7
Port-Version: 5
Build-Depends: zlib
Description: computer vision library, version 2
Default-Features: eigen, jpeg, png, tiff
Feature: cuda
Build-Depends: cuda
Description: CUDA support for opencv
Feature: eigen
Build-Depends: eigen3
Description: Eigen support for opencv
Feature: ffmpeg
Build-Depends: ffmpeg
Description: ffmpeg support for opencv
Feature: jasper
Build-Depends: jasper
Description: JPEG 2000 support for opencv
Feature: jpeg
Build-Depends: libjpeg-turbo
Description: JPEG support for opencv
Feature: openexr
Build-Depends: openexr
Description: OpenEXR support for opencv
Feature: opengl
Build-Depends: opengl
Description: opengl support for opencv
Feature: png
Build-Depends: libpng
Description: PNG support for opencv
Feature: qt
Build-Depends: qt5-base[core]
Description: Qt GUI support for opencv
Feature: tiff
Build-Depends: tiff
Description: TIFF support for opencv
Feature: world
Description: Compile to a single package support for opencv

View File

@ -32,6 +32,7 @@ file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake")
file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA")
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"cuda" WITH_CUDA
"eigen" WITH_EIGEN
"ffmpeg" WITH_FFMPEG
@ -57,9 +58,8 @@ if("ffmpeg" IN_LIST FEATURES)
endif()
endif()
vcpkg_configure_cmake(
PREFER_NINJA
SOURCE_PATH ${SOURCE_PATH}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
###### ocv_options
-DCMAKE_DEBUG_POSTFIX=d
@ -95,12 +95,12 @@ vcpkg_configure_cmake(
-DWITH_CUBLAS=OFF # newer libcublas cannot be found by the old cuda cmake script in opencv2, requires a fix
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/opencv" TARGET_PATH "share/opencv")
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME opencv CONFIG_PATH "share/opencv")
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES)
file(READ "${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake" OPENCV_MODULES)
string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)"
"set(CMAKE_IMPORT_FILE_VERSION 1)
find_package(CUDA QUIET)
@ -113,14 +113,14 @@ set(CMAKE_AUTOUIC ON)
find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET)
find_package(TIFF QUIET)" OPENCV_MODULES "${OPENCV_MODULES}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake" "${OPENCV_MODULES}")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE "${CURRENT_PACKAGES_DIR}/LICENSE")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/LICENSE")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

101
ports/opencv2/vcpkg.json Normal file
View File

@ -0,0 +1,101 @@
{
"name": "opencv2",
"version": "2.4.13.7",
"port-version": 6,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
"eigen",
"jpeg",
"png",
"tiff"
],
"features": {
"cuda": {
"description": "CUDA support for opencv",
"dependencies": [
"cuda"
]
},
"eigen": {
"description": "Eigen support for opencv",
"dependencies": [
"eigen3"
]
},
"ffmpeg": {
"description": "ffmpeg support for opencv",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avformat",
"swresample",
"swscale"
]
}
]
},
"jasper": {
"description": "JPEG 2000 support for opencv",
"dependencies": [
"jasper"
]
},
"jpeg": {
"description": "JPEG support for opencv",
"dependencies": [
"libjpeg-turbo"
]
},
"openexr": {
"description": "OpenEXR support for opencv",
"dependencies": [
"openexr"
]
},
"opengl": {
"description": "opengl support for opencv",
"dependencies": [
"opengl"
]
},
"png": {
"description": "PNG support for opencv",
"dependencies": [
"libpng"
]
},
"qt": {
"description": "Qt GUI support for opencv",
"dependencies": [
{
"name": "qt5-base",
"default-features": false
}
]
},
"tiff": {
"description": "TIFF support for opencv",
"dependencies": [
"tiff"
]
},
"world": {
"description": "Compile to a single package support for opencv"
}
}
}

View File

@ -0,0 +1,15 @@
diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt
index 24f89e6..435deb6 100644
--- a/modules/imgcodecs/CMakeLists.txt
+++ b/modules/imgcodecs/CMakeLists.txt
@@ -9,6 +9,10 @@ ocv_add_module(imgcodecs opencv_imgproc WRAP java objc python)
ocv_clear_vars(GRFMT_LIBS)
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
+endif()
+
if(HAVE_WINRT_CX AND NOT WINRT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
endif()

View File

@ -22,6 +22,7 @@ vcpkg_from_github(
0005-fix-vtk9.patch
0006-fix-uwp.patch
0008-devendor-quirc.patch
0010-fix-uwp-tiff-imgcodecs.patch
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
@ -252,9 +253,8 @@ if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
set(BUILD_opencv_bgsegm OFF)
endif()
vcpkg_configure_cmake(
PREFER_NINJA
SOURCE_PATH ${SOURCE_PATH}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
###### opencv cpu recognition is broken, always using host and not target: here we bypass that
-DOPENCV_SKIP_SYSTEM_PROCESSOR_DETECTION=TRUE
@ -344,12 +344,12 @@ vcpkg_configure_cmake(
${ADDITIONAL_BUILD_FLAGS}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/opencv" TARGET_PATH "share/opencv")
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME opencv CONFIG_PATH "share/opencv")
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES)
file(READ "${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake" OPENCV_MODULES)
set(DEPS_STRING "include(CMakeFindDependencyMacro)
find_dependency(protobuf CONFIG)
if(protobuf_FOUND)
@ -437,20 +437,20 @@ find_dependency(Qt5 COMPONENTS OpenGL Concurrent Test)")
"OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake" "${OPENCV_MODULES}")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE "${CURRENT_PACKAGES_DIR}/LICENSE")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/LICENSE")
if(VCPKG_TARGET_IS_ANDROID)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/README.android")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/README.android")
endif()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,10 +1,18 @@
{
"name": "opencv3",
"version": "3.4.14",
"port-version": 1,
"port-version": 2,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
@ -68,7 +76,16 @@
"ffmpeg": {
"description": "ffmpeg support for opencv",
"dependencies": [
"ffmpeg"
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avformat",
"swresample",
"swscale"
]
}
]
},
"flann": {

View File

@ -0,0 +1,15 @@
diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt
index 24f89e6..435deb6 100644
--- a/modules/imgcodecs/CMakeLists.txt
+++ b/modules/imgcodecs/CMakeLists.txt
@@ -9,6 +9,10 @@ ocv_add_module(imgcodecs opencv_imgproc WRAP java objc python)
ocv_clear_vars(GRFMT_LIBS)
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
+endif()
+
if(HAVE_WINRT_CX AND NOT WINRT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
endif()

View File

@ -23,6 +23,7 @@ vcpkg_from_github(
0006-fix-uwp.patch
0008-devendor-quirc.patch
0009-fix-qt-integration.patch
0010-fix-uwp-tiff-imgcodecs.patch
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
@ -118,9 +119,9 @@ endif()
if("cuda" IN_LIST FEATURES)
vcpkg_download_distfile(OCV_DOWNLOAD
URLS "https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/79c6cee80a2df9a196f20afd6b598a9810964c32.zip"
FILENAME "opencv-cache/nvidia_optical_flow/ca5acedee6cb45d0ec610a6732de5c15-79c6cee80a2df9a196f20afd6b598a9810964c32.zip"
SHA512 d80cdedec588dafaad4ebb8615349f842ecdc64d3ca9480fee7086d606e6f2362606a9a2ce273c5cf507be2840ec24bbcbe32c2962672c3bcfb72d31428ef73d
URLS "https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/edb50da3cf849840d680249aa6dbef248ebce2ca.zip"
FILENAME "opencv-cache/nvidia_optical_flow/a73cd48b18dcc0cc8933b30796074191-edb50da3cf849840d680249aa6dbef248ebce2ca.zip"
SHA512 12d655ac9fcfc6df0186daa62f7185dadd489f0eeea25567d78c2b47a9840dcce2bd03a3e9b3b42f125dbaf3150f52590ea7597dc1dc8acee852dc0aed56651e
)
endif()
@ -309,9 +310,8 @@ if("qt" IN_LIST FEATURES)
list(APPEND ADDITIONAL_BUILD_FLAGS "-DCMAKE_AUTOMOC=ON")
endif()
vcpkg_configure_cmake(
PREFER_NINJA
SOURCE_PATH ${SOURCE_PATH}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
###### opencv cpu recognition is broken, always using host and not target: here we bypass that
-DOPENCV_SKIP_SYSTEM_PROCESSOR_DETECTION=TRUE
@ -404,12 +404,12 @@ vcpkg_configure_cmake(
${ADDITIONAL_BUILD_FLAGS}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/opencv" TARGET_PATH "share/opencv")
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME opencv CONFIG_PATH "share/opencv")
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES)
file(READ "${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake" OPENCV_MODULES)
set(DEPS_STRING "include(CMakeFindDependencyMacro)
find_dependency(protobuf CONFIG)
if(protobuf_FOUND)
@ -497,20 +497,20 @@ find_dependency(Qt5 COMPONENTS OpenGL Concurrent Test)")
"OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake" "${OPENCV_MODULES}")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE "${CURRENT_PACKAGES_DIR}/LICENSE")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/LICENSE")
if(VCPKG_TARGET_IS_ANDROID)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/README.android")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/README.android")
endif()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,9 +1,18 @@
{
"name": "opencv4",
"version": "4.5.2",
"port-version": 1,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
@ -63,7 +72,16 @@
"ffmpeg": {
"description": "ffmpeg support for opencv",
"dependencies": [
"ffmpeg"
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avformat",
"swresample",
"swscale"
]
}
]
},
"gdcm": {

View File

@ -2014,7 +2014,7 @@
},
"ffmpeg": {
"baseline": "4.4",
"port-version": 13
"port-version": 14
},
"ffnvcodec": {
"baseline": "10.0.26.0",
@ -4622,15 +4622,15 @@
},
"opencv2": {
"baseline": "2.4.13.7",
"port-version": 5
"port-version": 6
},
"opencv3": {
"baseline": "3.4.14",
"port-version": 1
"port-version": 2
},
"opencv4": {
"baseline": "4.5.2",
"port-version": 0
"port-version": 1
},
"opendnp3": {
"baseline": "3.1.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5d893a1c421f553fbdd9c1f79530a6a84bd0eb76",
"version": "4.4",
"port-version": 14
},
{
"git-tree": "26e3d87d6b3049b45355f36a34402b938d5b486d",
"version": "4.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e85a45aa17a47da9f965b93cb0c6fc8273a7ca04",
"version": "2.4.13.7",
"port-version": 6
},
{
"git-tree": "50a5602ecab15fd1c36f0619a5fdbd4792eb1b23",
"version-string": "2.4.13.7",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c91b306c8fc5cbdffa178a247051d306240c55ad",
"version": "3.4.14",
"port-version": 2
},
{
"git-tree": "850be938a178de206c52be71229048d501bd61e8",
"version": "3.4.14",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e659d7d78204aee895e5f222f7cf9beb90df8a31",
"version": "4.5.2",
"port-version": 1
},
{
"git-tree": "ac5c96fd5709b302c81b76814a3ccfd99dcdecdc",
"version": "4.5.2",