2020-05-07 06:26:16 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv2" )
message ( FATAL_ERROR "OpenCV 2 is installed, please uninstall and try again:\n vcpkg remove opencv2" )
endif ( )
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 ( )
2020-07-28 08:43:23 +08:00
set ( OPENCV_VERSION "3.4.10" )
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 }
2020-07-28 08:43:23 +08:00
S H A 5 1 2 7 c c d c 7 f e f 2 6 4 3 6 b 2 f 6 4 3 c c e 2 a 1 3 c 9 f 9 f 7 7 e 5 6 d 3 f d 0 3 4 0 1 1 7 4 1 9 d f 3 c 1 6 6 5 c a 1 2 4 1 6 2 7 7 b 6 2 6 c c e 3 c 0 5 6 f d c 1 4 8 9 9 8 0 5 b b e 9 e c e 3 9 1 f 1 1 d 2 8 c 6 a d e a 7 1 6 d 4 7 c e 8 8 9 4 b c
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-11-06 02:24:02 +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
)
2020-07-28 08:43:23 +08:00
file ( REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake" )
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
2020-07-28 08:43:23 +08:00
# Cannot use vcpkg_check_features() for "dnn", "ipp", ovis", "tbb", and "vtk".
2019-08-24 03:48:09 +08:00
# As the respective value of their variables can be unset conditionally.
2020-07-28 08:43:23 +08:00
set ( BUILD_opencv_dnn OFF )
if ( "dnn" IN_LIST FEATURES )
if ( NOT VCPKG_TARGET_IS_ANDROID )
set ( BUILD_opencv_dnn ON )
else ( )
message ( WARNING "The dnn module cannot be enabled on Android" )
endif ( )
endif ( )
2019-08-24 03:48:09 +08:00
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 }
2020-07-28 08:43:23 +08:00
S H A 5 1 2 7 0 b 4 e c f a f 9 8 8 1 3 9 0 a d 8 2 6 a 2 a b a 2 4 c c e d 8 5 1 4 a 6 8 0 9 6 5 e c 7 1 5 1 d f 9 9 2 6 0 8 2 f f f 5 3 3 6 4 b b e 6 b e 3 6 4 5 8 b b 9 f f 4 6 6 f d a 6 f 6 f 6 c a 2 1 7 4 e e a c 9 4 c 1 0 a 6 b a d a 9 8 9 f 0 7 e d 1 c 4 d a 1
2019-08-24 03:48:09 +08:00
H E A D _ R E F m a s t e r
2020-07-28 08:43:23 +08:00
P A T C H E S
0 0 0 4 - a d d - m i s s i n g - s t d e x c e p t - i n c l u d e . p a t c h
2019-08-24 03:48:09 +08:00
)
set ( BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules" )
2020-07-28 08:43:23 +08:00
2019-08-13 00:22:30 +08:00
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
2020-07-28 08:43:23 +08:00
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 / a 5 6 b 6 a c 6 f 0 3 0 c 3 1 2 b 2 d c e 1 7 4 3 0 e e f 1 3 a e d 9 a f 2 7 4 / i p p i c v / i p p i c v _ 2 0 2 0 _ m a c _ i n t e l 6 4 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . 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 / 1 c 3 d 6 7 5 c 2 a 2 3 9 5 d 0 9 4 d 5 2 3 0 2 4 8 9 6 e 0 1 b - i p p i c v _ 2 0 2 0 _ m a c _ i n t e l 6 4 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . t g z "
S H A 5 1 2 4 5 4 d f a a a 2 4 5 e 3 a 3 b 2 f 1 f f b 1 a a 8 e 2 7 e 2 8 0 b 0 3 6 8 5 0 0 9 d 6 6 e 1 4 7 4 8 2 b 1 4 e 5 7 9 6 f d f 2 d 3 3 2 c a c 0 f 9 b 0 8 2 2 c a e d d 5 7 6 0 f d a 4 e e 0 c e 2 9 6 1 8 8 9 5 9 7 4 5 6 b b c 1 8 2 0 2 f 1 0 b f 7 2 7 c d
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
2020-07-28 08:43:23 +08:00
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 / a 5 6 b 6 a c 6 f 0 3 0 c 3 1 2 b 2 d c e 1 7 4 3 0 e e f 1 3 a e d 9 a f 2 7 4 / i p p i c v / i p p i c v _ 2 0 2 0 _ l n x _ i n t e l 6 4 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . 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 / 7 4 2 1 d e 0 0 9 5 c 7 a 3 9 1 6 2 a e 1 3 a 6 0 9 8 7 8 2 f 9 - i p p i c v _ 2 0 2 0 _ l n x _ i n t e l 6 4 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . t g z "
S H A 5 1 2 d e 6 d 8 0 6 9 5 c d 6 d e e f 3 5 9 3 7 6 4 7 6 e d c 4 f f 8 5 f d d d c f 9 4 9 7 2 b 9 3 6 e 0 0 1 7 f 8 a 4 8 a a a 5 d 1 8 f 5 5 c 4 2 5 3 a e 3 7 d e b 8 3 b f f 2 f 7 1 4 1 0 f 6 8 4 0 8 0 6 3 c 8 8 b 5 f 3 b f 4 d f 3 c 4 1 6 a a 9 3 c e c a 8 7
2019-08-24 03:48:09 +08:00
)
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
vcpkg_download_distfile ( OCV_DOWNLOAD
2020-07-28 08:43:23 +08:00
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 / a 5 6 b 6 a c 6 f 0 3 0 c 3 1 2 b 2 d c e 1 7 4 3 0 e e f 1 3 a e d 9 a f 2 7 4 / i p p i c v / i p p i c v _ 2 0 2 0 _ l n x _ i a 3 2 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . 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 / a d 1 8 9 a 9 4 0 f b 6 0 e b 7 1 f 2 9 1 3 2 1 3 2 2 f e 3 e 8 - i p p i c v _ 2 0 2 0 _ l n x _ i a 3 2 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . t g z "
S H A 5 1 2 5 c a 9 d a f c 3 a 6 3 4 e 2 a 5 f 8 3 f 6 a 4 9 8 6 1 1 c 9 9 0 e f 1 6 d 5 4 3 5 8 e 9 b 4 4 5 7 4 b 0 1 6 9 4 e 9 d 6 4 b 1 1 8 d 4 6 d 6 e 2 0 1 1 5 0 6 e 4 0 d 3 7 e 5 a 9 8 6 5 f 5 7 6 f 7 9 0 e 3 7 f f 9 6 b 7 c 8 b 5 0 3 5 0 7 6 3 3 6 3 1 a 2 9 6
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_WINDOWS )
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
vcpkg_download_distfile ( OCV_DOWNLOAD
2020-07-28 08:43:23 +08:00
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 / a 5 6 b 6 a c 6 f 0 3 0 c 3 1 2 b 2 d c e 1 7 4 3 0 e e f 1 3 a e d 9 a f 2 7 4 / i p p i c v / i p p i c v _ 2 0 2 0 _ w i n _ i n t e l 6 4 _ 2 0 1 9 1 0 1 8 _ 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 / 8 7 9 7 4 1 a 7 9 4 6 b 8 1 4 4 5 5 e e e 6 c 6 f f d e 2 9 8 4 - i p p i c v _ 2 0 2 0 _ w i n _ i n t e l 6 4 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . z i p "
S H A 5 1 2 5 0 c 4 a f 4 b 7 f e 2 1 6 1 d 6 5 2 2 6 4 2 3 0 3 8 9 d a d 2 3 3 0 e 8 c 9 5 b 7 3 4 d 0 4 f b 7 5 6 5 b f f d a b 8 5 5 c 0 6 d 4 3 0 8 5 e 4 8 0 d a 5 5 4 c 5 6 b 0 4 f 8 5 3 8 0 8 7 d 4 9 5 0 3 5 3 8 d 5 9 4 3 2 2 1 e e 2 a 7 7 2 e e 7 b e 4 c 9 3 c
2019-08-24 03:48:09 +08:00
)
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
vcpkg_download_distfile ( OCV_DOWNLOAD
2020-07-28 08:43:23 +08:00
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 / a 5 6 b 6 a c 6 f 0 3 0 c 3 1 2 b 2 d c e 1 7 4 3 0 e e f 1 3 a e d 9 a f 2 7 4 / i p p i c v / i p p i c v _ 2 0 2 0 _ w i n _ i a 3 2 _ 2 0 1 9 1 0 1 8 _ 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 / c d 3 9 b d f 0 c 2 e 1 c a c 9 a 6 1 1 0 1 d a d 7 a 2 4 1 3 e - i p p i c v _ 2 0 2 0 _ w i n _ i a 3 2 _ 2 0 1 9 1 0 1 8 _ g e n e r a l . z i p "
S H A 5 1 2 0 5 8 d 0 0 7 7 5 d 9 f 1 6 9 5 5 c 7 a 5 5 7 d 5 5 4 b 8 c 2 9 7 6 a b 9 d b a d 4 b a 3 f d b 9 8 2 3 c 0 f 7 6 8 8 0 9 e d b d 8 3 5 e 4 3 9 7 f 0 1 d c 0 9 0 a 9 b c 8 0 d 8 1 d e 8 3 4 3 7 5 e 7 0 0 6 6 1 4 d 2 a 8 9 8 f 4 2 e 8 0 0 4 d e 0 e 0 4 b f
2019-08-24 03:48:09 +08:00
)
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 =
2020-07-28 08:43:23 +08:00
- D O P E N C V _ B I N _ I N S T A L L _ P A T H = b i n
- D O P E N C V _ I N C L U D E _ I N S T A L L _ P A T H = i n c l u d e
2019-08-24 03:48:09 +08:00
- 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
2020-07-28 08:43:23 +08:00
- D I N S T A L L _ T O _ M A N G L E D _ P A T H S = O F F
2019-08-24 03:48:09 +08:00
- 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
2020-07-28 08:43:23 +08:00
- D O P E N C V _ D L L V E R S I O N =
- D O P E N C V _ D E B U G _ P O S T F I X = d
- D O P E N C V _ G E N E R A T E _ S E T U P V A R S = O F F
2019-08-13 00:22:30 +08:00
# 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
2020-07-28 08:43:23 +08:00
- D B U I L D _ T B B = O F F
- D B U I L D _ I P P _ I W = O F F
- D B U I L D _ I T T = 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 }
2020-07-28 08:43:23 +08:00
- D B U I L D _ A N D R O I D _ P R O J E C T = O F F
- D B U I L D _ A N D R O I D _ E X A M P L E S = O F F
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 }
2020-07-28 08:43:23 +08:00
- D B U I L D _ J A V A = O F F
- D C U R R E N T _ I N S T A L L E D _ D I R = $ { C U R R E N T _ I N S T A L L E D _ D I R }
2019-09-25 03:58:38 +08:00
###### PROTOBUF
2020-10-21 04:20:20 +08:00
- D P R O T O B U F _ U P D A T E _ F I L E S = $ { B U I L D _ o p e n c v _ f l a n n }
- D U P D A T E _ P R O T O _ F I L E S = $ { B U I L D _ o p e n c v _ f l a n n }
2020-07-28 08:43:23 +08:00
###### PYLINT/FLAKE8
- D E N A B L E _ P Y L I N T = O F F
- D E N A B L E _ F L A K E 8 = O F F
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 }
2020-07-28 08:43:23 +08:00
- D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ H a l i d e = O N
2019-09-25 03:58:38 +08:00
- 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 }
2020-07-28 08:43:23 +08:00
- D W I T H _ G T K = O F F
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 }
2020-07-28 08:43:23 +08:00
- D W I T H _ O P E N M P = O F F
2020-10-21 04:20:20 +08:00
- D W I T H _ P R O T O B U F = $ { B U I L D _ o p e n c v _ f l a n 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 }
2020-07-28 08:43:23 +08:00
- D W I T H _ O P E N J P E G = O F F
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 }
2020-07-28 08:43:23 +08:00
- D B U I L D _ o p e n c v _ d n n = $ { B U I L D _ o p e n c v _ d n n }
2019-09-25 03:58:38 +08:00
###### 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 ( )
2020-07-28 08:43:23 +08:00
find_package ( CUDA QUIET )
find_package ( Threads QUIET )
2019-08-24 03:48:09 +08:00
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 )
2020-07-28 08:43:23 +08:00
find_package ( OpenEXR QUIET )
set ( CMAKE_AUTOMOC ON )
set ( CMAKE_AUTORCC ON )
set ( CMAKE_AUTOUIC ON )
find_package ( Qt5 COMPONENTS OpenGL Concurrent Test 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 } " )
2020-07-28 08:43:23 +08:00
if ( BUILD_opencv_ovis )
string ( REPLACE "OgreGLSupportStatic"
" O g r e G L S u p p o r t " 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 } " )
endif ( )
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 } /LICENSE )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/LICENSE )
2020-07-28 08:43:23 +08:00
if ( VCPKG_TARGET_IS_ANDROID )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /README.android )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/README.android )
endif ( )
2019-09-25 03:58:38 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )