Skip to content

Commit

Permalink
[opencv] Update to OpenCV 3.4.3 (#4636)
Browse files Browse the repository at this point in the history
Update opencv port to OpenCV 3.4.3.
  • Loading branch information
UnaNancyOwen authored and ras0219-msft committed Nov 4, 2018
1 parent 56ea0dc commit 4ef6ddd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 53 deletions.
13 changes: 1 addition & 12 deletions ports/opencv/0001-winrt-fixes.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,7 +311,7 @@ OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binar
# OpenCV build options
# ===================================================
OCV_OPTION(ENABLE_CCACHE "Use ccache" (UNIX AND NOT IOS AND (CMAKE_GENERATOR MATCHES "Makefile" OR CMAKE_GENERATOR MATCHES "Ninja")) )
-OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS AND NOT CMAKE_CROSSCOMPILING) )
+OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS AND (MSVC OR NOT CMAKE_CROSSCOMPILING)) )
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) )
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CMAKE_COMPILER_IS_GNUCXX )
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -842,7 +842,7 @@ macro(ocv_create_module)
@@ -848,7 +848,7 @@ macro(ocv_create_module)
set(the_module_target ${the_module})
endif()

Expand Down
52 changes: 28 additions & 24 deletions ports/opencv/0002-install-options.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7c76ecf3..d1c14bfcd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -307,6 +307,10 @@ OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
@@ -312,6 +312,10 @@ OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT APPLE_FRAMEWORK AND BUILD_SHARED_LIBS) )
OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binaries and test data" OFF)
+OCV_OPTION(INSTALL_HEADERS "Install header files" ON)
+OCV_OPTION(INSTALL_LICENSE "Install license file" ON)
+OCV_OPTION(INSTALL_OTHER "Install other files" ON)
+OCV_OPTION(INSTALL_FORCE_UNIX_PATHS "Force unix-style installation" OFF)

# OpenCV build options
# ===================================================
@@ -335,7 +339,7 @@ OCV_OPTION(CV_ENABLE_INTRINSICS "Use intrinsic-based optimized code" ON )
OCV_OPTION(CV_DISABLE_OPTIMIZATION "Disable explicit optimized code (dispatched code/intrinsics/loop unrolling/etc)" OFF )
OCV_OPTION(CV_TRACE "Enable OpenCV code trace" ON)

-OCV_OPTION(ENABLE_PYLINT "Add target with Pylint checks" (${BUILD_DOCS} OR ${BUILD_EXAMPLES}) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )
+OCV_OPTION(ENABLE_PYLINT "Add target with Pylint checks" (BUILD_DOCS OR BUILD_EXAMPLES) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )

if(ENABLE_IMPL_COLLECTION)
add_definitions(-DCV_COLLECT_IMPL_DATA)
@@ -372,7 +376,9 @@ else()
@@ -378,7 +382,9 @@ else()
endif()

if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
- if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
+ if(DEFINED OpenCV_DISABLE_ARCH_PATH)
Expand All @@ -31,9 +24,9 @@
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
else()
message(STATUS "Can't detect runtime and/or arch")
@@ -427,12 +433,8 @@ else()
@@ -433,12 +439,8 @@ else()
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")

if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
- if(OpenCV_STATIC)
- ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
Expand All @@ -46,26 +39,28 @@
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples)
ocv_update(OPENCV_JAR_INSTALL_PATH java)
ocv_update(OPENCV_OTHER_INSTALL_PATH etc)
@@ -895,7 +897,7 @@ if(NOT OPENCV_LICENSE_FILE)
@@ -901,7 +903,7 @@ if(NOT OPENCV_LICENSE_FILE)
endif()

# for UNIX it does not make sense as LICENSE and readme will be part of the package automatically
-if(ANDROID OR NOT UNIX)
+if(ANDROID OR NOT UNIX AND INSTALL_LICENSE)
install(FILES ${OPENCV_LICENSE_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION ./ COMPONENT libs)
diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake
index b2ca82bad..c2f6e001d 100644
--- a/cmake/OpenCVGenConfig.cmake
+++ b/cmake/OpenCVGenConfig.cmake
@@ -105,7 +105,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME)
endif()
endfunction()

-if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID)
+if(((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) OR INSTALL_FORCE_UNIX_PATHS)
ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "")
endif()

@@ -117,7 +117,7 @@ endif()
# --------------------------------------------------------------------------------------------
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
Expand All @@ -75,6 +70,8 @@
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
if(BUILD_SHARED_LIBS)
set(_lib_suffix "lib")
diff --git a/cmake/OpenCVGenHeaders.cmake b/cmake/OpenCVGenHeaders.cmake
index 477b91055..57dc82e13 100644
--- a/cmake/OpenCVGenHeaders.cmake
+++ b/cmake/OpenCVGenHeaders.cmake
@@ -1,7 +1,9 @@
Expand All @@ -85,20 +82,23 @@
+if(INSTALL_HEADERS)
+ install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
+endif()

