Skip to content

Commit

Permalink
[OpenCV] upgrade to v4.5.5 (#22801)
Browse files Browse the repository at this point in the history
* [OpenCV4] update to v4.5.5

* [OpenCV] bump version

* [gstreamer] fix build for opencv

* fix references

* [vcpkg-tool-meson] fix nuget packaging

* fix references

* [gstreamer] fix references

* [ogre] update vcpkg tools

* fix references

* [OpenCV4] fixes from CI runs

* fix references

* [OpenCV4] force python module also in debug builds

* fix references

* [harfbuzz] fix cmake config

* harfbuzz fixes

* fix references

* [OpenCV4] remove unnecessary lines from patches

* fix references

* fix references

* [harfbuzz] bump version

* [harfbuzz] fix for single config builds

* fix references

* freetype fixes

* fix references

* fix ogre references

* fix references, again

* python when building static windows opencv libraries is unsupported

* fix references

* fix

* refs

* use required when necessary

* fix references

* do not use config for hdf5, use internal module

* fix references

* use proper spelling for freetype config cmake

* fix references

* [OpenCV] restore versions after merge

* fix references

* [leptonica] fix building

* fix references

* do not require package in optional features

* £fix references

* fix python feat

* update version

* update version

* [ffmpeg] remove opengl feat on arm64-windows

* format manifest

* fix references

* fix cuda/nvidia features compatibility matrix

* fix manifest

* fix

* fix

* fix references

* fix references, again

* move CONTROL to manifest

* [gstreamer] bump versions

* fix references

Co-authored-by: Lily Wang <[email protected]>
  • Loading branch information
cenit and Lily Wang authored Feb 23, 2022
1 parent daa7215 commit 4015784
Show file tree
Hide file tree
Showing 53 changed files with 433 additions and 176 deletions.
5 changes: 3 additions & 2 deletions ports/cuda/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "cuda",
"version-string": "10.1",
"port-version": 8,
"port-version": 9,
"description": "A parallel computing platform and programming model",
"homepage": "https://developer.nvidia.com/cuda-toolkit"
"homepage": "https://developer.nvidia.com/cuda-toolkit",
"supports": "linux | (!osx & !uwp & !(arm64 & windows))"
}
23 changes: 12 additions & 11 deletions ports/ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4.1",
"port-version": 8,
"port-version": 9,
"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."
Expand Down Expand Up @@ -114,14 +114,6 @@
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"opengl"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
Expand Down Expand Up @@ -174,9 +166,9 @@
"name": "ffmpeg",
"default-features": false,
"features": [
"nvcodec"
"opengl"
],
"platform": "(windows | linux) & !uwp"
"platform": "!uwp & !(arm64 & windows)"
},
{
"name": "ffmpeg",
Expand All @@ -185,6 +177,14 @@
"tesseract"
],
"platform": "!(windows & arm) & !static & !uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"nvcodec"
],
"platform": "linux | (!osx & !uwp & !(arm64 & windows))"
}
]
},
Expand Down Expand Up @@ -442,6 +442,7 @@
},
"nvcodec": {
"description": "Nvidia video decoding/encoding acceleration",
"supports": "linux | (!osx & !uwp & !(arm64 & windows))",
"dependencies": [
"ffnvcodec"
]
Expand Down
3 changes: 2 additions & 1 deletion ports/ffnvcodec/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "ffnvcodec",
"version": "11.1.5.0",
"port-version": 1,
"description": "FFmpeg version of Nvidia Codec SDK headers.",
"homepage": "https://github.com/FFmpeg/nv-codec-headers",
"supports": "(windows | linux) & !uwp"
"supports": "linux | (!osx & !uwp & !(arm64 & windows))"
}
10 changes: 6 additions & 4 deletions ports/gstreamer/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
endif()

