2019-03-15 05:15:28 +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 A l e x e y A B / d a r k n e t
2020-03-05 02:51:49 +08:00
R E F 8 1 2 9 0 b 0 7 3 7 6 c 5 a b b 4 9 8 8 a 4 9 2 d d a 7 0 9 1 3 b b 9 0 1 3 3 d
S H A 5 1 2 0 9 4 1 9 7 c d e 8 5 1 d f d d 1 e 1 0 2 a 3 f f a e d 3 4 d 6 7 a 7 8 9 d d 7 5 d c 2 8 8 b d e 6 1 1 1 4 4 d c 9 a a 4 8 4 c a 0 b 9 e 3 4 6 8 a b c 2 9 7 d 0 7 5 d 3 7 5 3 5 5 3 f 7 f 0 9 a 2 1 4 b e 2 7 9 a f 9 e 5 8 c c b 6 4 2 a a 7 5 7 9 0 9 f 7 9
2019-03-15 05:15:28 +08:00
H E A D _ R E F m a s t e r
)
2019-09-25 03:58:38 +08:00
# enable CUDA inside DARKNET
set ( ENABLE_CUDA OFF )
if ( "cuda" IN_LIST FEATURES )
set ( ENABLE_CUDA ON )
endif ( )
set ( ENABLE_OPENCV OFF )
# enable OPENCV (basic version) inside DARKNET
if ( "opencv-base" IN_LIST FEATURES )
set ( ENABLE_OPENCV ON )
endif ( )
if ( "opencv3-base" IN_LIST FEATURES )
set ( ENABLE_OPENCV ON )
endif ( )
# enable OPENCV (with its own CUDA feature enabled) inside DARKNET
# (note: this does not mean that DARKNET itself will have CUDA support since by design it is independent, to have it you must require both opencv-cuda and cuda features!)
# DARKNET will be automatically able to distinguish an OpenCV that is built with or without CUDA support.
if ( "opencv-cuda" IN_LIST FEATURES )
set ( ENABLE_OPENCV ON )
endif ( )
if ( "opencv3-cuda" IN_LIST FEATURES )
set ( ENABLE_OPENCV ON )
endif ( )
# enable CUDNN inside DARKNET (which depends on the "cuda" feature by design)
set ( ENABLE_CUDNN OFF )
if ( "cudnn" IN_LIST FEATURES )
set ( ENABLE_CUDNN ON )
endif ( )
2019-03-15 05:15:28 +08:00
2019-08-14 11:13:55 +08:00
if ( "cuda" IN_LIST FEATURES )
2019-06-29 04:48:42 +08:00
if ( NOT VCPKG_CMAKE_SYSTEM_NAME AND NOT ENV{CUDACXX} )
#CMake looks for nvcc only in PATH and CUDACXX env vars for the Ninja generator. Since we filter path on vcpkg and CUDACXX env var is not set by CUDA installer on Windows, CMake cannot find CUDA when using Ninja generator, so we need to manually enlight it if necessary (https://gitlab.kitware.com/cmake/cmake/issues/19173). Otherwise we could just disable Ninja and use MSBuild, but unfortunately CUDA installer does not integrate with some distributions of MSBuild (like the ones inside Build Tools), making CUDA unavailable otherwise in those cases, which we want to avoid
set ( ENV{CUDACXX} "$ENV{CUDA_PATH}/bin/nvcc.exe" )
endif ( )
endif ( )
2019-03-15 05:15:28 +08:00
if ( "weights" IN_LIST FEATURES )
vcpkg_download_distfile ( YOLOV3_WEIGHTS
U R L S " h t t p s : / / p j r e d d i e . c o m / m e d i a / f i l e s / y o l o v 3 . w e i g h t s "
F I L E N A M E " d a r k n e t - c a c h e / y o l o v 3 . w e i g h t s "
S H A 5 1 2 2 9 3 c 7 0 e 4 0 4 f f 0 2 5 0 d 7 c 0 4 c a 1 e 5 e 0 5 3 f c 2 1 a 7 8 5 4 7 e 6 9 b 5 b 3 2 9 d 3 4 f 2 5 9 8 1 6 1 3 e 5 9 b 9 8 2 d 9 3 f f f 2 c 3 5 2 9 1 5 e f 7 5 3 1 d 6 c 3 b 0 2 a 9 b 0 b 3 8 3 4 6 d 0 5 c 5 1 d 6 6 3 6 8 7 8 d 8 8 8 3 f 2 c 1
)
vcpkg_download_distfile ( YOLOV2_WEIGHTS
U R L S " h t t p s : / / p j r e d d i e . c o m / m e d i a / f i l e s / y o l o v 2 . w e i g h t s "
F I L E N A M E " d a r k n e t - c a c h e / y o l o v 2 . w e i g h t s "
S H A 5 1 2 5 2 7 1 d a 2 d d 2 d a 9 1 5 1 7 2 d d d 0 3 4 c 8 e 8 9 4 8 7 7 e 7 0 6 6 0 5 1 f 1 0 5 a e 8 2 e 2 5 e 1 8 5 a 2 b 4 e 4 1 5 7 d 2 b 9 5 1 4 6 5 3 c 2 3 7 8 0 e 8 7 3 4 6 f 2 b 2 0 d f 6 3 6 3 0 1 8 b 7 e 6 8 8 a b a 4 2 2 e 2 d a c f 1 d 2 f b f 6 a b
)
vcpkg_download_distfile ( YOLOV3-TINY_WEIGHTS
U R L S " h t t p s : / / p j r e d d i e . c o m / m e d i a / f i l e s / y o l o v 3 - t i n y . w e i g h t s "
F I L E N A M E " d a r k n e t - c a c h e / y o l o v 3 - t i n y . w e i g h t s "
S H A 5 1 2 9 8 1 a 5 6 4 5 9 5 1 5 f 7 2 7 b b 7 b 3 d 3 3 4 1 b 9 5 f 4 1 1 7 4 9 9 b 6 7 2 6 e a b 2 7 9 8 e 1 c 3 e 5 2 4 d e 1 e e 8 e d 0 d 9 5 4 c 1 1 b 2 7 b b b b 9 2 6 d a 2 c c 9 5 5 5 2 6 a 1 9 4 e d d f 6 9 c 5 5 d 6 5 9 2 3 9 9 4 a b 2 e 8 a f 0 7 0 4 2
)
vcpkg_download_distfile ( YOLOV2-TINY_WEIGHTS
U R L S " h t t p s : / / p j r e d d i e . c o m / m e d i a / f i l e s / y o l o v 2 - t i n y . w e i g h t s "
F I L E N A M E " d a r k n e t - c a c h e / y o l o v 2 - t i n y . w e i g h t s "
S H A 5 1 2 f 0 8 5 7 a 7 a 0 2 c f 4 3 2 2 3 5 4 d 2 8 8 c 9 a f a 0 b 8 7 3 2 1 b 2 3 0 8 2 b 7 1 9 b c 8 4 e a 6 4 e 2 f 3 5 5 6 c c 1 f a f e b 8 3 6 e e 5 b f 9 f b 6 d c f 4 4 8 8 3 9 0 6 1 b 9 3 6 2 3 a 0 6 7 d f d e 7 a f a 1 3 3 8 6 3 6 8 6 5 e a 8 8 9 8 9 a
)
endif ( )
2019-07-30 02:14:39 +08:00
if ( "weights-train" IN_LIST FEATURES )
vcpkg_download_distfile ( IMAGENET_CONV_WEIGHTS_V3
U R L S " h t t p s : / / p j r e d d i e . c o m / m e d i a / f i l e s / d a r k n e t 5 3 . c o n v . 7 4 "
F I L E N A M E " d a r k n e t - c a c h e / d a r k n e t 5 3 . c o n v . 7 4 "
S H A 5 1 2 8 9 8 3 e 1 c 1 2 9 e 2 d 6 e 8 e 3 d a 0 c c 0 7 8 1 e c b 7 a 0 7 8 1 3 8 3 0 e f 5 a 8 7 c 2 4 b 5 3 1 0 0 d f 6 a 5 f 2 3 d b 6 c 6 e 6 a 4 0 2 a e c 7 8 0 2 5 a 9 3 f e 0 6 0 b 7 5 d 1 9 5 8 f 1 b 8 f 7 4 3 9 a 0 4 b 5 4 a 3 f 1 9 c 8 1 e 2 a e 9 9 b
)
vcpkg_download_distfile ( IMAGENET_CONV_WEIGHTS_V2
U R L S " h t t p s : / / p j r e d d i e . c o m / m e d i a / f i l e s / d a r k n e t 1 9 _ 4 4 8 . c o n v . 2 3 "
F I L E N A M E " d a r k n e t - c a c h e / d a r k n e t 1 9 _ 4 4 8 . c o n v . 2 3 "
S H A 5 1 2 8 0 1 6 f 5 b 7 d d c 1 5 c 5 d 7 d a d 2 3 1 5 9 2 f 5 3 5 1 e e a 6 5 f 6 0 8 e b d b 2 0 4 f 5 4 5 0 3 4 d d e 9 0 4 e 1 1 9 6 2 f 6 9 3 0 8 0 d f e b 5 a 4 5 1 0 e 7 b 7 1 b d d a 1 5 1 a 9 1 2 1 b a 0 f 8 a 2 4 3 0 1 8 d 6 8 0 f 0 1 b 1 e f d b d 3 1
)
endif ( )
#make sure we don't use any integrated pre-built library nor any unnecessary CMake module
2019-03-23 01:25:15 +08:00
file ( REMOVE_RECURSE ${ SOURCE_PATH } /3rdparty )
2019-07-30 02:14:39 +08:00
file ( REMOVE ${ SOURCE_PATH } /cmake/Modules/FindPThreads_windows.cmake )
2019-09-25 03:58:38 +08:00
file ( REMOVE ${ SOURCE_PATH } /cmake/Modules/FindCUDNN.cmake )
2019-10-09 20:35:24 +08:00
file ( REMOVE ${ SOURCE_PATH } /cmake/Modules/FindStb.cmake )
2019-03-15 05:15:28 +08:00
vcpkg_configure_cmake (
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
D I S A B L E _ P A R A L L E L _ C O N F I G U R E
2019-06-29 04:48:42 +08:00
P R E F E R _ N I N J A
2019-03-15 05:15:28 +08:00
O P T I O N S
2019-06-25 06:22:57 +08:00
- D I N S T A L L _ B I N _ D I R : S T R I N G = b i n
- D I N S T A L L _ L I B _ D I R : S T R I N G = l i b
2019-09-25 03:58:38 +08:00
- D E N A B L E _ C U D A = $ { E N A B L E _ C U D A }
- D E N A B L E _ C U D N N = $ { E N A B L E _ C U D N N }
- D E N A B L E _ O P E N C V = $ { E N A B L E _ O P E N C V }
2019-03-15 05:15:28 +08:00
)
vcpkg_install_cmake ( )
2020-03-05 02:51:49 +08:00
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/bin/darknet ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/bin/uselib ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /debug/bin/uselib_track ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/bin/uselib_track ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
2019-03-15 05:15:28 +08:00
endif ( )
2019-09-25 03:58:38 +08:00
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
2020-03-05 02:51:49 +08:00
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin/darknet ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } /darknet ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin/uselib ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } /uselib ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /bin/uselib_track ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin/uselib_track ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } /uselib_track ${ VCPKG_TARGET_EXECUTABLE_SUFFIX } )
2019-03-15 05:15:28 +08:00
endif ( )
2019-09-25 03:58:38 +08:00
file ( COPY ${ SOURCE_PATH } /cfg DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
file ( COPY ${ SOURCE_PATH } /data DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
2019-03-15 05:15:28 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /bin ${ CURRENT_PACKAGES_DIR } /debug/bin )
endif ( )
2019-03-23 01:25:15 +08:00
vcpkg_fixup_cmake_targets ( )
2019-03-15 05:15:28 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
2019-09-25 03:58:38 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
2019-03-15 05:15:28 +08:00
if ( "weights" IN_LIST FEATURES )
2019-09-25 03:58:38 +08:00
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov3.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov2.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov3-tiny.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov2-tiny.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
2019-03-15 05:15:28 +08:00
endif ( )
2019-07-30 02:14:39 +08:00
if ( "weights-train" IN_LIST FEATURES )
2019-09-25 03:58:38 +08:00
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/darknet53.conv.74 DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/darknet19_448.conv.23 DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
2019-07-30 02:14:39 +08:00
endif ( )