Skip to content

Commit

Permalink
[OpenCV] Update to v4.1.1 (#5169)
Browse files Browse the repository at this point in the history
* [OpenCV] update to v4

* [OpenCV] update to v4.1

* [OpenCV] merge #6901 and #6812

* [OpenCV] port patches to v4.1

* [OpenCV] fix naming

* [OpenCV] fix regression with static linkage

* [OpenCV] fix linking to optional feature dependencies in static mode

* fix ffmpeg on some architectures

* trigger rebuild of regressions on macOS

* [zxing-cpp] fix opencv 4.1 compat

* [ogre] improve patching for static builds

* [OpenCV] fixes for extra features

* [OpenCV] drastically reduce patchset

* [OpenCV] fix regression on linux

* [OpenCV] fix regression on Windows

* [qt5] depends on qt5-activeqt only on windows

* update to v4.1.1

* [OpenCV] additional fixes for 4.1.1

* [OpenCV] fix Eigen3 feature integration

* [opencv] Fix compilation in UWP

* [opencv] Fix merge conflicts

* [ffmpeg] fix cmake module for osx

* [OpenCV] add pre-caching of optflow cuda package

* [gdcm] properly fix #6863 instead of wrong #6901

* [OpenCV] fix OpenMP feature

* [opencv] Add missing GetModuleHandle() call guard for UWP

* [freeimage] Do not depend on libwebp[all] on UWP

* [opencv] Set app container bit for UWP

* [zxing-cpp] Fail with explicit message in UWP

* [pthreads4w] fix target creation, missing dlls

* [pthreads4w] bump CONTROL

* [opencv,zxing-cpp] Fix OpenCV Video IO module

* [zxing-cpp] Revert unnecessary changes

* [opencv] Feature halide

* Fix regression in UWP

* [ffmpeg] remove unnecessary patch pointing to old OpenCV version

* [opencv] remove versioning from windows dll filenames

* [opencv] Move port to opencv4

* [opencv,opencv4] Make meta-package install OpenCV 4.1

* [opencv3] Rename old port opencv->opencv3

* Add failure messages when another OpenCV is already installed
  • Loading branch information
cenit authored and vicroms committed Aug 12, 2019
1 parent fffcd0a commit 4fb5152
Show file tree
Hide file tree
Showing 31 changed files with 1,521 additions and 595 deletions.
44 changes: 42 additions & 2 deletions ports/ffmpeg/FindFFMPEG.cmake
Expand Up @@ -35,6 +35,8 @@ include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake)

set(FFMPEG_VERSION "4.1")

find_dependency(Threads)
#list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS Threads::Threads)
if(UNIX)
Expand Down Expand Up @@ -83,7 +85,7 @@ macro(FFMPEG_FIND_GENEX varname shortname headername)
set(FFMPEG_${varname}_FOUND 1)
list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR})
endif()
endmacro(FFMPEG_FIND)
endmacro(FFMPEG_FIND_GENEX)

if(WIN32)
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
Expand All @@ -92,8 +94,39 @@ if(WIN32)
if (FFMPEG_stdint_INCLUDE_DIRS)
set(STDINT_OK TRUE)
endif()
FFMPEG_FIND_GENEX(libzlib zlib zlib.h)
else()
set(STDINT_OK TRUE)
FFMPEG_FIND_GENEX(libzlib z zlib.h)
endif()

if(APPLE)
find_library(VT_UNIT VideoToolbox)
if (NOT VT_UNIT)
message(FATAL_ERROR "VideoToolbox not found")
endif()
find_library(AT_UNIT AudioToolbox)
if (NOT AT_UNIT)
message(FATAL_ERROR "AudioToolbox not found")
endif()
find_library(SEC_UNIT Security)
if (NOT SEC_UNIT)
message(FATAL_ERROR "Security not found")
endif()
find_library(CF_UNIT CoreFoundation)
if (NOT CF_UNIT)
message(FATAL_ERROR "CoreFoundation not found")
endif()
find_library(CM_UNIT CoreMedia)
if (NOT CM_UNIT)
message(FATAL_ERROR "CoreMedia not found")
endif()
find_library(CV_UNIT CoreVideo)
if (NOT CV_UNIT)
message(FATAL_ERROR "CoreVideo not found")
endif()
find_package(Iconv QUIET)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES})
endif()