if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(GLOB DBG_BINS "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.dll"
"${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.pdb"
)
file(COPY ${DBG_BINS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
if (NOT VCPKG_BUILD_TYPE)
file(GLOB DBG_BINS "${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.dll"
"${CURRENT_PACKAGES_DIR}/debug/lib/gstreamer-1.0/*.pdb"
)
file(COPY ${DBG_BINS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(GLOB REL_BINS "${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/*.dll"
"${CURRENT_PACKAGES_DIR}/lib/gstreamer-1.0/*.pdb"
)
Expand Down
2 changes: 1 addition & 1 deletion ports/gstreamer/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gstreamer",
"version": "1.19.2",
"port-version": 4,
"port-version": 5,
"description": "GStreamer open-source multimedia framework core library",
"homepage": "https://gstreamer.freedesktop.org/",
"license": "LGPL-2.0",
Expand Down
22 changes: 16 additions & 6 deletions ports/harfbuzz/harfbuzzConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# For old projects where the minimum CMake version is lower than 3.3.
cmake_policy(SET CMP0057 NEW)
include(CMakeFindDependencyMacro)

if(TARGET harfbuzz)
return()
Expand All @@ -14,9 +15,7 @@ if(HARFBUZZ_LIBRARY_DEBUG)
endif()

find_library(HARFBUZZ_LIBRARY_RELEASE NAMES harfbuzz PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
if(HARFBUZZ_LIBRARY_RELEASE)
target_link_libraries(harfbuzz INTERFACE $<$<NOT:$<CONFIG:DEBUG>>:${HARFBUZZ_LIBRARY_RELEASE}>)
endif()
target_link_libraries(harfbuzz INTERFACE $<$<NOT:$<CONFIG:DEBUG>>:${HARFBUZZ_LIBRARY_RELEASE}>)

set(HARFBUZZ_FEATURES @FEATURES@)

Expand All @@ -25,7 +24,7 @@ if(APPLE)
target_link_libraries(harfbuzz INTERFACE ${APPLICATIONSERVICES_LIBRARY})
endif()

find_package(freetype CONFIG REQUIRED)
find_dependency(freetype CONFIG)
target_link_libraries(harfbuzz INTERFACE freetype)

if ("graphite2" IN_LIST HARFBUZZ_FEATURES)
Expand Down Expand Up @@ -53,9 +52,20 @@ if ("glib" IN_LIST HARFBUZZ_FEATURES)
endif()

if ("icu" IN_LIST HARFBUZZ_FEATURES)
find_package(ICU 61 COMPONENTS uc REQUIRED)
find_dependency(ICU 61 COMPONENTS uc)
target_link_libraries(harfbuzz INTERFACE ICU::uc)
endif()

get_filename_component(_INSTALL_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
target_include_directories(harfbuzz INTERFACE ${_INSTALL_DIR}/include/harfbuzz)
target_include_directories(harfbuzz INTERFACE "${_INSTALL_DIR}/include/harfbuzz")

set(HARFBUZZ_LIBRARY harfbuzz::harfbuzz PARENT_SCOPE)
set(HARFBUZZ_LIBRARIES harfbuzz::harfbuzz PARENT_SCOPE)
set(HARFBUZZ_INCLUDE_DIR "${_INSTALL_DIR}/include/harfbuzz" PARENT_SCOPE)
set(HARFBUZZ_INCLUDE_DIRS "${_INSTALL_DIR}/include/harfbuzz" PARENT_SCOPE)

if(HARFBUZZ_LIBRARY_RELEASE)
set(HARFBUZZ_FOUND TRUE PARENT_SCOPE)
else()
set(HARFBUZZ_FOUND FALSE PARENT_SCOPE)
endif()
1 change: 1 addition & 0 deletions ports/harfbuzz/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "harfbuzz",
"version-semver": "3.2.0",
"port-version": 1,
"description": "HarfBuzz OpenType text shaping engine",
"homepage": "https://github.com/harfbuzz/harfbuzz",
"dependencies": [
Expand Down
13 changes: 0 additions & 13 deletions ports/leptonica/Modify-include-dir.patch

This file was deleted.

51 changes: 39 additions & 12 deletions ports/leptonica/fix-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e474463..d2b999d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,6 @@ if (MSVC)
set_source_files_properties(${src} PROPERTIES LANGUAGE CXX)
endif()

-string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")

add_library (leptonica ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION ${VERSION_PLAIN})
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,20 +58,19 @@ if(UNIX)
endif()

if(NOT SW_BUILD)
- find_package(GIF)
- find_package(JPEG)
- find_package(PNG)
- find_package(TIFF)
- find_package(ZLIB)
+ find_package(GIF REQUIRED)
+ find_package(JPEG REQUIRED)
+ find_package(PNG REQUIRED)
+ find_package(TIFF REQUIRED)
+ find_package(ZLIB REQUIRED)
find_package(PkgConfig)
+ find_package(OpenJPEG REQUIRED)
if (PKG_CONFIG_FOUND)
pkg_check_modules(WEBP libwebp QUIET)
pkg_check_modules(WEBPMUX libwebpmux>=${MINIMUM_WEBPMUX_VERSION} QUIET)
- pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)
endif()
if(NOT WEBP)
- find_path(WEBP_INCLUDE_DIR /webp/decode.h)
- find_library(WEBP_LIBRARY NAMES webp)
+ find_package(WebP CONFIG REQUIRED)
if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
set(WEBP 1)
set(WEBP_FOUND TRUE)
@@ -213,7 +212,7 @@ include(Configure)

configure_file(${AUTOCONFIG_SRC} ${AUTOCONFIG} @ONLY)

-set(INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" "${CMAKE_INSTALL_PREFIX}/include/leptonica")
+set(INCLUDE_DIR "\${CMAKE_CURRENT_LIST_DIR}/../../include" "\${CMAKE_CURRENT_LIST_DIR}/../../include/leptonica")

###############################################################################
#
27 changes: 0 additions & 27 deletions ports/leptonica/fix-find-libwebp.patch

This file was deleted.

19 changes: 19 additions & 0 deletions ports/leptonica/fix-src-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,6 @@ if (MSVC)
set_source_files_properties(${src} PROPERTIES LANGUAGE CXX)
endif()

-string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")

add_library (leptonica ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION ${VERSION_PLAIN})
@@ -52,7 +52,7 @@ if (TIFF_LIBRARIES)
endif()
if (WEBP_FOUND)
target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS})
- target_link_libraries (leptonica ${WEBP_LIBRARIES})
+ target_link_libraries (leptonica WebP::webp WebP::libwebpmux)
endif()
if (ZLIB_LIBRARIES)
target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIRS})
3 changes: 1 addition & 2 deletions ports/leptonica/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix-cmakelists.patch
fix-src-cmakelists.patch
find-dependency.patch
fix-find-libwebp.patch
Modify-include-dir.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC)
Expand Down
1 change: 1 addition & 0 deletions ports/leptonica/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "leptonica",
"version": "1.81.1",
"port-version": 1,
"description": "An open source library containing software that is broadly useful for image processing and image analysis applications",
"homepage": "https://github.com/DanBloomberg/leptonica",
"dependencies": [
Expand Down
20 changes: 8 additions & 12 deletions ports/ogre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
d3d9 OGRE_BUILD_RENDERSYSTEM_D3D9
java OGRE_BUILD_COMPONENT_JAVA
python OGRE_BUILD_COMPONENT_PYTHON
csharp OGRE_BUILD_COMPONENT_CSHARP
csharp OGRE_BUILD_COMPONENT_CSHARP
overlay OGRE_BUILD_COMPONENT_OVERLAY
zziplib OGRE_CONFIG_ENABLE_ZIP
strict OGRE_RESOURCEMANAGER_STRICT
Expand All @@ -47,6 +47,7 @@ string(REPLACE "OGRE_RESOURCEMANAGER_STRICT=OFF" "OGRE_RESOURCEMANAGER_STRICT=0"
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DOGRE_BUILD_DEPENDENCIES=OFF
-DOGRE_BUILD_SAMPLES=OFF
-DOGRE_BUILD_TESTS=OFF
Expand All @@ -68,9 +69,6 @@ vcpkg_cmake_configure(
-DOGRE_BUILD_RENDERSYSTEM_GLES=OFF
-DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF
-DFREETYPE_FOUND=ON
# Optional stuff
${FEATURE_OPTIONS}
# vcpkg specific stuff
-DOGRE_CMAKE_DIR=share/ogre
)

Expand Down Expand Up @@ -99,15 +97,13 @@ endif()
#Remove OgreMain*.lib from lib/ folder, because autolink would complain, since it defines a main symbol
#manual-link subfolder is here to the rescue!
if(VCPKG_TARGET_IS_WINDOWS)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib)
else()
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib)
endif()
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib)
else()
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug")
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib)
Expand Down
3 changes: 2 additions & 1 deletion ports/ogre/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "ogre",
"version": "1.12.9",
"port-version": 6,
"port-version": 7,
"description": "3D Object-Oriented Graphics Rendering Engine",
"homepage": "https://github.com/OGRECave/ogre",
"license": "MIT",
"dependencies": [
"pugixml",
"sdl2",
Expand Down
15 changes: 13 additions & 2 deletions ports/opencv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "opencv",
"version": "4.5.4",
"port-version": 1,
"version": "4.5.5",
"description": "Computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
Expand Down Expand Up @@ -123,6 +122,18 @@
}
]
},
"freetype": {
"description": "freetype support for opencv",
"dependencies": [
{
"name": "opencv4",
"default-features": false,
"features": [
"freetype"
]
}
]
},
"gdcm": {
"description": "GDCM support for opencv",
"dependencies": [
Expand Down
1 change: 1 addition & 0 deletions ports/opencv3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ vcpkg_cmake_configure(
-DWITH_OPENCLAMDBLAS=OFF
-DWITH_TBB=${WITH_TBB}
-DWITH_OPENJPEG=OFF
-DWITH_CPUFEATURES=OFF
###### BUILD_options (mainly modules which require additional libraries)
-DBUILD_opencv_ovis=${BUILD_opencv_ovis}
-DBUILD_opencv_dnn=${BUILD_opencv_dnn}
Expand Down
Loading

0 comments on commit 4015784

Please sign in to comment.