mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[OpenCV2] add new "old" port (#7849)
* [OpenCV2] add library for older C projects * [OpenCV2] fixes for non-Windows systems * [OpenCV2] add warnings for Ubuntu * add fixes for cuda * [OpenCV2] disable parallel building, otherwise cuda fails * [OpenCV2] refresh port with latest fixes * [OpenCV2] fix CONTROL * [OpenCV2] fixes for windows * [OpenCV2] fixes to avoid unnecessary install of pre-built ffmpeg, since it already uses externally provided one * [OpenCV2] openexr still has some problems, explicitly removed UWP support * [OpenCV2] use targets wherever possible. Jasper and OpenEXR features would require improvements in those ports, in order for them to provide targets too * [OpenCV2] re-enable parallel build also with CUDA * [OpenCV2] improve compatibility with CUDA 10+ * [OpenCV2] fix broken CUDA targets * [darknet] enable opencv2 feature * skip from building, like opencv3, to avoid problems in CI
This commit is contained in:
parent
305785ba9b
commit
7a0c97b6b3
@ -19,6 +19,14 @@ Feature: opencv-cuda
|
||||
Build-Depends: opencv[ffmpeg], opencv[cuda]
|
||||
Description: Build darknet with support for a CUDA-enabled OpenCV
|
||||
|
||||
Feature: opencv2-base
|
||||
Build-Depends: opencv2[ffmpeg]
|
||||
Description: Build darknet with support for OpenCV3
|
||||
|
||||
Feature: opencv2-cuda
|
||||
Build-Depends: opencv2[ffmpeg], opencv2[cuda]
|
||||
Description: Build darknet with support for a CUDA-enabled OpenCV3
|
||||
|
||||
Feature: opencv3-base
|
||||
Build-Depends: opencv3[ffmpeg]
|
||||
Description: Build darknet with support for OpenCV3
|
||||
|
@ -17,6 +17,9 @@ set(ENABLE_OPENCV OFF)
|
||||
if("opencv-base" IN_LIST FEATURES)
|
||||
set(ENABLE_OPENCV ON)
|
||||
endif()
|
||||
if("opencv2-base" IN_LIST FEATURES)
|
||||
set(ENABLE_OPENCV ON)
|
||||
endif()
|
||||
if("opencv3-base" IN_LIST FEATURES)
|
||||
set(ENABLE_OPENCV ON)
|
||||
endif()
|
||||
@ -27,6 +30,9 @@ endif()
|
||||
if("opencv-cuda" IN_LIST FEATURES)
|
||||
set(ENABLE_OPENCV ON)
|
||||
endif()
|
||||
if("opencv2-cuda" IN_LIST FEATURES)
|
||||
set(ENABLE_OPENCV ON)
|
||||
endif()
|
||||
if("opencv3-cuda" IN_LIST FEATURES)
|
||||
set(ENABLE_OPENCV ON)
|
||||
endif()
|
||||
|
359
ports/opencv2/0002-install-options.patch
Normal file
359
ports/opencv2/0002-install-options.patch
Normal file
@ -0,0 +1,359 @@
|
||||
diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt
|
||||
index b0e076f..3f7ade1 100644
|
||||
--- a/3rdparty/libtiff/CMakeLists.txt
|
||||
+++ b/3rdparty/libtiff/CMakeLists.txt
|
||||
@@ -102,7 +102,7 @@ if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
|
||||
endif()
|
||||
|
||||
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
|
||||
-target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES})
|
||||
+target_link_libraries(${TIFF_LIBRARY} ZLIB::ZLIB)
|
||||
|
||||
set_target_properties(${TIFF_LIBRARY}
|
||||
PROPERTIES
|
||||
diff --git a/3rdparty/openexr/CMakeLists.txt b/3rdparty/openexr/CMakeLists.txt
|
||||
index 9387616..54ecc1a 100644
|
||||
--- a/3rdparty/openexr/CMakeLists.txt
|
||||
+++ b/3rdparty/openexr/CMakeLists.txt
|
||||
@@ -55,7 +55,7 @@ if(MSVC AND CV_ICC)
|
||||
endif()
|
||||
|
||||
add_library(IlmImf STATIC ${lib_hdrs} ${lib_srcs})
|
||||
-target_link_libraries(IlmImf ${ZLIB_LIBRARIES})
|
||||
+target_link_libraries(IlmImf ZLIB::ZLIB)
|
||||
|
||||
set_target_properties(IlmImf
|
||||
PROPERTIES
|
||||
diff --git a/3rdparty/tbb/CMakeLists.txt b/3rdparty/tbb/CMakeLists.txt
|
||||
index fd8ef32..fe571a2 100644
|
||||
--- a/3rdparty/tbb/CMakeLists.txt
|
||||
+++ b/3rdparty/tbb/CMakeLists.txt
|
||||
@@ -116,7 +116,7 @@ endif()
|
||||
|
||||
if(NOT EXISTS "${tbb_tarball}")
|
||||
message(STATUS "Downloading ${tbb_ver}_src.tgz")
|
||||
- file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
|
||||
+ message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${tbb_url}\"\n FILENAME \"${tbb_tarball}\"\n SHA512 0\n )")
|
||||
if(NOT __statvar EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}")
|
||||
endif()
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 90e16c2..6601820 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -275,23 +275,10 @@ if (ANDROID)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED OPENCV_DOC_INSTALL_PATH)
|
||||
- if(ANDROID OR WIN32)
|
||||
- set(OPENCV_DOC_INSTALL_PATH doc)
|
||||
- elseif(INSTALL_TO_MANGLED_PATHS)
|
||||
- set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
|
||||
- else()
|
||||
- set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
|
||||
- endif()
|
||||
+ set(OPENCV_DOC_INSTALL_PATH share/opencv/doc)
|
||||
endif()
|
||||
|
||||
-if(WIN32)
|
||||
- if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
|
||||
- set(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
|
||||
- else()
|
||||
- message(STATUS "Can't detect runtime and/or arch")
|
||||
- set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||
- endif()
|
||||
-elseif(ANDROID)
|
||||
+if(ANDROID)
|
||||
set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
|
||||
else()
|
||||
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||
@@ -322,29 +309,13 @@ if(ANDROID)
|
||||
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||
else()
|
||||
- set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||
- set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||
- if(WIN32)
|
||||
- if(OpenCV_STATIC)
|
||||
- set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||
- else()
|
||||
- set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
|
||||
- endif()
|
||||
- set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||
- set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||
- else()
|
||||
- set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
||||
- set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
||||
- set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
||||
- endif()
|
||||
- set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||
-
|
||||
- math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
- if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX)
|
||||
- set(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv)
|
||||
- else()
|
||||
- set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV)
|
||||
- endif()
|
||||
+ set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||
+ set(3P_LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}")
|
||||
+ set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib")
|
||||
+ set(OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
|
||||
+ set(OPENCV_SAMPLES_SRC_INSTALL_PATH "share/opencv/samples")
|
||||
+ set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||
+ set(OPENCV_CONFIG_INSTALL_PATH "share/opencv")
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
@@ -356,7 +327,7 @@ endif()
|
||||
|
||||
if(WIN32)
|
||||
# Postfix of DLLs:
|
||||
- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
|
||||
+ set(OPENCV_DLLVERSION "")
|
||||
set(OPENCV_DEBUG_POSTFIX d)
|
||||
else()
|
||||
# Postfix of so's:
|
||||
@@ -397,8 +368,6 @@ if(CMAKE_HOST_WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
|
||||
-mark_as_advanced(GIT_EXECUTABLE)
|
||||
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
|
||||
@@ -501,7 +470,6 @@ if(BUILD_DOCS)
|
||||
endif(BUILD_DOCS)
|
||||
|
||||
# --- Python Support ---
|
||||
-include(cmake/OpenCVDetectPython.cmake)
|
||||
|
||||
# --- Java Support ---
|
||||
include(cmake/OpenCVDetectApacheAnt.cmake)
|
||||
@@ -885,11 +853,7 @@ if(ANDROID)
|
||||
endif()
|
||||
|
||||
if(DEFINED WITH_FFMPEG OR HAVE_FFMPEG)
|
||||
- if(WIN32)
|
||||
- status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO)
|
||||
- else()
|
||||
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
|
||||
- endif()
|
||||
status(" avcodec:" FFMPEG_libavcodec_FOUND THEN "YES (ver ${FFMPEG_libavcodec_VERSION})" ELSE NO)
|
||||
status(" avformat:" FFMPEG_libavformat_FOUND THEN "YES (ver ${FFMPEG_libavformat_VERSION})" ELSE NO)
|
||||
status(" avutil:" FFMPEG_libavutil_FOUND THEN "YES (ver ${FFMPEG_libavutil_VERSION})" ELSE NO)
|
||||
diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
|
||||
index e61059a..ec6f34f 100644
|
||||
--- a/cmake/OpenCVCompilerOptions.cmake
|
||||
+++ b/cmake/OpenCVCompilerOptions.cmake
|
||||
@@ -269,7 +269,6 @@ if(MSVC)
|
||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /bigobj")
|
||||
endif()
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi")
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSE4_1 AND CV_ICC AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
|
||||
diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake
|
||||
index 146043f..1202225 100644
|
||||
--- a/cmake/OpenCVFindLibsVideo.cmake
|
||||
+++ b/cmake/OpenCVFindLibsVideo.cmake
|
||||
@@ -185,12 +185,8 @@ endif(WITH_XIMEA)
|
||||
# --- FFMPEG ---
|
||||
ocv_clear_vars(HAVE_FFMPEG)
|
||||
if(WITH_FFMPEG)
|
||||
- if(WIN32 AND NOT ARM)
|
||||
- include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
|
||||
+ find_package(FFMPEG REQUIRED)
|
||||
set(HAVE_FFMPEG TRUE)
|
||||
- elseif(PKG_CONFIG_FOUND)
|
||||
- ocv_check_modules(FFMPEG libavcodec libavformat libavutil libswscale)
|
||||
- ocv_check_modules(FFMPEG_libavresample libavresample)
|
||||
if(FFMPEG_libavresample_FOUND)
|
||||
ocv_append_build_options(FFMPEG FFMPEG_libavresample)
|
||||
endif()
|
||||
@@ -211,9 +207,6 @@ if(WITH_FFMPEG)
|
||||
ocv_append_build_options(HIGHGUI FFMPEG)
|
||||
endif()
|
||||
endif()
|
||||
- else()
|
||||
- message(STATUS "Can't find ffmpeg - 'pkg-config' utility is missing")
|
||||
- endif()
|
||||
endif(WITH_FFMPEG)
|
||||
|
||||
# --- VideoInput/DirectShow ---
|
||||
diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake
|
||||
index dacfbb1..3760866 100644
|
||||
--- a/cmake/OpenCVGenConfig.cmake
|
||||
+++ b/cmake/OpenCVGenConfig.cmake
|
||||
@@ -101,7 +101,7 @@ endif()
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
|
||||
|
||||
-if(UNIX) # ANDROID configuration is created here also
|
||||
+if(1) # ANDROID configuration is created here also
|
||||
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
||||
# For a command "find_package(<name> [major[.minor]] [EXACT] [REQUIRED|QUIET])"
|
||||
# cmake will look in the following dir on unix:
|
||||
@@ -126,7 +126,7 @@ endif()
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
|
||||
# --------------------------------------------------------------------------------------------
|
||||
-if(WIN32)
|
||||
+if(0)
|
||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/include\" \"\${OpenCV_CONFIG_PATH}/include/opencv\"")
|
||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
||||
|
||||
diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
|
||||
index 6f9fb0b..56f8879 100644
|
||||
--- a/cmake/OpenCVModule.cmake
|
||||
+++ b/cmake/OpenCVModule.cmake
|
||||
@@ -86,10 +86,10 @@ macro(ocv_add_dependencies full_modname)
|
||||
endforeach()
|
||||
unset(__depsvar)
|
||||
|
||||
- ocv_list_unique(OPENCV_MODULE_${full_modname}_REQ_DEPS)
|
||||
- ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS)
|
||||
- ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS)
|
||||
- ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS)
|
||||
+ #ocv_list_unique(OPENCV_MODULE_${full_modname}_REQ_DEPS)
|
||||
+ #ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS)
|
||||
+ #ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS)
|
||||
+ #ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS)
|
||||
|
||||
set(OPENCV_MODULE_${full_modname}_REQ_DEPS ${OPENCV_MODULE_${full_modname}_REQ_DEPS}
|
||||
CACHE INTERNAL "Required dependencies of ${full_modname} module")
|
||||
@@ -277,7 +277,7 @@ endfunction()
|
||||
|
||||
# sort modules by dependencies
|
||||
function(__ocv_sort_modules_by_deps __lst)
|
||||
- ocv_list_sort(${__lst})
|
||||
+ #ocv_list_sort(${__lst})
|
||||
set(${__lst}_ORDERED ${${__lst}} CACHE INTERNAL "")
|
||||
set(__result "")
|
||||
foreach (m ${${__lst}})
|
||||
@@ -382,7 +382,7 @@ function(__ocv_resolve_dependencies)
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
- ocv_list_sort(OPENCV_MODULES_BUILD)
|
||||
+ #ocv_list_sort(OPENCV_MODULES_BUILD)
|
||||
|
||||
foreach(m ${OPENCV_MODULES_BUILD})
|
||||
# message(STATUS "FULL deps of ${m}: ${deps_${m}}")
|
||||
@@ -397,7 +397,7 @@ function(__ocv_resolve_dependencies)
|
||||
# reorder dependencies
|
||||
foreach(m ${OPENCV_MODULES_BUILD})
|
||||
__ocv_sort_modules_by_deps(OPENCV_MODULE_${m}_DEPS)
|
||||
- ocv_list_sort(OPENCV_MODULE_${m}_DEPS_EXT)
|
||||
+ #ocv_list_sort(OPENCV_MODULE_${m}_DEPS_EXT)
|
||||
|
||||
set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module")
|
||||
set(OPENCV_MODULE_${m}_DEPS_EXT ${OPENCV_MODULE_${m}_DEPS_EXT} CACHE INTERNAL "Extra dependencies of ${m} module")
|
||||
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
|
||||
index e3177bd..f902b2b 100644
|
||||
--- a/data/CMakeLists.txt
|
||||
+++ b/data/CMakeLists.txt
|
||||
@@ -5,8 +5,6 @@ if(ANDROID)
|
||||
install(FILES ${HAAR_CASCADES} DESTINATION sdk/etc/haarcascades COMPONENT libs)
|
||||
install(FILES ${LBP_CASCADES} DESTINATION sdk/etc/lbpcascades COMPONENT libs)
|
||||
else()
|
||||
- install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
|
||||
- install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs)
|
||||
endif()
|
||||
|
||||
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
|
||||
@@ -51,4 +49,4 @@ if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
|
||||
install(FILES ${DATAFILES_CASCADES} DESTINATION share/OpenCV/testdata/data/haarcascades COMPONENT tests)
|
||||
endif()
|
||||
endif()
|
||||
-endif()
|
||||
\ No newline at end of file
|
||||
+endif()
|
||||
diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt
|
||||
index d9de52d..be604dc 100644
|
||||
--- a/modules/core/CMakeLists.txt
|
||||
+++ b/modules/core/CMakeLists.txt
|
||||
@@ -1,9 +1,9 @@
|
||||
set(the_description "The Core Functionality")
|
||||
|
||||
if (NOT HAVE_CUDA OR ENABLE_DYNAMIC_CUDA)
|
||||
- ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES})
|
||||
+ ocv_add_module(core PRIVATE_REQUIRED ZLIB::ZLIB)
|
||||
else()
|
||||
- ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
+ ocv_add_module(core PRIVATE_REQUIRED ZLIB::ZLIB ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
endif()
|
||||
|
||||
ocv_module_include_directories("${OpenCV_SOURCE_DIR}/modules/dynamicuda/include/" ${ZLIB_INCLUDE_DIR})
|
||||
diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt
|
||||
index d59e95a..ce7f87b 100644
|
||||
--- a/modules/highgui/CMakeLists.txt
|
||||
+++ b/modules/highgui/CMakeLists.txt
|
||||
@@ -15,23 +15,23 @@ endif()
|
||||
|
||||
if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR)
|
||||
ocv_include_directories(${ZLIB_INCLUDE_DIR})
|
||||
- list(APPEND GRFMT_LIBS ${ZLIB_LIBRARIES})
|
||||
+ list(APPEND GRFMT_LIBS ZLIB::ZLIB)
|
||||
endif()
|
||||
|
||||
if(HAVE_JPEG)
|
||||
ocv_include_directories(${JPEG_INCLUDE_DIR})
|
||||
- list(APPEND GRFMT_LIBS ${JPEG_LIBRARIES})
|
||||
+ list(APPEND GRFMT_LIBS JPEG::JPEG)
|
||||
endif()
|
||||
|
||||
if(HAVE_PNG)
|
||||
add_definitions(${PNG_DEFINITIONS})
|
||||
ocv_include_directories(${PNG_INCLUDE_DIR})
|
||||
- list(APPEND GRFMT_LIBS ${PNG_LIBRARIES})
|
||||
+ list(APPEND GRFMT_LIBS PNG::PNG)
|
||||
endif()
|
||||
|
||||
if(HAVE_TIFF)
|
||||
ocv_include_directories(${TIFF_INCLUDE_DIR})
|
||||
- list(APPEND GRFMT_LIBS ${TIFF_LIBRARIES})
|
||||
+ list(APPEND GRFMT_LIBS TIFF::TIFF)
|
||||
endif()
|
||||
|
||||
if(HAVE_JASPER)
|
||||
@@ -296,38 +296,5 @@ endif()
|
||||
ocv_add_precompiled_headers(${the_module})
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations -Wno-clobbered)
|
||||
|
||||
-if(WIN32 AND WITH_FFMPEG)
|
||||
- #copy ffmpeg dll to the output folder
|
||||
- if(MSVC64 OR MINGW64)
|
||||
- set(FFMPEG_SUFFIX _64)
|
||||
- endif()
|
||||
-
|
||||
- set(ffmpeg_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
|
||||
- set(ffmpeg_bare_name_ver "opencv_ffmpeg${OPENCV_DLLVERSION}${FFMPEG_SUFFIX}.dll")
|
||||
- set(ffmpeg_path "${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/${ffmpeg_bare_name}")
|
||||
-
|
||||
- #if(MSVC AND CMAKE_VERSION VERSION_GREATER "2.8.2")
|
||||
- # add_custom_command(TARGET ${the_module} POST_BUILD
|
||||
- # COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/$<CONFIGURATION>/${ffmpeg_bare_name_ver}"
|
||||
- # COMMENT "Copying ${ffmpeg_path} to the output directory")
|
||||
- #else
|
||||
- if(MSVC_IDE)
|
||||
- add_custom_command(TARGET ${the_module} POST_BUILD
|
||||
- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Release/${ffmpeg_bare_name_ver}"
|
||||
- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Debug/${ffmpeg_bare_name_ver}"
|
||||
- COMMENT "Copying ${ffmpeg_path} to the output directory")
|
||||
- elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Visual"))
|
||||
- add_custom_command(TARGET ${the_module} POST_BUILD
|
||||
- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${ffmpeg_bare_name_ver}"
|
||||
- COMMENT "Copying ${ffmpeg_path} to the output directory")
|
||||
- else()
|
||||
- add_custom_command(TARGET ${the_module} POST_BUILD
|
||||
- COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${ffmpeg_bare_name_ver}"
|
||||
- COMMENT "Copying ${ffmpeg_path} to the output directory")
|
||||
- endif()
|
||||
-
|
||||
- install(FILES "${ffmpeg_path}" DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs RENAME "${ffmpeg_bare_name_ver}")
|
||||
-endif()
|
||||
-
|
||||
ocv_add_accuracy_tests()
|
||||
ocv_add_perf_tests()
|
58
ports/opencv2/0003-force-package-requirements.patch
Normal file
58
ports/opencv2/0003-force-package-requirements.patch
Normal file
@ -0,0 +1,58 @@
|
||||
diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
|
||||
index 43c3b16..9b43066 100644
|
||||
--- a/cmake/OpenCVFindLibsGrfmt.cmake
|
||||
+++ b/cmake/OpenCVFindLibsGrfmt.cmake
|
||||
@@ -6,7 +6,7 @@
|
||||
if(BUILD_ZLIB)
|
||||
ocv_clear_vars(ZLIB_FOUND)
|
||||
else()
|
||||
- include(FindZLIB)
|
||||
+ find_package(ZLIB REQUIRED)
|
||||
if(ZLIB_FOUND AND ANDROID)
|
||||
if(ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so" OR
|
||||
ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib64/libz.so")
|
||||
@@ -32,7 +32,7 @@ if(WITH_TIFF)
|
||||
if(BUILD_TIFF)
|
||||
ocv_clear_vars(TIFF_FOUND)
|
||||
else()
|
||||
- include(FindTIFF)
|
||||
+ find_package(TIFF REQUIRED)
|
||||
if(TIFF_FOUND)
|
||||
ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
||||
endif()
|
||||
@@ -74,7 +74,7 @@ if(WITH_JPEG)
|
||||
if(BUILD_JPEG)
|
||||
ocv_clear_vars(JPEG_FOUND)
|
||||
else()
|
||||
- include(FindJPEG)
|
||||
+ find_package(JPEG REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT JPEG_FOUND)
|
||||
@@ -95,7 +95,7 @@ if(WITH_JASPER)
|
||||
if(BUILD_JASPER)
|
||||
ocv_clear_vars(JASPER_FOUND)
|
||||
else()
|
||||
- include(FindJasper)
|
||||
+ find_package(Jasper REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT JASPER_FOUND)
|
||||
@@ -119,7 +119,7 @@ if(WITH_PNG)
|
||||
if(BUILD_PNG)
|
||||
ocv_clear_vars(PNG_FOUND)
|
||||
else()
|
||||
- include(FindPNG)
|
||||
+ find_package(PNG REQUIRED)
|
||||
if(PNG_FOUND)
|
||||
include(CheckIncludeFile)
|
||||
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
|
||||
@@ -151,7 +151,7 @@ if(WITH_OPENEXR)
|
||||
if(BUILD_OPENEXR)
|
||||
ocv_clear_vars(OPENEXR_FOUND)
|
||||
else()
|
||||
- include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
|
||||
+ find_package(OpenEXR REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT OPENEXR_FOUND)
|
12
ports/opencv2/0004-add-ffmpeg-missing-defines.patch
Normal file
12
ports/opencv2/0004-add-ffmpeg-missing-defines.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/modules/highgui/src/cap_ffmpeg_impl.hpp
|
||||
+++ b/modules/highgui/src/cap_ffmpeg_impl.hpp
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
#define HAVE_FFMPEG_SWSCALE
|
||||
#define HAVE_GENTOO_FFMPEG
|
||||
+#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
|
||||
+#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
|
||||
+#define AVFMT_RAWPICTURE 0x0020
|
||||
|
||||
#include "cap_ffmpeg_api.hpp"
|
||||
#include <assert.h>
|
138
ports/opencv2/0005-fix-cuda.patch
Normal file
138
ports/opencv2/0005-fix-cuda.patch
Normal file
@ -0,0 +1,138 @@
|
||||
--- a/cmake/OpenCVDetectCUDA.cmake
|
||||
+++ b/cmake/OpenCVDetectCUDA.cmake
|
||||
@@ -51,7 +51,7 @@ if(CUDA_FOUND)
|
||||
|
||||
message(STATUS "CUDA detected: " ${CUDA_VERSION})
|
||||
|
||||
- set(_generations "Fermi" "Kepler")
|
||||
+ set(_generations "Kepler" "Maxwell")
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
list(APPEND _generations "Auto")
|
||||
endif()
|
||||
@@ -70,14 +70,10 @@ if(CUDA_FOUND)
|
||||
endif()
|
||||
|
||||
set(__cuda_arch_ptx "")
|
||||
- if(CUDA_GENERATION STREQUAL "Fermi")
|
||||
- set(__cuda_arch_bin "2.0 2.1(2.0)")
|
||||
- elseif(CUDA_GENERATION STREQUAL "Kepler")
|
||||
- if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||
- set(__cuda_arch_bin "3.0")
|
||||
- else()
|
||||
- set(__cuda_arch_bin "3.0 3.5")
|
||||
- endif()
|
||||
+ if(CUDA_GENERATION STREQUAL "Kepler")
|
||||
+ set(__cuda_arch_bin "3.0 3.5 3.7")
|
||||
+ elseif(CUDA_GENERATION STREQUAL "Maxwell")
|
||||
+ set(__cuda_arch_bin "5.0 5.2")
|
||||
elseif(CUDA_GENERATION STREQUAL "Auto")
|
||||
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
|
||||
@@ -87,7 +83,6 @@ if(CUDA_FOUND)
|
||||
message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
|
||||
else()
|
||||
set(__cuda_arch_bin "${_nvcc_out}")
|
||||
- string(REPLACE "2.1" "2.1(2.0)" __cuda_arch_bin "${__cuda_arch_bin}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -102,11 +97,11 @@ if(CUDA_FOUND)
|
||||
endif()
|
||||
else()
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||
- set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
||||
+ set(__cuda_arch_bin "3.0")
|
||||
elseif(${CUDA_VERSION} VERSION_GREATER "6.5")
|
||||
- set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5")
|
||||
+ set(__cuda_arch_bin "3.0 3.5")
|
||||
else()
|
||||
- set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
||||
+ set(__cuda_arch_bin "3.0 3.5")
|
||||
endif()
|
||||
set(__cuda_arch_ptx "3.0")
|
||||
endif()
|
||||
diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in
|
||||
index fe85571..0f9d2f5 100644
|
||||
--- a/cmake/templates/OpenCVConfig.cmake.in
|
||||
+++ b/cmake/templates/OpenCVConfig.cmake.in
|
||||
@@ -256,7 +256,7 @@ if(OpenCV_CUDA_VERSION)
|
||||
|
||||
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
||||
|
||||
- if(${CUDA_VERSION} VERSION_LESS "5.5")
|
||||
+ if(CUDA_VERSION VERSION_LESS "5.5")
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
||||
else()
|
||||
find_cuda_helper_libs(nppc)
|
||||
@@ -281,14 +281,16 @@ if(OpenCV_CUDA_VERSION)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
|
||||
endif()
|
||||
|
||||
+ set(OpenCV_CUDA_LIBS_RELPATH "")
|
||||
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
||||
- get_filename_component(_tmp "${l}" NAME_WE)
|
||||
- string(REGEX REPLACE "^lib" "" _tmp "${_tmp}")
|
||||
- if(NOT TARGET "opencv_dep_${_tmp}") # protect against repeated inclusions
|
||||
- add_library("opencv_dep_${_tmp}" UNKNOWN IMPORTED)
|
||||
- set_target_properties("opencv_dep_${_tmp}" PROPERTIES IMPORTED_LOCATION "${l}")
|
||||
+ get_filename_component(_tmp ${l} PATH)
|
||||
+ if(NOT ${_tmp} MATCHES "-Wl.*")
|
||||
+ list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
|
||||
endif()
|
||||
endforeach()
|
||||
+
|
||||
+ list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)
|
||||
+ link_directories(${OpenCV_CUDA_LIBS_RELPATH})
|
||||
endif()
|
||||
|
||||
# ==============================================================
|
||||
diff --git a/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake
|
||||
index 30b5093..50dcdc9 100644
|
||||
--- a/cmake/OpenCVDetectCUDA.cmake
|
||||
+++ b/cmake/OpenCVDetectCUDA.cmake
|
||||
@@ -229,18 +229,40 @@ else()
|
||||
endif()
|
||||
|
||||
if(HAVE_CUDA)
|
||||
+ set(CUDA_LIBS_PATH "")
|
||||
+ foreach(p ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
+ get_filename_component(_tmp ${p} PATH)
|
||||
+ list(APPEND CUDA_LIBS_PATH ${_tmp})
|
||||
+ endforeach()
|
||||
+
|
||||
+ if(HAVE_CUBLAS)
|
||||
+ foreach(p ${CUDA_cublas_LIBRARY})
|
||||
+ get_filename_component(_tmp ${p} PATH)
|
||||
+ list(APPEND CUDA_LIBS_PATH ${_tmp})
|
||||
+ endforeach()
|
||||
+ endif()
|
||||
+
|
||||
+ if(HAVE_CUFFT)
|
||||
+ foreach(p ${CUDA_cufft_LIBRARY})
|
||||
+ get_filename_component(_tmp ${p} PATH)
|
||||
+ list(APPEND CUDA_LIBS_PATH ${_tmp})
|
||||
+ endforeach()
|
||||
+ endif()
|
||||
+
|
||||
+ list(REMOVE_DUPLICATES CUDA_LIBS_PATH)
|
||||
+ link_directories(${CUDA_LIBS_PATH})
|
||||
+
|
||||
set(CUDA_LIBRARIES_ABS ${CUDA_LIBRARIES})
|
||||
- ocv_create_imported_targets(CUDA_LIBRARIES ${CUDA_LIBRARIES})
|
||||
+ ocv_convert_to_lib_name(CUDA_LIBRARIES ${CUDA_LIBRARIES})
|
||||
set(CUDA_npp_LIBRARY_ABS ${CUDA_npp_LIBRARY})
|
||||
- ocv_create_imported_targets(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
|
||||
-
|
||||
+ ocv_convert_to_lib_name(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
|
||||
if(HAVE_CUBLAS)
|
||||
set(CUDA_cublas_LIBRARY_ABS ${CUDA_cublas_LIBRARY})
|
||||
- ocv_create_imported_targets(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
|
||||
+ ocv_convert_to_lib_name(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(HAVE_CUFFT)
|
||||
set(CUDA_cufft_LIBRARY_ABS ${CUDA_cufft_LIBRARY})
|
||||
- ocv_create_imported_targets(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
|
||||
+ ocv_convert_to_lib_name(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
|
||||
endif()
|
||||
endif()
|
52
ports/opencv2/CONTROL
Normal file
52
ports/opencv2/CONTROL
Normal file
@ -0,0 +1,52 @@
|
||||
Source: opencv2
|
||||
Version: 2.4.13.7
|
||||
Build-Depends: zlib
|
||||
Description: computer vision library, version 2
|
||||
Default-Features: eigen, jpeg, opengl, 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
|
||||
Description: Qt GUI support for opencv
|
||||
|
||||
Feature: tiff
|
||||
Build-Depends: tiff
|
||||
Description: TIFF support for opencv
|
||||
|
||||
Feature: vtk
|
||||
Build-Depends: vtk
|
||||
Description: vtk support for opencv
|
||||
|
||||
Feature: world
|
||||
Description: Compile to a single package support for opencv
|
131
ports/opencv2/portfile.cmake
Normal file
131
ports/opencv2/portfile.cmake
Normal file
@ -0,0 +1,131 @@
|
||||
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv3")
|
||||
message(FATAL_ERROR "OpenCV 3 is installed, please uninstall and try again:\n vcpkg remove opencv3")
|
||||
endif()
|
||||
|
||||
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4")
|
||||
message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4")
|
||||
endif()
|
||||
|
||||
if (VCPKG_TARGET_IS_UWP)
|
||||
# - opengl feature is broken on UWP
|
||||
# - jasper and openexr are not available on UWP due to missing dependencies
|
||||
# - opencv2 code itself fails even if previous conditions are avoided
|
||||
message(FATAL_ERROR "${PORT} doesn't support UWP")
|
||||
endif()
|
||||
|
||||
set(OPENCV_VERSION "2.4.13.7")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO opencv/opencv
|
||||
REF ${OPENCV_VERSION}
|
||||
SHA512 de7d24ac7ed78ac14673011cbecc477cae688b74222a972e553c95a557b5cb8e5913f97db525421d6a72af30998ca300112fa0b285daed65f65832eb2cf7241a
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0002-install-options.patch
|
||||
0003-force-package-requirements.patch
|
||||
0004-add-ffmpeg-missing-defines.patch
|
||||
0005-fix-cuda.patch
|
||||
)
|
||||
|
||||
file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
"cuda" WITH_CUDA
|
||||
"cuda" WITH_CUBLAS
|
||||
"eigen" WITH_EIGEN
|
||||
"ffmpeg" WITH_FFMPEG
|
||||
"jasper" WITH_JASPER
|
||||
"jpeg" WITH_JPEG
|
||||
"openexr" WITH_OPENEXR
|
||||
"opengl" WITH_OPENGL
|
||||
"png" WITH_PNG
|
||||
"qt" WITH_QT
|
||||
"tiff" WITH_TIFF
|
||||
"world" BUILD_opencv_world
|
||||
)
|
||||
|
||||
set(WITH_VTK OFF)
|
||||
if("vtk" IN_LIST FEATURES)
|
||||
set(WITH_VTK ON)
|
||||
endif()
|
||||
|
||||
set(WITH_MSMF ON)
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
|
||||
set(WITH_MSMF OFF)
|
||||
endif()
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
if (WITH_VTK)
|
||||
message(WARNING "VTK is currently unsupported in this build configuration, turning it off")
|
||||
set(WITH_VTK OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("ffmpeg" IN_LIST FEATURES)
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}")
|
||||
set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
PREFER_NINJA
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
###### ocv_options
|
||||
-DCMAKE_DEBUG_POSTFIX=d
|
||||
# Do not build docs/examples
|
||||
-DBUILD_DOCS=OFF
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
###### Disable build 3rd party libs
|
||||
-DBUILD_JASPER=OFF
|
||||
-DBUILD_JPEG=OFF
|
||||
-DBUILD_OPENEXR=OFF
|
||||
-DBUILD_PNG=OFF
|
||||
-DBUILD_TIFF=OFF
|
||||
-DBUILD_TBB=OFF
|
||||
-DBUILD_ZLIB=OFF
|
||||
###### OpenCV Build components
|
||||
-DBUILD_opencv_apps=OFF
|
||||
-DBUILD_PACKAGE=OFF
|
||||
-DBUILD_PERF_TESTS=OFF
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_WITH_DEBUG_INFO=ON
|
||||
# CMAKE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON
|
||||
###### customized properties
|
||||
## Options from vcpkg_check_features()
|
||||
${FEATURE_OPTIONS}
|
||||
-DWITH_1394=OFF
|
||||
-DWITH_IPP=OFF
|
||||
-DWITH_LAPACK=OFF
|
||||
-DWITH_MSMF=${WITH_MSMF}
|
||||
-DWITH_OPENCLAMDBLAS=OFF
|
||||
-DWITH_OPENMP=OFF
|
||||
-DWITH_ZLIB=ON
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/opencv" TARGET_PATH "share/opencv")
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
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(PNG QUIET)
|
||||
find_package(TIFF QUIET)" OPENCV_MODULES "${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)
|
||||
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(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
@ -1,3 +1,7 @@
|
||||
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv2")
|
||||
message(FATAL_ERROR "OpenCV 2 is installed, please uninstall and try again:\n vcpkg remove opencv2")
|
||||
endif()
|
||||
|
||||
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4")
|
||||
message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4")
|
||||
endif()
|
||||
|
@ -1,3 +1,7 @@
|
||||
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv2")
|
||||
message(FATAL_ERROR "OpenCV 2 is installed, please uninstall and try again:\n vcpkg remove opencv2")
|
||||
endif()
|
||||
|
||||
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv3")
|
||||
message(FATAL_ERROR "OpenCV 3 is installed, please uninstall and try again:\n vcpkg remove opencv3")
|
||||
endif()
|
||||
|
@ -1255,6 +1255,14 @@ opencl:arm-uwp=fail
|
||||
opencl:x64-uwp=fail
|
||||
opencolorio:x64-linux=ignore
|
||||
opencsg:x64-uwp=fail
|
||||
opencv2:arm64-windows = skip
|
||||
opencv2:arm-uwp = skip
|
||||
opencv2:x64-linux = skip
|
||||
opencv2:x64-osx = skip
|
||||
opencv2:x64-uwp = skip
|
||||
opencv2:x64-windows = skip
|
||||
opencv2:x64-windows-static = skip
|
||||
opencv2:x86-windows = skip
|
||||
opencv3:arm64-windows = skip
|
||||
opencv3:arm-uwp = skip
|
||||
opencv3:x64-linux = skip
|
||||
|
Loading…
x
Reference in New Issue
Block a user