From eba3e2d4058afed4e2b90219209137876b1aa007 Mon Sep 17 00:00:00 2001 From: Amin Cheloh Date: Sun, 29 Oct 2017 12:25:50 +0700 Subject: [PATCH 1/2] [opencv] remove ffmpeg depenency OpenCV has own prebuilt ffmpeg library --- ports/opencv/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 5d9f184b13..6e0afd6c08 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,5 +1,5 @@ Source: opencv -Version: 3.3.1-1 +Version: 3.3.1-2 # Optional: Add in vtk to build with VTK and cuda to build with CUDA -Build-Depends: zlib, libpng, libjpeg-turbo, tiff, protobuf (windows), ffmpeg +Build-Depends: zlib, libpng, libjpeg-turbo, tiff, protobuf (windows) Description: computer vision library From 5bfb7dd74cda07046372e8d5f1778ad9f34e1fd8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Nov 2017 07:08:10 -0700 Subject: [PATCH 2/2] [opencv] Remove ffmpeg from dependencies -- it is not currently possible to use an external ffmpeg with opencv. Add features for cuda and vtk. --- ports/opencv/CONTROL | 18 ++++++++++++++-- ports/opencv/portfile.cmake | 41 ++++++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 6e0afd6c08..d6718f0803 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,5 +1,19 @@ Source: opencv -Version: 3.3.1-2 -# Optional: Add in vtk to build with VTK and cuda to build with CUDA +Version: 3.3.1-3 Build-Depends: zlib, libpng, libjpeg-turbo, tiff, protobuf (windows) Description: computer vision library + +Feature: ffmpeg +Description: prebuilt ffmpeg support for opencv + +Feature: vtk +Build-Depends: vtk +Description: vtk support for opencv + +Feature: cuda +Build-Depends: cuda +Description: CUDA support for opencv + +Feature: sfm +Build-Depends: eigen3, glog, gflags +Description: opencv_sfm module diff --git a/ports/opencv/portfile.cmake b/ports/opencv/portfile.cmake index be542e9120..f3da289488 100644 --- a/ports/opencv/portfile.cmake +++ b/ports/opencv/portfile.cmake @@ -32,6 +32,26 @@ vcpkg_apply_patches( string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) +set(WITH_FFMPEG OFF) +if("ffmpeg" IN_LIST FEATURES) + set(WITH_FFMPEG ON) +endif() + +set(WITH_CUDA OFF) +if("cuda" IN_LIST FEATURES) + set(WITH_CUDA ON) +endif() + +set(WITH_VTK OFF) +if("vtk" IN_LIST FEATURES) + set(WITH_VTK ON) +endif() + +set(BUILD_opencv_sfm OFF) +if("sfm" IN_LIST FEATURES) + set(BUILD_opencv_sfm ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS @@ -42,10 +62,6 @@ vcpkg_configure_cmake( -DBUILD_JPEG=OFF -DBUILD_PNG=OFF -DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON - -DBUILD_opencv_python2=OFF - -DBUILD_opencv_python3=OFF - -DBUILD_opencv_flann=ON - -DBUILD_opencv_apps=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DENABLE_PYLINT=OFF @@ -54,23 +70,28 @@ vcpkg_configure_cmake( -DBUILD_TESTS=OFF -DBUILD_WITH_DEBUG_INFO=ON -DOpenCV_DISABLE_ARCH_PATH=ON - -DWITH_FFMPEG=ON -DINSTALL_FORCE_UNIX_PATHS=ON -DOPENCV_CONFIG_INSTALL_PATH=share/opencv -DOPENCV_OTHER_INSTALL_PATH=share/opencv -DINSTALL_LICENSE=OFF - # Optional: change to ON to build with CUDA - -DWITH_CUDA=OFF -DWITH_CUBLAS=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_LAPACK=OFF - -DBUILD_opencv_dnn=ON -DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules -DBUILD_PROTOBUF=OFF -DUPDATE_PROTO_FILES=ON -DPROTOBUF_UPDATE_FILES=ON - # Optional: change to ON to build with VTK - -DWITH_VTK=OFF + + -DBUILD_opencv_dnn=ON + -DBUILD_opencv_python2=OFF + -DBUILD_opencv_python3=OFF + -DBUILD_opencv_flann=ON + -DBUILD_opencv_apps=OFF + -DBUILD_opencv_sfm=${BUILD_opencv_sfm} + + -DWITH_FFMPEG=${WITH_FFMPEG} + -DWITH_CUDA=${WITH_CUDA} + -DWITH_VTK=${WITH_VTK} OPTIONS_DEBUG -DINSTALL_HEADERS=OFF -DINSTALL_OTHER=OFF