2016-10-27 10:23:55 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2016-11-09 06:38:47 +08:00
|
|
|
message(STATUS "Warning: Static building not supported yet. Building dynamic.")
|
|
|
|
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
2016-10-27 10:23:55 +08:00
|
|
|
endif()
|
2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-02-09 15:46:46 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opencv-3.2.0)
|
2016-09-28 06:49:41 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-02-09 15:46:46 +08:00
|
|
|
URLS "https://github.com/opencv/opencv/archive/3.2.0.zip"
|
|
|
|
FILENAME "opencv-3.2.0.zip"
|
|
|
|
SHA512 c6418d2a7654fe9d50611e756778df4c6736f2de76b85773efbf490bb475dd95ec1041fe57a87163ce11a7db44430cd378c8416af3319f979ced92532bf5ebb5
|
2016-09-28 06:49:41 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2016-09-28 06:49:41 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/opencv-installation-options.patch"
|
|
|
|
)
|
2016-10-01 07:48:12 +08:00
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty/libjpeg ${SOURCE_PATH}/3rdparty/libpng ${SOURCE_PATH}/3rdparty/zlib ${SOURCE_PATH}/3rdparty/libtiff)
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
2016-09-28 06:49:41 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_ZLIB=OFF
|
2016-10-01 07:48:12 +08:00
|
|
|
-DBUILD_TIFF=OFF
|
|
|
|
-DBUILD_JPEG=OFF
|
|
|
|
-DBUILD_PNG=OFF
|
2016-09-19 11:50:08 +08:00
|
|
|
-DBUILD_opencv_python2=OFF
|
|
|
|
-DBUILD_opencv_python3=OFF
|
|
|
|
-DBUILD_opencv_apps=OFF
|
|
|
|
-DBUILD_DOCS=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_PACKAGE=OFF
|
2016-09-19 11:50:08 +08:00
|
|
|
-DBUILD_PERF_TESTS=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DBUILD_TESTS=OFF
|
|
|
|
-DBUILD_WITH_DEBUG_INFO=ON
|
2016-09-19 11:50:08 +08:00
|
|
|
-DOpenCV_DISABLE_ARCH_PATH=ON
|
|
|
|
-DWITH_FFMPEG=OFF
|
2016-09-28 06:49:41 +08:00
|
|
|
-DINSTALL_FORCE_UNIX_PATHS=ON
|
|
|
|
-DOPENCV_CONFIG_INSTALL_PATH=share/opencv
|
|
|
|
-DOPENCV_OTHER_INSTALL_PATH=share/opencv
|
|
|
|
-DINSTALL_LICENSE=OFF
|
2016-09-29 03:12:04 +08:00
|
|
|
-DWITH_CUDA=OFF
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DINSTALL_HEADERS=OFF
|
|
|
|
-DINSTALL_OTHER=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2016-09-28 06:49:41 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/opencv/OpenCVModules-debug.cmake OPENCV_DEBUG_MODULE)
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENCV_DEBUG_MODULE "${OPENCV_DEBUG_MODULE}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules-debug.cmake "${OPENCV_DEBUG_MODULE}")
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
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)
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_copy_pdbs()
|