aboutsummaryrefslogtreecommitdiff
path: root/ports/darknet
diff options
context:
space:
mode:
authorVictor Romero <romerosanchezv@gmail.com>2019-08-13 20:13:55 -0700
committerGitHub <noreply@github.com>2019-08-13 20:13:55 -0700
commita3a6530631df905eb5c0e26d0b20d7d548e0c465 (patch)
tree9750c490522529844a3e5104d25fd65abc1e1182 /ports/darknet
parente6a21e1b421e8231f3eb46d8af574a990b5da8c8 (diff)
downloadvcpkg-a3a6530631df905eb5c0e26d0b20d7d548e0c465.tar.gz
vcpkg-a3a6530631df905eb5c0e26d0b20d7d548e0c465.zip
[vcpkg_check_features] Set output variable explicitly and allow reverse-logic check (#7558)
* [vcpkg_check_features] Set OUT_EXPAND_OPTIONS explicitly * [vcpkg_check_features] Allow reverse logic for features * [vcpkg_check_features] Document new parameters * [vcpkg_check_features] Remove unnecessary logging * Do not create variables for each feature only set OUT_FEATURE_OPTIONS * Improve documentation * Update ports that use vcpkg_check_features() * Missing documentation updates * [pcl] Fix tools feature * [opencv,opencv4] Fix usage of vcpkg_check_features() * [opencv4] Fix typo
Diffstat (limited to 'ports/darknet')
-rw-r--r--ports/darknet/CONTROL4
-rw-r--r--ports/darknet/portfile.cmake16
2 files changed, 7 insertions, 13 deletions
diff --git a/ports/darknet/CONTROL b/ports/darknet/CONTROL
index 812f66a2c..6979c310c 100644
--- a/ports/darknet/CONTROL
+++ b/ports/darknet/CONTROL
@@ -1,5 +1,5 @@
Source: darknet
-Version: 0.2.5-5
+Version: 0.2.5-6
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
@@ -19,5 +19,5 @@ Feature: weights-train
Description: Download pre-built weights for training
Feature: opencv-cuda
-Build-Depends: opencv[ffmpeg], opencv[cuda]
+Build-Depends: darknet[opencv], darknet[cuda]
Description: Build darknet with support for a CUDA-enabled OpenCV
diff --git a/ports/darknet/portfile.cmake b/ports/darknet/portfile.cmake
index 83f68b6d7..a18c97a91 100644
--- a/ports/darknet/portfile.cmake
+++ b/ports/darknet/portfile.cmake
@@ -16,17 +16,12 @@ vcpkg_from_github(
HEAD_REF master
)
-vcpkg_check_features(
- "cuda" ENABLE_CUDA
- "opencv" ENABLE_OPENCV
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ "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 ("cuda" IN_LIST FEATURES)
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")
@@ -80,8 +75,7 @@ vcpkg_configure_cmake(
OPTIONS
-DINSTALL_BIN_DIR:STRING=bin
-DINSTALL_LIB_DIR:STRING=lib
- -DENABLE_CUDA=${ENABLE_CUDA}
- -DENABLE_OPENCV=${ENABLE_OPENCV}
+ ${FEATURE_OPTIONS}
)
vcpkg_install_cmake()