2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-08-20 15:25:43 +08:00
|
|
|
|
2018-11-05 03:24:45 +08:00
|
|
|
set(OPENCV_PORT_VERSION "3.4.3")
|
2018-02-22 22:16:21 +08:00
|
|
|
|
2017-08-20 15:25:43 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO opencv/opencv
|
2018-02-22 08:47:42 +08:00
|
|
|
REF ${OPENCV_PORT_VERSION}
|
2018-11-05 03:24:45 +08:00
|
|
|
SHA512 d653a58eb5e3939b9fdb7438ac35f77cf4385cf72d5d22bfd21722a109e1b3283dbb9407985061b7548114f0d05c9395aac9bb62b4d2bc1f68da770a49987fef
|
2017-08-20 15:25:43 +08:00
|
|
|
HEAD_REF master
|
2018-02-22 08:47:42 +08:00
|
|
|
PATCHES
|
2019-06-18 01:54:44 +08:00
|
|
|
0001-winrt-fixes.patch
|
|
|
|
0002-install-options.patch
|
|
|
|
0003-disable-downloading.patch
|
|
|
|
0004-use-find-package-required.patch
|
|
|
|
0005-remove-custom-protobuf-find-package.patch
|
|
|
|
0006-fix-missing-openjp2.patch
|
2017-08-09 05:26:13 +08:00
|
|
|
)
|
2017-08-20 15:25:43 +08:00
|
|
|
|
2018-03-04 18:31:06 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT)
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH)
|
|
|
|
|
2019-05-22 01:26:14 +08:00
|
|
|
set(BUILD_opencv_world OFF)
|
|
|
|
if("world" IN_LIST FEATURES)
|
|
|
|
set(BUILD_opencv_world ON)
|
|
|
|
endif()
|
|
|
|
|
2018-03-04 18:31:06 +08:00
|
|
|
set(BUILD_opencv_dnn OFF)
|
|
|
|
set(WITH_PROTOBUF OFF)
|
|
|
|
if("dnn" IN_LIST FEATURES)
|
|
|
|
set(BUILD_opencv_dnn ON)
|
|
|
|
set(WITH_PROTOBUF ON)
|
|
|
|
set(PROTOBUF_UPDATE_FILES ON)
|
|
|
|
set(UPDATE_PROTO_FILES ON)
|
|
|
|
vcpkg_download_distfile(TINYDNN_ARCHIVE
|
2018-02-22 08:47:42 +08:00
|
|
|
URLS "https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz"
|
|
|
|
FILENAME "opencv-cache/tiny_dnn/adb1c512e09ca2c7a6faef36f9c53e59-v1.0.0a3.tar.gz"
|
|
|
|
SHA512 5f2c1a161771efa67e85b1fea395953b7744e29f61187ac5a6c54c912fb195b3aef9a5827135c3668bd0eeea5ae04a33cc433e1f6683e2b7955010a2632d168b
|
2018-03-04 18:31:06 +08:00
|
|
|
)
|
|
|
|
endif()
|
2017-03-28 16:44:56 +08:00
|
|
|
|
2018-03-04 18:31:06 +08:00
|
|
|
set(BUILD_opencv_flann OFF)
|
|
|
|
if("flann" IN_LIST FEATURES)
|
|
|
|
set(BUILD_opencv_flann ON)
|
|
|
|
endif()
|
2017-09-23 12:39:20 +08:00
|
|
|
|
2018-03-04 18:31:06 +08:00
|
|
|
set(BUILD_opencv_ovis OFF)
|
|
|
|
if("ovis" IN_LIST FEATURES)
|
|
|
|
set(BUILD_opencv_ovis ON)
|
|
|
|
endif()
|
2018-02-22 08:47:42 +08:00
|
|
|
|
2017-11-02 00:30:07 +08:00
|
|
|
set(BUILD_opencv_sfm OFF)
|
|
|
|
if("sfm" IN_LIST FEATURES)
|
|
|
|
set(BUILD_opencv_sfm ON)
|
2017-11-01 22:08:10 +08:00
|
|
|
endif()
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
set(BUILD_opencv_contrib OFF)
|
|
|
|
if("contrib" IN_LIST FEATURES)
|
|
|
|
set(BUILD_opencv_contrib ON)
|
|
|
|
|
|
|
|
# Used for opencv's face module
|
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
|
|
|
URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat"
|
|
|
|
FILENAME "opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat"
|
|
|
|
SHA512 c16e60a6c4bb4de3ab39b876ae3c3f320ea56f69c93e9303bd2dff8760841dcd71be4161fff8bc71e8fe4fe8747fa8465d49d6bd8f5ebcdaea161f4bc2da7c93
|
|
|
|
)
|
|
|
|
|
2018-03-15 06:30:25 +08:00
|
|
|
vcpkg_download_distfile(TINYDNN_ARCHIVE
|
|
|
|
URLS "https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz"
|
|
|
|
FILENAME "opencv-cache/tiny_dnn/adb1c512e09ca2c7a6faef36f9c53e59-v1.0.0a3.tar.gz"
|
|
|
|
SHA512 5f2c1a161771efa67e85b1fea395953b7744e29f61187ac5a6c54c912fb195b3aef9a5827135c3668bd0eeea5ae04a33cc433e1f6683e2b7955010a2632d168b
|
|
|
|
)
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
function(download_opencv_3rdparty ID COMMIT HASH)
|
|
|
|
if(NOT EXISTS "${DOWNLOADS}/opencv-cache/${ID}/${COMMIT}.stamp")
|
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
|
|
|
URLS "https://github.com/opencv/opencv_3rdparty/archive/${COMMIT}.zip"
|
|
|
|
FILENAME "opencv_3rdparty-${COMMIT}.zip"
|
|
|
|
SHA512 ${HASH}
|
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${OCV_DOWNLOAD})
|
|
|
|
file(MAKE_DIRECTORY "${DOWNLOADS}/opencv-cache/${ID}")
|
|
|
|
file(GLOB XFEATURES2D_I ${CURRENT_BUILDTREES_DIR}/src/opencv_3rdparty-${COMMIT}/*)
|
|
|
|
foreach(FILE ${XFEATURES2D_I})
|
|
|
|
file(COPY ${FILE} DESTINATION "${DOWNLOADS}/opencv-cache/${ID}")
|
|
|
|
get_filename_component(XFEATURES2D_I_NAME "${FILE}" NAME)
|
|
|
|
file(MD5 "${FILE}" FILE_HASH)
|
|
|
|
file(RENAME "${DOWNLOADS}/opencv-cache/${ID}/${XFEATURES2D_I_NAME}" "${DOWNLOADS}/opencv-cache/${ID}/${FILE_HASH}-${XFEATURES2D_I_NAME}")
|
|
|
|
endforeach()
|
|
|
|
file(WRITE "${DOWNLOADS}/opencv-cache/${ID}/${COMMIT}.stamp")
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
# Used for opencv's xfeature2d module
|
|
|
|
download_opencv_3rdparty(
|
|
|
|
xfeatures2d/boostdesc
|
|
|
|
34e4206aef44d50e6bbcd0ab06354b52e7466d26
|
|
|
|
2ccdc8fb59da55eabc73309a80a4d3b1e73e2341027cdcdd2d714e0f519e60f243f38f79b13ed3de32f595aa23e4f86418eed42e741f32a81b1e6e0879190601
|
|
|
|
)
|
|
|
|
|
|
|
|
# Used for opencv's xfeature2d module
|
|
|
|
download_opencv_3rdparty(
|
|
|
|
xfeatures2d/vgg
|
|
|
|
fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d
|
|
|
|
7051f5d6ccb938d296b919dd6d5dcddc5afb527aed456639c9984276a8f64565c084d96a72499a7756f127f8d2b1ce9ab70e4cbb3f89c4e16f82296c2a15daed
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-11-01 22:08:10 +08:00
|
|
|
set(WITH_CUDA OFF)
|
|
|
|
if("cuda" IN_LIST FEATURES)
|
|
|
|
set(WITH_CUDA ON)
|
|
|
|
endif()
|
|
|
|
|
2017-11-02 00:30:07 +08:00
|
|
|
set(WITH_FFMPEG OFF)
|
|
|
|
if("ffmpeg" IN_LIST FEATURES)
|
|
|
|
set(WITH_FFMPEG ON)
|
2018-02-22 08:47:42 +08:00
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
2018-11-22 21:03:35 +08:00
|
|
|
URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8041bd6f5ad37045c258904ba3030bb3442e3911/ffmpeg/opencv_ffmpeg.dll"
|
|
|
|
FILENAME "opencv-cache/ffmpeg/fa5a2a4e2f37defcb95bde8ed145c2b3-opencv_ffmpeg.dll"
|
|
|
|
SHA512 875f922e1d9fc2fe7c8e879ede35b1001b6ad8b3c4d71feb3823421ce861f580df3418c791315b23870fcb0378d297b01e0761d3f65277ff11ec2fef8c0b08b7
|
2018-02-22 08:47:42 +08:00
|
|
|
)
|
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
2018-11-22 21:03:35 +08:00
|
|
|
URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8041bd6f5ad37045c258904ba3030bb3442e3911/ffmpeg/opencv_ffmpeg_64.dll"
|
|
|
|
FILENAME "opencv-cache/ffmpeg/2cc08fc4fef8199fe80e0f126684834f-opencv_ffmpeg_64.dll"
|
|
|
|
SHA512 4e74aa4cb115f103b929f93bbc8dcf675de7d0c7916f8f0a80ac46761134b088634be95f959ce5827753ae9ecb2365ca40440dfbb9a9bf89f22ee11b6c8342b3
|
2018-02-22 08:47:42 +08:00
|
|
|
)
|
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
2018-11-22 21:03:35 +08:00
|
|
|
URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8041bd6f5ad37045c258904ba3030bb3442e3911/ffmpeg/ffmpeg_version.cmake"
|
2018-11-23 06:24:36 +08:00
|
|
|
FILENAME "opencv-cache/ffmpeg/3b90f67f4b429e77d3da36698cef700c-ffmpeg_version.cmake"
|
2018-03-04 18:31:06 +08:00
|
|
|
SHA512 7d0142c30ac6f6260c1bcabc22753030fd25a708477fa28053e8df847c366967d3b93a8ac14af19a2b7b73d9f8241749a431458faf21a0c8efc7d6d99eecfdcf
|
2018-02-22 08:47:42 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(WITH_IPP OFF)
|
|
|
|
if("ipp" IN_LIST FEATURES)
|
|
|
|
set(WITH_IPP ON)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
2018-11-22 21:03:35 +08:00
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
|
|
|
URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/bdb7bb85f34a8cb0d35e40a81f58da431aa1557a/ippicv/ippicv_2017u3_win_intel64_general_20180518.zip"
|
|
|
|
FILENAME "opencv-cache/ippicv/915ff92958089ede8ea532d3c4fe7187-ippicv_2017u3_win_intel64_general_20180518.zip"
|
|
|
|
SHA512 8aa08292d542d521c042864446e47a7a6bdbf3896d86fc7b43255459c24a2e9f34a4e9b177023d178fed7a2e82a9db410f89d81375a542d049785d263f46c64d
|
2018-02-22 08:47:42 +08:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_download_distfile(OCV_DOWNLOAD
|
2018-11-22 21:03:35 +08:00
|
|
|
URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/bdb7bb85f34a8cb0d35e40a81f58da431aa1557a/ippicv/ippicv_2017u3_win_ia32_general_20180518.zip"
|
|
|
|
FILENAME "opencv-cache/ippicv/928168c2d99ab284047dfcfb7a821d91-ippicv_2017u3_win_ia32_general_20180518.zip"
|
|
|
|
SHA512 b89b0fb739152303cafc9fb064fa8b24fd94850697137ccbb5c1e344e0f5094115603a5e3be3a25f85d0faefc5c53429a7d65da0142d012ada41e8db2bcdd6b7
|
2018-02-22 08:47:42 +08:00
|
|
|
)
|
|
|
|
endif()
|
2017-11-02 00:30:07 +08:00
|
|
|
endif()
|
|
|
|
|
2019-02-15 08:26:05 +08:00
|
|
|
set(WITH_TBB OFF)
|
|
|
|
if("tbb" IN_LIST FEATURES)
|
|
|
|
set(WITH_TBB ON)
|
|
|
|
endif()
|
|
|
|
|
2017-11-02 00:07:26 +08:00
|
|
|
set(WITH_QT OFF)
|
|
|
|
if("qt" IN_LIST FEATURES)
|
|
|
|
set(WITH_QT ON)
|
|
|
|
endif()
|
|
|
|
|
2017-11-01 22:08:10 +08:00
|
|
|
set(WITH_VTK OFF)
|
|
|
|
if("vtk" IN_LIST FEATURES)
|
|
|
|
set(WITH_VTK ON)
|
|
|
|
endif()
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
set(WITH_WEBP OFF)
|
|
|
|
if("webp" IN_LIST FEATURES)
|
|
|
|
set(WITH_WEBP ON)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CURRENT_INSTALLED_DIR}/share/libwebp)
|
|
|
|
endif()
|
|
|
|
|
2017-11-11 23:31:38 +08:00
|
|
|
set(WITH_GDCM OFF)
|
|
|
|
if("gdcm" IN_LIST FEATURES)
|
|
|
|
set(WITH_GDCM ON)
|
|
|
|
endif()
|
|
|
|
|
2018-03-04 18:31:06 +08:00
|
|
|
set(WITH_OPENGL OFF)
|
|
|
|
if("opengl" IN_LIST FEATURES)
|
|
|
|
set(WITH_OPENGL ON)
|
|
|
|
endif()
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
set(WITH_OPENEXR OFF)
|
|
|
|
if("openexr" IN_LIST FEATURES)
|
|
|
|
set(WITH_OPENEXR ON)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CURRENT_INSTALLED_DIR}/share/openexr)
|
|
|
|
endif()
|
|
|
|
|
2017-11-04 05:44:11 +08:00
|
|
|
set(WITH_MSMF ON)
|
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
set(WITH_MSMF OFF)
|
|
|
|
endif()
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
set(WITH_TIFF OFF)
|
|
|
|
if("tiff" IN_LIST FEATURES)
|
|
|
|
set(WITH_TIFF ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(WITH_JPEG OFF)
|
|
|
|
if("jpeg" IN_LIST FEATURES)
|
|
|
|
set(WITH_JPEG ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(WITH_JASPER OFF)
|
|
|
|
if("jasper" IN_LIST FEATURES)
|
|
|
|
set(WITH_JASPER ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(WITH_PNG OFF)
|
|
|
|
if("png" IN_LIST FEATURES)
|
|
|
|
set(WITH_PNG ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(WITH_EIGEN OFF)
|
|
|
|
if("eigen" IN_LIST FEATURES)
|
|
|
|
set(WITH_EIGEN ON)
|
|
|
|
endif()
|
|
|
|
|
2018-11-23 10:27:17 +08:00
|
|
|
set(OPENCV_ENABLE_NONFREE OFF)
|
|
|
|
if("nonfree" IN_LIST FEATURES)
|
|
|
|
set(OPENCV_ENABLE_NONFREE ON)
|
|
|
|
endif()
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
if(BUILD_opencv_contrib)
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH CONTRIB_SOURCE_PATH
|
|
|
|
REPO opencv/opencv_contrib
|
|
|
|
REF ${OPENCV_PORT_VERSION}
|
2018-11-05 03:24:45 +08:00
|
|
|
SHA512 456c6f878fb3bd5459f6430405cf05c609431f8d7db743aa699fc75c305d019682ee3a804bf0cf5107597dd1dbbb69b08be3535a0e6c717e4773ed7c05d08e59
|
2018-02-22 08:47:42 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules")
|
|
|
|
endif()
|
|
|
|
|
2018-03-04 18:31:06 +08:00
|
|
|
set(WITH_ZLIB ON)
|
2018-02-06 09:45:10 +08:00
|
|
|
set(BUILD_opencv_line_descriptor ON)
|
|
|
|
set(BUILD_opencv_saliency ON)
|
|
|
|
set(BUILD_opencv_bgsegm ON)
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
|
|
|
|
set(BUILD_opencv_line_descriptor OFF)
|
|
|
|
set(BUILD_opencv_saliency OFF)
|
|
|
|
set(BUILD_opencv_bgsegm OFF)
|
|
|
|
endif()
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
string(REPLACE ";" "\\\\\;" CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}")
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
2018-02-22 08:47:42 +08:00
|
|
|
PREFER_NINJA
|
2016-09-28 06:49:41 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
2017-11-02 00:30:07 +08:00
|
|
|
# Ungrouped Entries
|
|
|
|
-DOpenCV_DISABLE_ARCH_PATH=ON
|
2018-03-04 18:31:06 +08:00
|
|
|
# Do not build docs/examples
|
2016-09-19 11:50:08 +08:00
|
|
|
-DBUILD_DOCS=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DBUILD_EXAMPLES=OFF
|
2018-03-04 18:31:06 +08:00
|
|
|
# Do not build integrated libraries, use external ones whenever possible
|
2018-02-22 08:47:42 +08:00
|
|
|
-DBUILD_JASPER=OFF
|
2017-11-02 00:30:07 +08:00
|
|
|
-DBUILD_JPEG=OFF
|
2018-02-22 08:47:42 +08:00
|
|
|
-DBUILD_OPENEXR=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DBUILD_PACKAGE=OFF
|
2016-09-19 11:50:08 +08:00
|
|
|
-DBUILD_PERF_TESTS=OFF
|
2017-11-02 00:30:07 +08:00
|
|
|
-DBUILD_PNG=OFF
|
|
|
|
-DBUILD_PROTOBUF=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DBUILD_TESTS=OFF
|
2017-11-02 00:30:07 +08:00
|
|
|
-DBUILD_TIFF=OFF
|
2018-02-22 08:47:42 +08:00
|
|
|
-DBUILD_WEBP=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DBUILD_WITH_DEBUG_INFO=ON
|
2017-11-02 00:30:07 +08:00
|
|
|
-DBUILD_WITH_STATIC_CRT=${BUILD_WITH_STATIC_CRT}
|
|
|
|
-DBUILD_ZLIB=OFF
|
2018-03-04 18:31:06 +08:00
|
|
|
# Select which OpenCV modules should be built
|
2017-11-02 00:30:07 +08:00
|
|
|
-DBUILD_opencv_apps=OFF
|
2018-03-04 18:31:06 +08:00
|
|
|
-DBUILD_opencv_bgsegm=${BUILD_opencv_bgsegm}
|
|
|
|
-DBUILD_opencv_dnn=${BUILD_opencv_dnn}
|
|
|
|
-DBUILD_opencv_flann=${BUILD_opencv_flann}
|
|
|
|
-DBUILD_opencv_line_descriptor=${BUILD_opencv_line_descriptor}
|
|
|
|
-DBUILD_opencv_ovis=${BUILD_opencv_ovis}
|
2017-11-01 22:08:10 +08:00
|
|
|
-DBUILD_opencv_python2=OFF
|
|
|
|
-DBUILD_opencv_python3=OFF
|
2018-02-06 09:45:10 +08:00
|
|
|
-DBUILD_opencv_saliency=${BUILD_opencv_saliency}
|
2018-03-04 18:31:06 +08:00
|
|
|
-DBUILD_opencv_sfm=${BUILD_opencv_sfm}
|
2019-05-22 01:26:14 +08:00
|
|
|
-DBUILD_opencv_world=${BUILD_opencv_world}
|
2018-03-04 18:31:06 +08:00
|
|
|
# PROTOBUF
|
|
|
|
-DPROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES}
|
|
|
|
-DUPDATE_PROTO_FILES=${UPDATE_PROTO_FILES}
|
2017-11-02 00:30:07 +08:00
|
|
|
# CMAKE
|
2019-06-19 04:37:48 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
|
2017-11-02 00:30:07 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON
|
2018-02-22 08:47:42 +08:00
|
|
|
"-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}"
|
2017-11-02 00:30:07 +08:00
|
|
|
# ENABLE
|
2017-11-02 22:08:25 +08:00
|
|
|
-DENABLE_CXX11=ON
|
2017-11-02 00:30:07 +08:00
|
|
|
-DENABLE_PYLINT=OFF
|
2019-03-06 01:08:05 +08:00
|
|
|
-DOPENCV_ENABLE_NONFREE=${OPENCV_ENABLE_NONFREE}
|
2017-11-02 00:30:07 +08:00
|
|
|
# INSTALL
|
|
|
|
-DINSTALL_FORCE_UNIX_PATHS=ON
|
|
|
|
-DINSTALL_LICENSE=OFF
|
|
|
|
# OPENCV
|
|
|
|
-DOPENCV_CONFIG_INSTALL_PATH=share/opencv
|
|
|
|
"-DOPENCV_DOWNLOAD_PATH=${DOWNLOADS}/opencv-cache"
|
2018-02-22 08:47:42 +08:00
|
|
|
${BUILD_WITH_CONTRIB_FLAG}
|
2017-11-02 00:30:07 +08:00
|
|
|
-DOPENCV_OTHER_INSTALL_PATH=share/opencv
|
|
|
|
# WITH
|
2019-02-27 11:07:22 +08:00
|
|
|
-DWITH_CUBLAS=${WITH_CUDA}
|
2017-11-01 22:08:10 +08:00
|
|
|
-DWITH_CUDA=${WITH_CUDA}
|
2018-03-04 18:31:06 +08:00
|
|
|
-DWITH_EIGEN=${WITH_EIGEN}
|
2017-11-02 00:30:07 +08:00
|
|
|
-DWITH_FFMPEG=${WITH_FFMPEG}
|
2018-03-04 18:31:06 +08:00
|
|
|
-DWITH_GDCM=${WITH_GDCM}
|
2018-02-22 08:47:42 +08:00
|
|
|
-DWITH_IPP=${WITH_IPP}
|
2018-03-04 18:31:06 +08:00
|
|
|
-DWITH_JASPER=${WITH_JASPER}
|
|
|
|
-DWITH_JPEG=${WITH_JPEG}
|
2017-11-02 00:30:07 +08:00
|
|
|
-DWITH_LAPACK=OFF
|
2018-12-12 01:34:00 +08:00
|
|
|
-DWITH_MATLAB=OFF
|
2017-11-04 05:44:11 +08:00
|
|
|
-DWITH_MSMF=${WITH_MSMF}
|
2017-11-02 00:30:07 +08:00
|
|
|
-DWITH_OPENCLAMDBLAS=OFF
|
2018-03-04 18:31:06 +08:00
|
|
|
-DWITH_OPENEXR=${WITH_OPENEXR}
|
|
|
|
-DWITH_OPENGL=${WITH_OPENGL}
|
|
|
|
-DWITH_PNG=${WITH_PNG}
|
|
|
|
-DWITH_PROTOBUF=${WITH_PROTOBUF}
|
2017-11-02 00:07:26 +08:00
|
|
|
-DWITH_QT=${WITH_QT}
|
2019-02-15 08:26:05 +08:00
|
|
|
-DWITH_TBB=${WITH_TBB}
|
2018-03-04 18:31:06 +08:00
|
|
|
-DWITH_TIFF=${WITH_TIFF}
|
2017-11-01 22:08:10 +08:00
|
|
|
-DWITH_VTK=${WITH_VTK}
|
2018-02-22 08:47:42 +08:00
|
|
|
-DWITH_WEBP=${WITH_WEBP}
|
2018-03-04 18:31:06 +08:00
|
|
|
-DWITH_ZLIB=${WITH_ZLIB}
|
2019-06-18 01:54:44 +08:00
|
|
|
-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DINSTALL_HEADERS=OFF
|
|
|
|
-DINSTALL_OTHER=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2016-09-29 03:12:04 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/opencv)
|
2016-09-28 06:49:41 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/opencv/LICENSE ${CURRENT_PACKAGES_DIR}/share/opencv/copyright)
|
2017-08-09 05:26:13 +08:00
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE)
|
2017-03-28 16:44:56 +08:00
|
|
|
|
2017-09-23 07:51:44 +08:00
|
|
|
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v141")
|
2017-08-16 09:20:28 +08:00
|
|
|
set(OpenCV_RUNTIME vc15)
|
|
|
|
else()
|
|
|
|
set(OpenCV_RUNTIME vc14)
|
|
|
|
endif()
|
2017-09-23 07:51:44 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
2017-08-16 09:20:28 +08:00
|
|
|
set(OpenCV_ARCH x64)
|
2018-02-06 09:45:10 +08:00
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
|
|
|
set(OpenCV_ARCH ARM)
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
|
|
|
set(OpenCV_ARCH ARM64)
|
2017-08-16 09:20:28 +08:00
|
|
|
else()
|
|
|
|
set(OpenCV_ARCH x86)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(GLOB BIN_AND_LIB ${CURRENT_PACKAGES_DIR}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/*)
|
|
|
|
file(COPY ${BIN_AND_LIB} DESTINATION ${CURRENT_PACKAGES_DIR})
|
|
|
|
file(GLOB DEBUG_BIN_AND_LIB ${CURRENT_PACKAGES_DIR}/debug/${OpenCV_ARCH}/${OpenCV_RUNTIME}/*)
|
|
|
|
file(COPY ${DEBUG_BIN_AND_LIB} DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/${OpenCV_ARCH})
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/${OpenCV_ARCH})
|
|
|
|
|
2017-09-23 07:51:44 +08:00
|
|
|
file(GLOB STATICLIB ${CURRENT_PACKAGES_DIR}/staticlib/*)
|
|
|
|
if(STATICLIB)
|
2017-09-23 13:09:39 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib)
|
2017-09-23 07:51:44 +08:00
|
|
|
file(COPY ${STATICLIB} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/staticlib)
|
|
|
|
endif()
|
|
|
|
file(GLOB STATICLIB ${CURRENT_PACKAGES_DIR}/debug/staticlib/*)
|
|
|
|
if(STATICLIB)
|
2017-09-23 13:09:39 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib)
|
2017-09-23 07:51:44 +08:00
|
|
|
file(COPY ${STATICLIB} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/staticlib)
|
|
|
|
endif()
|
2017-08-16 09:20:28 +08:00
|
|
|
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVConfig.cmake OPENCV_CONFIG)
|
2018-02-22 08:47:42 +08:00
|
|
|
string(REPLACE "/staticlib/"
|
|
|
|
"/lib/" OPENCV_CONFIG "${OPENCV_CONFIG}")
|
2017-08-16 09:20:28 +08:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVConfig.cmake "${OPENCV_CONFIG}")
|
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules-release.cmake OPENCV_CONFIG_LIB)
|
2017-09-23 07:51:44 +08:00
|
|
|
string(REPLACE "/staticlib/"
|
|
|
|
"/lib/" OPENCV_CONFIG_LIB "${OPENCV_CONFIG_LIB}")
|
2018-02-22 08:47:42 +08:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules-release.cmake "${OPENCV_CONFIG_LIB}")
|
2017-09-23 07:51:44 +08:00
|
|
|
|
2018-02-22 08:47:42 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/opencv/OpenCVModules-debug.cmake OPENCV_CONFIG_LIB)
|
2017-09-23 07:51:44 +08:00
|
|
|
string(REPLACE "/staticlib/"
|
|
|
|
"/lib/" OPENCV_CONFIG_LIB "${OPENCV_CONFIG_LIB}")
|
|
|
|
string(REPLACE "PREFIX}/lib"
|
|
|
|
"PREFIX}/debug/lib" OPENCV_CONFIG_LIB "${OPENCV_CONFIG_LIB}")
|
|
|
|
string(REPLACE "PREFIX}/bin"
|
|
|
|
"PREFIX}/debug/bin" OPENCV_CONFIG_LIB "${OPENCV_CONFIG_LIB}")
|
2018-02-22 08:47:42 +08:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules-debug.cmake "${OPENCV_CONFIG_LIB}")
|
|
|
|
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/opencv/OpenCVModules.cmake ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake)
|
2017-08-16 09:20:28 +08:00
|
|
|
|
2019-03-31 13:35:10 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES)
|
|
|
|
string(REPLACE "${CURRENT_INSTALLED_DIR}"
|
|
|
|
"\${_VCPKG_INSTALLED_DIR}/\${VCPKG_TARGET_TRIPLET}" OPENCV_MODULES "${OPENCV_MODULES}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")
|
|
|
|
|
2019-05-29 07:58:00 +08:00
|
|
|
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(TIFF REQUIRED)" OPENCV_MODULES "${OPENCV_MODULES}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")
|
|
|
|
endif()
|
|
|
|
|
2017-08-16 09:20:28 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2018-01-20 06:46:52 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/opencv)
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-09-23 13:09:39 +08:00
|
|
|
|
2017-11-26 05:45:33 +08:00
|
|
|
set(VCPKG_LIBRARY_LINKAGE "dynamic")
|
|
|
|
|
|
|
|
set(VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT enabled)
|