[darknet] enable ninja (#7064)

* [darknet] enable ninja

* Bump CONTROL version
This commit is contained in:
Stefano Sinigardi 2019-06-28 22:48:42 +02:00 committed by Victor Romero
parent b4675fd65a
commit 79175994c2
2 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,5 @@
Source: darknet
Version: 0.2.5-3
Version: 0.2.5-4
Description: Darknet is an open source neural network framework written in C and CUDA. You only look once (YOLO) is a state-of-the-art, real-time object detection system, best example of darknet functionalities.
Build-Depends: pthreads (windows), stb
Default-Features: weights

View File

@ -16,21 +16,23 @@ vcpkg_from_github(
HEAD_REF master
)
set(ENABLE_CUDA OFF)
if("cuda" IN_LIST FEATURES)
set(ENABLE_CUDA ON)
endif()
set(ENABLE_OPENCV OFF)
if("opencv" IN_LIST FEATURES)
set(ENABLE_OPENCV ON)
endif()
vcpkg_check_features(
"cuda" ENABLE_CUDA
"opencv" ENABLE_OPENCV
)
if("opencv-cuda" IN_LIST FEATURES)
set(ENABLE_OPENCV ON)
set(ENABLE_CUDA ON)
endif()
if (ENABLE_CUDA)
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()
if("weights" IN_LIST FEATURES)
vcpkg_download_distfile(YOLOV3_WEIGHTS
URLS "https://pjreddie.com/media/files/yolov3.weights"
@ -60,7 +62,7 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
DISABLE_PARALLEL_CONFIGURE #since darknet configures a file inside source tree, it is better to disable parallel configure
#PREFER_NINJA #it does not work with cuda on windows https://gitlab.kitware.com/cmake/cmake/issues/19173
PREFER_NINJA
OPTIONS
-DINSTALL_BIN_DIR:STRING=bin
-DINSTALL_LIB_DIR:STRING=lib