2019-03-15 05:15:28 +08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" )
message ( FATAL_ERROR "darknet does not support ARM" )
endif ( )
if ( VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
message ( FATAL_ERROR "darknet does not support UWP" )
endif ( )
include ( vcpkg_common_functions )
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
2019-07-30 02:14:39 +08:00
R E F b 2 d 7 9 5 e 3 4 e 1 d 7 3 4 d 0 f 4 5 1 c e 9 8 4 7 a 0 e 6 b 6 8 c 3 2 3 5 1
S H A 5 1 2 1 9 6 4 a a 0 d 7 6 8 d 3 7 f c 6 1 4 9 8 3 7 1 8 a e d e 8 b 2 9 e 5 6 2 f d 8 1 2 0 1 1 6 b 7 c d 7 a 1 3 3 1 b b 8 a 3 2 5 6 e 2 8 c 0 1 c d f f 6 f 1 9 b b e 7 b 9 d 6 2 8 9 b 3 2 9 2 1 8 8 2 0 5 f 3 6 2 b a e 3 8 3 9 3 c e e 3 3 d 8 a 2 e 6 a 5 2 7 3
2019-03-15 05:15:28 +08:00
H E A D _ R E F m a s t e r
)
2019-08-14 11:13:55 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
" c u d a " E N A B L E _ C U D A
" o p e n c v " E N A B L E _ O P E N C V
2019-06-29 04:48:42 +08:00
)
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-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-06-25 06:22:57 +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 #since darknet configures a file inside source tree, it is better to disable parallel configure
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-08-14 11:13:55 +08:00
$ { F E A T U R E _ O P T I O N S }
2019-03-15 05:15:28 +08:00
)
vcpkg_install_cmake ( )
if ( CMAKE_HOST_WIN32 )
set ( EXECUTABLE_SUFFIX ".exe" )
else ( )
set ( EXECUTABLE_SUFFIX "" )
endif ( )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/bin/darknet ${ EXECUTABLE_SUFFIX } )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/bin/uselib ${ EXECUTABLE_SUFFIX } )
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /debug/bin/uselib_track ${ EXECUTABLE_SUFFIX } )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/bin/uselib_track ${ EXECUTABLE_SUFFIX } )
endif ( )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /tools/darknet/ )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin/darknet ${ EXECUTABLE_SUFFIX } ${ CURRENT_PACKAGES_DIR } /tools/darknet/darknet ${ EXECUTABLE_SUFFIX } )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin/uselib ${ EXECUTABLE_SUFFIX } ${ CURRENT_PACKAGES_DIR } /tools/darknet/uselib ${ EXECUTABLE_SUFFIX } )
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /bin/uselib_track ${ EXECUTABLE_SUFFIX } )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin/uselib_track ${ EXECUTABLE_SUFFIX } ${ CURRENT_PACKAGES_DIR } /tools/darknet/uselib_track ${ EXECUTABLE_SUFFIX } )
endif ( )
file ( COPY ${ SOURCE_PATH } /cfg DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
file ( COPY ${ SOURCE_PATH } /data DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/darknet )
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
2019-04-11 23:27:06 +08:00
file ( COPY ${ SOURCE_PATH } /cmake/Modules/FindCUDNN.cmake DESTINATION ${ CURRENT_PACKAGES_DIR } /share/darknet )
2019-03-15 05:15:28 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/darknet RENAME copyright )
if ( "weights" IN_LIST FEATURES )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov3.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov2.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov3-tiny.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/yolov2-tiny.weights DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
endif ( )
2019-07-30 02:14:39 +08:00
if ( "weights-train" IN_LIST FEATURES )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/darknet53.conv.74 DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
file ( COPY ${ VCPKG_ROOT_DIR } /downloads/darknet-cache/darknet19_448.conv.23 DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/darknet )
endif ( )