2019-08-13 00:22:30 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4" )
message ( FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4" )
endif ( )
include ( vcpkg_common_functions )
2019-08-24 03:48:09 +08:00
set ( OPENCV_VERSION "3.4.7" )
2019-08-13 00:22:30 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O o p e n c v / o p e n c v
2019-08-24 03:48:09 +08:00
R E F $ { O P E N C V _ V E R S I O N }
S H A 5 1 2 b a 1 3 3 6 a d 4 e 5 2 0 8 7 4 8 a a 0 9 c 9 9 7 7 0 3 9 2 c c 7 1 e f 7 2 6 8 8 5 6 0 d 0 b 0 3 2 8 7 d d a f d 3 6 0 9 3 e f 3 0 c b d f 6 4 2 2 f 8 7 f 8 f 8 7 8 6 6 3 a b 8 0 8 5 c c 0 f f 8 a 8 c 6 5 f d 1 f f 0 e c 6 8 0 0 8 5 5 e a 0 1 3 0 9 b e b
2019-08-13 00:22:30 +08:00
H E A D _ R E F m a s t e r
P A T C H E S
2019-08-24 03:48:09 +08:00
0 0 0 1 - d i s a b l e - d o w n l o a d i n g . p a t c h
2019-08-13 00:22:30 +08:00
0 0 0 2 - i n s t a l l - o p t i o n s . p a t c h
2019-08-24 03:48:09 +08:00
0 0 0 3 - f o r c e - p a c k a g e - r e q u i r e m e n t s . p a t c h
0 0 0 9 - f i x - u w p . p a t c h
2019-08-13 00:22:30 +08:00
)
string ( COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT )
2019-08-24 03:48:09 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
" c o n t r i b " W I T H _ C O N T R I B
" c u d a " W I T H _ C U D A
" c u d a " W I T H _ C U B L A S
" d n n " B U I L D _ o p e n c v _ d n n
" e i g e n " W I T H _ E I G E N
" f f m p e g " W I T H _ F F M P E G
" f l a n n " B U I L D _ o p e n c v _ f l a n n
" g d c m " W I T H _ G D C M
" h a l i d e " W I T H _ H A L I D E
" j a s p e r " W I T H _ J A S P E R
" j p e g " W I T H _ J P E G
" n o n f r e e " O P E N C V _ E N A B L E _ N O N F R E E
" o p e n e x r " W I T H _ O P E N E X R
" o p e n g l " W I T H _ O P E N G L
" p n g " W I T H _ P N G
" q t " W I T H _ Q T
" s f m " B U I L D _ o p e n c v _ s f m
" t i f f " W I T H _ T I F F
" w e b p " W I T H _ W E B P
" w o r l d " B U I L D _ o p e n c v _ w o r l d
)
2019-08-13 00:22:30 +08:00
2019-08-24 03:48:09 +08:00
# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk".
# As the respective value of their variables can be unset conditionally.
set ( WITH_IPP OFF )
if ( "ipp" IN_LIST FEATURES )
set ( WITH_IPP ON )
2019-08-13 00:22:30 +08:00
endif ( )
2019-08-24 03:48:09 +08:00
set ( BUILD_opencv_ovis OFF )
if ( "ovis" IN_LIST FEATURES )
set ( BUILD_opencv_ovis ON )
2019-08-13 00:22:30 +08:00
endif ( )
2019-08-24 03:48:09 +08:00
set ( WITH_TBB OFF )
if ( "tbb" IN_LIST FEATURES )
set ( WITH_TBB ON )
2019-08-13 00:22:30 +08:00
endif ( )
2019-08-24 03:48:09 +08:00
set ( WITH_VTK OFF )
if ( "vtk" IN_LIST FEATURES )
set ( WITH_VTK ON )
2019-08-13 00:22:30 +08:00
endif ( )
2019-08-24 03:48:09 +08:00
if ( "dnn" IN_LIST FEATURES )
vcpkg_download_distfile ( TINYDNN_ARCHIVE
U R L S " h t t p s : / / g i t h u b . c o m / t i n y - d n n / t i n y - d n n / a r c h i v e / v 1 . 0 . 0 a 3 . t a r . g z "
F I L E N A M E " o p e n c v - c a c h e / t i n y _ d n n / a d b 1 c 5 1 2 e 0 9 c a 2 c 7 a 6 f a e f 3 6 f 9 c 5 3 e 5 9 - v 1 . 0 . 0 a 3 . t a r . g z "
S H A 5 1 2 5 f 2 c 1 a 1 6 1 7 7 1 e f a 6 7 e 8 5 b 1 f e a 3 9 5 9 5 3 b 7 7 4 4 e 2 9 f 6 1 1 8 7 a c 5 a 6 c 5 4 c 9 1 2 f b 1 9 5 b 3 a e f 9 a 5 8 2 7 1 3 5 c 3 6 6 8 b d 0 e e e a 5 a e 0 4 a 3 3 c c 4 3 3 e 1 f 6 6 8 3 e 2 b 7 9 5 5 0 1 0 a 2 6 3 2 d 1 6 8 b
)
2019-08-13 00:22:30 +08:00
endif ( )
2019-09-25 03:58:38 +08:00
# Build image quality module when building with 'contrib' feature and not UWP.
set ( BUILD_opencv_quality OFF )
2019-08-13 00:22:30 +08:00
if ( "contrib" IN_LIST FEATURES )
2019-09-25 03:58:38 +08:00
if ( VCPKG_TARGET_IS_UWP )
set ( BUILD_opencv_quality OFF )
message ( WARNING "The image quality module (quality) does not build for UWP, the module has been disabled." )
# The hdf module is silently disabled by OpenCVs buildsystem if HDF5 is not detected.
message ( WARNING "The hierarchical data format module (hdf) depends on HDF5 which doesn't support UWP, the module has been disabled." )
else ( )
set ( BUILD_opencv_quality CMAKE_DEPENDS_IN_PROJECT_ONLY )
endif ( )
2019-08-24 03:48:09 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H C O N T R I B _ S O U R C E _ P A T H
R E P O o p e n c v / o p e n c v _ c o n t r i b
R E F $ { O P E N C V _ V E R S I O N }
S H A 5 1 2 9 2 2 6 2 0 f 3 e 8 7 5 4 f c 1 5 d e d f 8 9 9 3 b d c 1 f 0 0 c 0 6 b 6 2 3 c b e e b 7 2 a f b 9 8 4 d d a a d 6 e 0 e 0 4 f 4 6 5 6 1 a 0 e e 4 d 2 0 f 5 e 2 6 0 6 1 6 c 1 f 3 2 c 6 d c 0 d d 7 2 4 8 3 5 5 d 4 1 7 8 7 3 a e 7 2 b d 0 3 c b 5 d 5 7 f d
H E A D _ R E F m a s t e r
)
set ( BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules" )
2019-08-13 00:22:30 +08:00
# Used for opencv's face module
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / 8 a f a 5 7 a b c 8 2 2 9 d 6 1 1 c 4 9 3 7 1 6 5 d 2 0 e 2 a 2 d 9 f c 5 a 1 2 / f a c e _ l a n d m a r k _ m o d e l . d a t "
F I L E N A M E " o p e n c v - c a c h e / d a t a / 7 5 0 5 c 4 4 c a 4 e b 5 4 b 4 a b 1 e 4 7 7 7 c b 9 6 a c 0 5 - f a c e _ l a n d m a r k _ m o d e l . d a t "
S H A 5 1 2 c 1 6 e 6 0 a 6 c 4 b b 4 d e 3 a b 3 9 b 8 7 6 a e 3 c 3 f 3 2 0 e a 5 6 f 6 9 c 9 3 e 9 3 0 3 b d 2 d f f 8 7 6 0 8 4 1 d c d 7 1 b e 4 1 6 1 f f f 8 b c 7 1 e 8 f e 4 f e 8 7 4 7 f a 8 4 6 5 d 4 9 d 6 b d 8 f 5 e b c d a e a 1 6 1 f 4 b c 2 d a 7 c 9 3
)
function ( download_opencv_3rdparty ID COMMIT HASH )
if ( NOT EXISTS "${DOWNLOADS}/opencv-cache/${ID}/${COMMIT}.stamp" )
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / g i t h u b . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / a r c h i v e / $ { C O M M I T } . z i p "
F I L E N A M E " o p e n c v _ 3 r d p a r t y - $ { C O M M I T } . z i p "
S H A 5 1 2 $ { H A S H }
)
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 (
x f e a t u r e s 2 d / b o o s t d e s c
3 4 e 4 2 0 6 a e f 4 4 d 5 0 e 6 b b c d 0 a b 0 6 3 5 4 b 5 2 e 7 4 6 6 d 2 6
2 c c d c 8 f b 5 9 d a 5 5 e a b c 7 3 3 0 9 a 8 0 a 4 d 3 b 1 e 7 3 e 2 3 4 1 0 2 7 c d c d d 2 d 7 1 4 e 0 f 5 1 9 e 6 0 f 2 4 3 f 3 8 f 7 9 b 1 3 e d 3 d e 3 2 f 5 9 5 a a 2 3 e 4 f 8 6 4 1 8 e e d 4 2 e 7 4 1 f 3 2 a 8 1 b 1 e 6 e 0 8 7 9 1 9 0 6 0 1
)
# Used for opencv's xfeature2d module
download_opencv_3rdparty (
x f e a t u r e s 2 d / v g g
f c c f 7 c d 6 a 4 b 1 2 0 7 9 f 7 3 b b f b 2 1 7 4 5 f 9 b a b c d 4 e b 1 d
7 0 5 1 f 5 d 6 c c b 9 3 8 d 2 9 6 b 9 1 9 d d 6 d 5 d c d d c 5 a f b 5 2 7 a e d 4 5 6 6 3 9 c 9 9 8 4 2 7 6 a 8 f 6 4 5 6 5 c 0 8 4 d 9 6 a 7 2 4 9 9 a 7 7 5 6 f 1 2 7 f 8 d 2 b 1 c e 9 a b 7 0 e 4 c b b 3 f 8 9 c 4 e 1 6 f 8 2 2 9 6 c 2 a 1 5 d a e d
)
endif ( )
2019-08-24 03:48:09 +08:00
if ( WITH_IPP )
if ( VCPKG_TARGET_IS_OSX )
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / 3 2 e 3 1 5 a 5 b 1 0 6 a 7 b 8 9 d b e d 5 1 c 2 8 f 8 1 2 0 a 4 8 b 3 6 8 b 4 / i p p i c v / i p p i c v _ 2 0 1 9 _ m a c _ i n t e l 6 4 _ g e n e r a l _ 2 0 1 8 0 7 2 3 . t g z "
F I L E N A M E " o p e n c v - c a c h e / i p p i c v / f e 6 b 2 b b 7 5 a e 0 e 3 f 1 9 a d 3 a e 1 a 3 1 d f a 4 a 2 - i p p i c v _ 2 0 1 9 _ m a c _ i n t e l 6 4 _ g e n e r a l _ 2 0 1 8 0 7 2 3 . t g z "
S H A 5 1 2 2 6 6 f e 3 f e c f 8 e 9 5 e 1 f 5 1 c 0 9 b 6 5 3 3 0 a 5 7 7 7 4 3 e f 7 2 b 4 2 3 b 9 3 5 d 4 d 1 f e 8 d 8 7 f 1 b 4 f 2 5 8 c 2 8 2 f e 6 a 1 8 f c 8 0 5 d 4 8 9 5 9 2 f 1 3 7 e b e d 3 7 c 9 f 1 d 1 b 3 4 0 2 6 5 9 0 d 9 f 1 b a 1 0 7 0 1 5 1 3 2 e
2019-08-13 00:22:30 +08:00
)
2019-08-24 03:48:09 +08:00
else ( )
message ( WARNING "This target architecture is not supported IPPICV" )
set ( WITH_IPP OFF )
endif ( )
elseif ( VCPKG_TARGET_IS_LINUX )
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / 3 2 e 3 1 5 a 5 b 1 0 6 a 7 b 8 9 d b e d 5 1 c 2 8 f 8 1 2 0 a 4 8 b 3 6 8 b 4 / i p p i c v / i p p i c v _ 2 0 1 9 _ l n x _ i n t e l 6 4 _ g e n e r a l _ 2 0 1 8 0 7 2 3 . t g z "
F I L E N A M E " o p e n c v - c a c h e / i p p i c v / c 0 b d 7 8 a d b 4 1 5 6 b b f 5 5 2 c 1 d f e 9 0 5 9 9 6 0 7 - i p p i c v _ 2 0 1 9 _ l n x _ i n t e l 6 4 _ g e n e r a l _ 2 0 1 8 0 7 2 3 . t g z "
S H A 5 1 2 e 4 e c 6 b 3 b 9 f c 0 3 d 7 b 3 a e 7 7 7 c 2 a 2 6 f 5 7 9 1 3 e 8 3 3 2 9 f d 2 f 7 b e 2 6 c 2 5 9 b 0 7 4 7 7 c a 2 a 6 4 1 0 5 0 b 8 6 9 7 9 e 0 c 9 6 e 2 5 a a 4 c 1 f 9 f 2 5 1 b 2 8 7 2 7 6 9 0 3 5 8 a 7 7 4 1 8 e 7 6 d d 9 1 0 d 0 f 4 8 4 5 c 9
)
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / 3 2 e 3 1 5 a 5 b 1 0 6 a 7 b 8 9 d b e d 5 1 c 2 8 f 8 1 2 0 a 4 8 b 3 6 8 b 4 / i p p i c v / i p p i c v _ 2 0 1 9 _ l n x _ i a 3 2 _ g e n e r a l _ 2 0 1 8 0 7 2 3 . t g z "
F I L E N A M E " o p e n c v - c a c h e / i p p i c v / 4 f 3 8 4 3 2 c 3 0 b f d 6 4 2 3 1 6 4 b 7 a 2 4 b b c 9 8 a 0 - i p p i c v _ 2 0 1 9 _ l n x _ i a 3 2 _ g e n e r a l _ 2 0 1 8 0 7 2 3 . t g z "
S H A 5 1 2 d 9 6 d 3 9 8 9 9 2 8 f f 1 1 a 1 8 e 6 3 1 b f 5 e c f d e d f 8 8 f d 3 5 0 1 6 2 a 2 3 f a 2 c 8 f 7 d b c 3 b f 8 7 8 b f 4 4 2 a f f 7 f b 2 a 0 7 d c 5 6 6 7 1 d 7 2 6 8 c c 2 0 6 8 2 0 5 5 8 9 1 b e 7 5 b 9 8 3 4 e 9 6 9 4 d 2 0 1 7 3 e 9 2 b 6 a 3
)
else ( )
message ( WARNING "This target architecture is not supported IPPICV" )
set ( WITH_IPP OFF )
endif ( )
elseif ( VCPKG_TARGET_IS_WINDOWS )
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / 3 2 e 3 1 5 a 5 b 1 0 6 a 7 b 8 9 d b e d 5 1 c 2 8 f 8 1 2 0 a 4 8 b 3 6 8 b 4 / i p p i c v / i p p i c v _ 2 0 1 9 _ w i n _ i n t e l 6 4 _ 2 0 1 8 0 7 2 3 _ g e n e r a l . z i p "
F I L E N A M E " o p e n c v - c a c h e / i p p i c v / 1 d 2 2 2 6 8 5 2 4 6 8 9 6 f e 0 8 9 f 8 8 b 8 8 5 8 e 4 b 2 f - i p p i c v _ 2 0 1 9 _ w i n _ i n t e l 6 4 _ 2 0 1 8 0 7 2 3 _ g e n e r a l . z i p "
S H A 5 1 2 b 6 c 4 f 2 6 9 6 e 2 0 0 4 b 8 f 5 4 7 1 e f d 9 b d c 6 c 6 8 4 b 7 7 8 3 0 e 0 5 3 3 d 8 8 8 0 3 1 0 c 0 b 6 6 5 b 4 5 0 d 6 f 7 8 e 1 0 7 4 4 c 9 3 7 f 5 5 9 2 a b 9 0 0 e 1 8 7 c 4 7 5 e 4 6 c b 4 9 e 9 8 7 0 1 b b 4 b c b b c 7 d a 7 7 7 2 3 0 1 1 d
)
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
vcpkg_download_distfile ( OCV_DOWNLOAD
U R L S " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / o p e n c v / o p e n c v _ 3 r d p a r t y / 3 2 e 3 1 5 a 5 b 1 0 6 a 7 b 8 9 d b e d 5 1 c 2 8 f 8 1 2 0 a 4 8 b 3 6 8 b 4 / i p p i c v / i p p i c v _ 2 0 1 9 _ w i n _ i a 3 2 _ 2 0 1 8 0 7 2 3 _ g e n e r a l . z i p "
F I L E N A M E " o p e n c v - c a c h e / i p p i c v / 0 1 5 7 2 5 1 a 2 e b 9 c d 6 3 a 3 e b c 7 e e d 0 f 3 e 5 9 e - i p p i c v _ 2 0 1 9 _ w i n _ i a 3 2 _ 2 0 1 8 0 7 2 3 _ g e n e r a l . z i p "
S H A 5 1 2 c 3 3 f d 4 0 1 9 c 7 1 b 0 6 4 b 1 5 3 e 1 b 2 5 e 0 3 0 7 f 9 c 7 a d a 6 9 3 a f 8 e c 9 1 0 4 1 0 e d e a b 4 7 1 c 6 f 1 4 d f 9 b 1 1 b f 9 f 5 3 0 2 c e b 0 f c d 4 2 8 2 f 5 c 0 b 6 c 9 2 f b 5 d f 0 e 8 3 e b 5 0 e d 6 3 0 c 4 5 8 2 0 d 1 e 1 8 4
)
else ( )
message ( WARNING "This target architecture is not supported IPPICV" )
set ( WITH_IPP OFF )
endif ( )
2019-08-13 00:22:30 +08:00
else ( )
2019-08-24 03:48:09 +08:00
message ( WARNING "This target architecture is not supported IPPICV" )
set ( WITH_IPP OFF )
2019-08-13 00:22:30 +08:00
endif ( )
endif ( )
set ( WITH_MSMF ON )
2019-09-25 03:58:38 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP )
2019-08-13 00:22:30 +08:00
set ( WITH_MSMF OFF )
endif ( )
2019-09-25 03:58:38 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
if ( WITH_TBB )
message ( WARNING "TBB is currently unsupported in this build configuration, turning it off" )
set ( WITH_TBB OFF )
endif ( )
if ( WITH_VTK )
message ( WARNING "VTK is currently unsupported in this build configuration, turning it off" )
set ( WITH_VTK OFF )
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS AND BUILD_opencv_ovis )
message ( WARNING "OVIS is currently unsupported in this build configuration, turning it off" )
set ( BUILD_opencv_ovis 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 ( )
if ( "qt" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_BUILD_FLAGS "-DCMAKE_AUTOMOC=ON" )
endif ( )
2019-08-13 00:22:30 +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 ( )
vcpkg_configure_cmake (
P R E F E R _ N I N J A
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2019-09-25 03:58:38 +08:00
O P T I O N S
2019-08-24 03:48:09 +08:00
###### ocv_options
- D O p e n C V _ I N S T A L L _ B I N A R I E S _ P R E F I X =
- D O P E N C V _ L I B _ I N S T A L L _ P A T H = l i b
- D O P E N C V _ 3 P _ L I B _ I N S T A L L _ P A T H = l i b
- D O P E N C V _ C O N F I G _ I N S T A L L _ P A T H = s h a r e / o p e n c v
- D O P E N C V _ F F M P E G _ U S E _ F I N D _ P A C K A G E = F F M P E G
- D C M A K E _ D E B U G _ P O S T F I X = d
2019-08-13 00:22:30 +08:00
- D O p e n C V _ D I S A B L E _ A R C H _ P A T H = O N
# Do not build docs/examples
- D B U I L D _ D O C S = O F F
- D B U I L D _ E X A M P L E S = O F F
2019-09-25 03:58:38 +08:00
###### Disable build 3rd party libs
2019-08-13 00:22:30 +08:00
- D B U I L D _ J A S P E R = O F F
- D B U I L D _ J P E G = O F F
- D B U I L D _ O P E N E X R = O F F
- D B U I L D _ P N G = O F F
- D B U I L D _ T I F F = O F F
- D B U I L D _ W E B P = O F F
- D B U I L D _ Z L I B = O F F
2019-09-25 03:58:38 +08:00
###### Disable build 3rd party components
- D B U I L D _ P R O T O B U F = O F F
###### OpenCV Build components
2019-08-13 00:22:30 +08:00
- D B U I L D _ o p e n c v _ a p p s = O F F
- D B U I L D _ o p e n c v _ b g s e g m = $ { B U I L D _ o p e n c v _ b g s e g m }
- D B U I L D _ o p e n c v _ l i n e _ d e s c r i p t o r = $ { B U I L D _ o p e n c v _ l i n e _ d e s c r i p t o r }
- D B U I L D _ o p e n c v _ s a l i e n c y = $ { B U I L D _ o p e n c v _ s a l i e n c y }
2019-09-25 03:58:38 +08:00
- D B U I L D _ P A C K A G E = O F F
- D B U I L D _ P E R F _ T E S T S = O F F
- D B U I L D _ T E S T S = O F F
- D B U I L D _ W I T H _ D E B U G _ I N F O = O N
- D B U I L D _ W I T H _ S T A T I C _ C R T = $ { B U I L D _ W I T H _ S T A T I C _ C R T }
###### PROTOBUF
2019-08-24 03:48:09 +08:00
- D P R O T O B U F _ U P D A T E _ F I L E S = O N
- D U P D A T E _ P R O T O _ F I L E S = O N
2019-08-13 00:22:30 +08:00
# CMAKE
- D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ G i t = O N
- D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ J N I = O N
# ENABLE
- D E N A B L E _ C X X 1 1 = O N
2019-09-25 03:58:38 +08:00
###### OPENCV vars
2019-08-13 00:22:30 +08:00
" - D O P E N C V _ D O W N L O A D _ P A T H = $ { D O W N L O A D S } / o p e n c v - c a c h e "
$ { B U I L D _ W I T H _ C O N T R I B _ F L A G }
- D O P E N C V _ O T H E R _ I N S T A L L _ P A T H = s h a r e / o p e n c v
2019-09-25 03:58:38 +08:00
###### customized properties
## Options from vcpkg_check_features()
$ { F E A T U R E _ O P T I O N S }
- D H A L I D E _ R O O T _ D I R = $ { C U R R E N T _ I N S T A L L E D _ D I R }
2019-08-13 00:22:30 +08:00
- D W I T H _ I P P = $ { W I T H _ I P P }
- D W I T H _ M A T L A B = O F F
- D W I T H _ M S M F = $ { W I T H _ M S M F }
2019-09-25 03:58:38 +08:00
- D W I T H _ P R O T O B U F = O N
2019-08-13 00:22:30 +08:00
- D W I T H _ O P E N C L A M D B L A S = O F F
- D W I T H _ T B B = $ { W I T H _ T B B }
- D W I T H _ V T K = $ { W I T H _ V T K }
2019-09-25 03:58:38 +08:00
###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install
- D W I T H _ L A P A C K = O F F
###### BUILD_options (mainly modules which require additional libraries)
- D B U I L D _ o p e n c v _ o v i s = $ { B U I L D _ o p e n c v _ o v i s }
###### The following modules are disabled for UWP
- D B U I L D _ o p e n c v _ q u a l i t y = $ { B U I L D _ o p e n c v _ q u a l i t y }
###### Additional build flags
$ { A D D I T I O N A L _ B U I L D _ F L A G S }
2019-08-13 00:22:30 +08:00
)
vcpkg_install_cmake ( )
2019-08-24 03:48:09 +08:00
vcpkg_fixup_cmake_targets ( CONFIG_PATH "share/opencv" TARGET_PATH "share/opencv" )
vcpkg_copy_pdbs ( )
2019-08-13 00:22:30 +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 )
2019-08-24 03:48:09 +08:00
find_package ( Protobuf REQUIRED )
if ( Protobuf_FOUND )
if ( TARGET protobuf::libprotobuf )
add_library ( libprotobuf INTERFACE IMPORTED )
set_target_properties ( libprotobuf PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S p r o t o b u f : : l i b p r o t o b u f
)
else ( )
add_library ( libprotobuf UNKNOWN IMPORTED )
set_target_properties ( libprotobuf PROPERTIES
I M P O R T E D _ L O C A T I O N \ " $ { P r o t o b u f _ L I B R A R Y } \ "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S \ " $ { P r o t o b u f _ I N C L U D E _ D I R } \ "
I N T E R F A C E _ S Y S T E M _ I N C L U D E _ D I R E C T O R I E S \ " $ { P r o t o b u f _ I N C L U D E _ D I R } \ "
)
endif ( )
endif ( )
find_package ( TIFF QUIET )
find_package ( HDF5 QUIET )
find_package ( Freetype QUIET )
find_package ( Ogre QUIET )
find_package ( gflags QUIET )
find_package ( Ceres QUIET )
find_package ( ade QUIET )
find_package ( VTK QUIET )
find_package ( OpenMP QUIET )
2019-10-10 16:41:42 +08:00
find_package ( Tesseract QUIET )
2019-08-24 03:48:09 +08:00
find_package ( GDCM QUIET ) " O P E N C V _ M O D U L E S " $ { O P E N C V _ M O D U L E S } " )
2019-08-13 00:22:30 +08:00
file ( WRITE ${ CURRENT_PACKAGES_DIR } /share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}" )
2019-08-24 03:48:09 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /bin ${ CURRENT_PACKAGES_DIR } /debug/bin )
2019-08-13 00:22:30 +08:00
endif ( )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
2019-08-24 03:48:09 +08:00
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /setup_vars_opencv3.cmd )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/setup_vars_opencv3.cmd )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /LICENSE )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/LICENSE )
2019-09-25 03:58:38 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )