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
2024-11-06 03:17:22 +08:00
R E F 1 9 d d e 2 f 2 9 6 9 4 1 a 7 5 b 0 b 9 2 0 2 c c c d 5 9 5 2 8 b d e 7 f 6 5 a
S H A 5 1 2 3 f 2 4 f d 5 c 6 9 a 0 0 0 3 2 e 6 3 f c 8 4 7 9 d 4 6 d e d f 9 0 0 8 9 0 9 c 5 e 0 f 3 7 8 4 7 f 0 4 2 7 c 3 9 f 3 5 e 6 8 f 3 5 a 5 e e 8 9 8 2 0 c d 0 a 1 7 9 c b 2 8 2 e 4 9 7 3 0 e 6 b 1 4 6 5 a 0 2 7 d 8 9 b e f 5 8 5 e 9 a 1 c f c a 6 e 3 d 3 a 2
2019-03-15 05:15:28 +08:00
H E A D _ R E F m a s t e r
)
2021-01-06 04:10:06 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-04-30 01:45:10 +08:00
F E A T U R E S
2021-01-06 04:10:06 +08:00
c u d a E N A B L E _ C U D A
c u d n n E N A B L E _ C U D N N
)
2019-03-15 05:15:28 +08:00
2021-04-30 01:45:10 +08:00
#do not move following features to vcpkg_check_features because they break themselves: one off will turn off the others even if true
set ( ENABLE_OPENCV FALSE )
2024-11-06 03:17:22 +08:00
if ( "opencv-base" IN_LIST FEATURES OR "opencv-cuda" IN_LIST FEATURES )
2021-04-30 01:45:10 +08:00
set ( ENABLE_OPENCV TRUE )
endif ( )
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-07-30 02:14:39 +08:00
#make sure we don't use any integrated pre-built library nor any unnecessary CMake module
2022-04-07 03:39:56 +08:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/3rdparty" )
2022-06-28 07:45:13 +08:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/cmake/Modules" )
2019-03-15 05:15:28 +08:00
2022-04-07 03:39:56 +08:00
vcpkg_cmake_configure (
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
2024-11-06 03:17:22 +08:00
O P T I O N S
2023-12-13 07:23:17 +08:00
$ { F E A T U R E _ 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
2021-04-30 01:45:10 +08:00
- D E N A B L E _ O P E N C V : B O O L = $ { E N A B L E _ O P E N C V }
2024-11-06 03:17:22 +08:00
- D S K I P _ I N S T A L L _ R U N T I M E _ L I B S : B O O L = O N
2019-03-15 05:15:28 +08:00
)
2022-04-07 03:39:56 +08:00
vcpkg_cmake_install ( )
2024-11-06 03:17:22 +08:00
vcpkg_copy_tools ( AUTO_CLEAN TOOL_NAMES darknet uselib kmeansiou )
if ( "opencv-cuda" IN_LIST FEATURES )
2021-04-30 01:45:10 +08:00
vcpkg_copy_tools ( AUTO_CLEAN TOOL_NAMES uselib_track )
2019-03-15 05:15:28 +08:00
endif ( )
2021-04-30 01:45:10 +08:00
2022-04-07 03:39:56 +08:00
file ( COPY "${SOURCE_PATH}/cfg" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}" )
file ( COPY "${SOURCE_PATH}/data" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}" )
2019-03-15 05:15:28 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2022-04-07 03:39:56 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2019-03-15 05:15:28 +08:00
endif ( )
2022-04-07 03:39:56 +08:00
vcpkg_cmake_config_fixup ( )
2019-03-15 05:15:28 +08:00
2022-04-07 03:39:56 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
2019-03-15 05:15:28 +08:00
2022-04-07 03:39:56 +08:00
file ( INSTALL "${SOURCE_PATH}/scripts/download_weights.ps1" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/scripts" )
2021-04-30 01:45:10 +08:00
message ( STATUS "To download weight files, please go to ${CURRENT_INSTALLED_DIR}/tools/${PORT}/scripts and run ./download_weights.ps1" )
2023-12-13 07:23:17 +08:00
2023-01-05 20:59:45 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/LICENSE" )