FFMPEG_FIND(libavcodec avcodec avcodec.h)
Expand All @@ -103,13 +136,20 @@ FFMPEG_FIND(libavformat avformat avformat.h)
FFMPEG_FIND(libavutil avutil avutil.h)
FFMPEG_FIND(libswresample swresample swresample.h)
FFMPEG_FIND(libswscale swscale swscale.h)
FFMPEG_FIND_GENEX(libzlib zlib zlib.h)

if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND AND STDINT_OK)
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS} ${FFMPEG_stdint_INCLUDE_DIRS})
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)

set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "")

list(APPEND FFMPEG_LIBRARIES
${FFMPEG_libavformat_LIBRARY}
${FFMPEG_libavdevice_LIBRARY}
Expand Down
11 changes: 0 additions & 11 deletions ports/ffmpeg/configure_opencv.patch

This file was deleted.

1 change: 0 additions & 1 deletion ports/ffmpeg/portfile.cmake
Expand Up @@ -12,7 +12,6 @@ vcpkg_extract_source_archive_ex(
PATCHES
create-lib-libraries.patch
detect-openssl.patch
configure_opencv.patch
fix_windowsinclude-in-ffmpegexe-1.patch
fix_windowsinclude-in-ffmpegexe-2.patch
fix_libvpx_windows_linking.patch
Expand Down
4 changes: 2 additions & 2 deletions ports/freeimage/CONTROL
@@ -1,5 +1,5 @@
Source: freeimage
Version: 3.18.0-6
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp[all], libraw, jxrlib, openexr
Version: 3.18.0-7
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp[all] (!uwp), libraw, jxrlib, openexr
Homepage: https://sourceforge.net/projects/freeimage/
Description: Support library for graphics image formats
2 changes: 1 addition & 1 deletion ports/gdcm/CONTROL
@@ -1,4 +1,4 @@
Source: gdcm
Version: 3.0.0-3
Version: 3.0.0-4
Description: Grassroots DICOM library
Build-Depends: zlib, expat, openjpeg
6 changes: 6 additions & 0 deletions ports/gdcm/portfile.cmake
Expand Up @@ -43,6 +43,12 @@ file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/share
)

file(READ ${CURRENT_PACKAGES_DIR}/share/gdcm/GDCMTargets.cmake GDCM_TARGETS)
string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)"
"set(CMAKE_IMPORT_FILE_VERSION 1)
find_package(OpenJPEG QUIET)" GDCM_TARGETS "${GDCM_TARGETS}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gdcm/GDCMTargets.cmake "${GDCM_TARGETS}")

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
Expand Down
5 changes: 4 additions & 1 deletion ports/ogre/CONTROL
@@ -1,12 +1,15 @@
Source: ogre
Version: 1.12.0-1
Version: 1.12.0-2
Build-Depends: freeimage, freetype, zlib, zziplib
Homepage: https://github.com/OGRECave/ogre
Description: 3D Object-Oriented Graphics Rendering Engine

Feature: d3d9
Description: Build Direct3D9 RenderSystem

Feature: csharp
Description: Build csharp bindings

Feature: java
Description: Build Java (JNI) bindings

Expand Down
15 changes: 14 additions & 1 deletion ports/ogre/portfile.cmake
@@ -1,5 +1,9 @@
include(vcpkg_common_functions)

if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message("${PORT} currently requires the following library from the system package manager:\n Xaw\n\nIt can be installed on Ubuntu systems via apt-get install libxaw7-dev")
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OGRECave/ogre
Expand Down Expand Up @@ -38,6 +42,12 @@ else()
set(WITH_PYTHON OFF)
endif()

if("csharp" IN_LIST FEATURES)
set(WITH_CSHARP ON)
else()
set(WITH_CSHARP OFF)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand Down Expand Up @@ -65,6 +75,7 @@ vcpkg_configure_cmake(
# Optional stuff
-DOGRE_BUILD_COMPONENT_JAVA=${WITH_JAVA}
-DOGRE_BUILD_COMPONENT_PYTHON=${WITH_PYTHON}
-DOGRE_BUILD_COMPONENT_CSHARP=${WITH_CSHARP}
-DOGRE_BUILD_RENDERSYSTEM_D3D9=${WITH_D3D9}
# vcpkg specific stuff
-DOGRE_CMAKE_DIR=share/ogre
Expand Down Expand Up @@ -92,7 +103,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

if(NOT VCPKG_CMAKE_SYSTEM_NAME)
#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(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
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")
Expand Down

0 comments on commit 4fb5152

Please sign in to comment.