# platform-specific config file
ocv_compiler_optimization_fill_cpu_config()
@@ -29,4 +31,6 @@ set(OPENCV_MODULE_DEFINITIONS_CONFIGMAKE "${OPENCV_MODULE_DEFINITIONS_CONFIGMAKE
#endforeach()

configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv_modules.hpp.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
-install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
+if(INSTALL_HEADERS)
+ install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
+endif()
\ No newline at end of file
diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index 54f100d3c..eae83b074 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -994,7 +994,9 @@ macro(_ocv_create_module)
@@ -1000,7 +1000,9 @@ macro(_ocv_create_module)
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
if(NOT hdr2 MATCHES "private" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
Expand All @@ -109,21 +109,25 @@
endif()
endforeach()
endif()
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 1f0d72008..86b9d8929 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,8 +1,10 @@
file(GLOB HAAR_CASCADES haarcascades/*.xml)
file(GLOB LBP_CASCADES lbpcascades/*.xml)

-install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs)
-install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs)
+if(INSTALL_OTHER)
+ install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs)
+ install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs)
+endif()

if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests")
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index b4e48e6fa..5ac6f1603 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,7 +1,9 @@
Expand Down
17 changes: 4 additions & 13 deletions ports/opencv/0005-remove-protobuf-target.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake
index b9171f14f..6e06310b1 100644
--- a/cmake/OpenCVFindProtobuf.cmake
+++ b/cmake/OpenCVFindProtobuf.cmake
@@ -44,17 +44,6 @@ else()
@@ -43,17 +43,6 @@ else()
# end of compatibility block

if(Protobuf_FOUND)
Expand All @@ -11,21 +13,10 @@
- add_library(libprotobuf UNKNOWN IMPORTED)
- set_target_properties(libprotobuf PROPERTIES
- IMPORTED_LOCATION "${Protobuf_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
- INTERFACE_INCLUDE_SYSTEM_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
- )
- get_protobuf_version(Protobuf_VERSION "${Protobuf_INCLUDE_DIR}")
- endif()
set(HAVE_PROTOBUF TRUE)
endif()
endif()
--- a/modules/dnn/CMakeLists.txt
+++ b/modules/dnn/CMakeLists.txt
@@ -65,7 +65,7 @@ endif()

ocv_module_include_directories(${fw_inc} ${CMAKE_CURRENT_LIST_DIR}/src/ocl4dnn/include ${OPENCL_INCLUDE_DIRS})
ocv_glob_module_sources(SOURCES ${fw_srcs})
-ocv_create_module(libprotobuf ${LAPACK_LIBRARIES})
+ocv_create_module()
ocv_add_samples()
ocv_add_accuracy_tests()
ocv_add_perf_tests()
2 changes: 1 addition & 1 deletion ports/opencv/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: opencv
Version: 3.4.1
Version: 3.4.3-1
Build-Depends: zlib
Description: computer vision library
Default-Features: opengl, jpeg, png, tiff, eigen, flann
Expand Down
6 changes: 3 additions & 3 deletions ports/opencv/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include(vcpkg_common_functions)

set(OPENCV_PORT_VERSION "3.4.1")
set(OPENCV_PORT_VERSION "3.4.3")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO opencv/opencv
REF ${OPENCV_PORT_VERSION}
SHA512 e1fc14285090c6fe9e26e721f2d67d7096650c523147e925567426ef76aa7f4c6f12035d6f6ce3ec7991a75a6828a810fd4f9b75f78ed5fcccecefbadd79944b
SHA512 d653a58eb5e3939b9fdb7438ac35f77cf4385cf72d5d22bfd21722a109e1b3283dbb9407985061b7548114f0d05c9395aac9bb62b4d2bc1f68da770a49987fef
HEAD_REF master
)

Expand Down Expand Up @@ -218,7 +218,7 @@ if(BUILD_opencv_contrib)
OUT_SOURCE_PATH CONTRIB_SOURCE_PATH
REPO opencv/opencv_contrib
REF ${OPENCV_PORT_VERSION}
SHA512 431dfba0f413071d7faa18bc6e6f5e4f015285e2cc730c5dd69b2a4d6aa4250b7e0bcb1814ac6f06f5c76f103aea1f93f72f32aee6bc0cd7ddacdaf1f40075c1
SHA512 456c6f878fb3bd5459f6430405cf05c609431f8d7db743aa699fc75c305d019682ee3a804bf0cf5107597dd1dbbb69b08be3535a0e6c717e4773ed7c05d08e59
HEAD_REF master
)
set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules")
Expand Down

0 comments on commit 4ef6ddd

Please sign in to comment.