Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/azure-kinect-sensor-sdk/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: azure-kinect-sensor-sdk
Version: 1.4.0-alpha.0-4
Version: 1.4.0-alpha.0-5
Homepage: https://github.com/microsoft/Azure-Kinect-Sensor-SDK
Description: Azure Kinect SDK is a cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
Build-Depends: azure-c-shared-utility, glfw3, gtest, imgui, libusb, spdlog, cjson, ebml, libjpeg-turbo, matroska, libsoundio, libyuv
Expand Down
10 changes: 10 additions & 0 deletions ports/azure-kinect-sensor-sdk/k4adeploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Note: This function signature and behavior is depended upon by applocal.ps1

function deployAzureKinectSensorSDK([string]$targetBinaryDir, [string]$installedDir, [string]$targetBinaryName) {
if ($targetBinaryName -like "k4a.dll") {
if(Test-Path "$installedDir\tools\azure-kinect-sensor-sdk\depthengine_2_0.dll") {
Write-Verbose " Deploying Azure Kinect Sensor SDK Initialization"
deployBinary "$targetBinaryDir" "$installedDir\tools\azure-kinect-sensor-sdk\" "depthengine_2_0.dll"
}
}
}
32 changes: 30 additions & 2 deletions ports/azure-kinect-sensor-sdk/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set(VERSION 1.4.0-alpha.0)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO microsoft/Azure-Kinect-Sensor-SDK
REF 17b644560ce7b4ee7dd921dfff0ae811aa54ede6 #v1.4.0-alpha.0
SHA512 2746eebe5ef66c4b9d2215b6883723fca66dab77d405c662cc2af9364dc7fcd76aade396d23427db5797e0a534764eb2398890930ff3c792d0df8a681ce31462
REF v${VERSION}
SHA512 bf09ff92dc1b8621a941d838aef9c804bb5635f7984b7f86f01a38441d44935db764b69483d598e1f2c0aafb5c7ec196ef9c722967d92e6d075cb67ce781fea9
HEAD_REF master
PATCHES
fix-builds.patch
Expand Down Expand Up @@ -59,5 +60,32 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

# Install Depth Engine
vcpkg_download_distfile(ARCHIVE
URLS "https://www.nuget.org/api/v2/package/Microsoft.Azure.Kinect.Sensor/${VERSION}"
FILENAME "azure-kinect-sensor-sdk.zip"
SHA512 6c15975e7c834672de723b0c474fa4cd58f41c5bee6511dcbdbc22f1a58daa906c4f01a7e941af0e7d09f763ff886015c1f6b1e29b6bdfb333f10857edfec2ca
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH PACKAGE_PATH
ARCHIVE ${ARCHIVE}
NO_REMOVE_ONE_LEVEL
)

set(ARCHITECTURE "")
if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(ARCHITECTURE "x86")
elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(ARCHITECTURE "amd64")
else ()
message(FATAL_ERROR "this architecture is not supported.")
endif ()

file(COPY ${PACKAGE_PATH}/lib/native/${ARCHITECTURE}/release/depthengine_2_0.dll DESTINATION ${CURRENT_PACKAGES_DIR}/tools/azure-kinect-sensor-sdk)
file(COPY ${PACKAGE_PATH}/lib/native/${ARCHITECTURE}/release/depthengine_2_0.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/azure-kinect-sensor-sdk)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/k4adeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/azure-kinect-sensor-sdk)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/k4adeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/azure-kinect-sensor-sdk)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
6 changes: 6 additions & 0 deletions scripts/buildsystems/msbuild/applocal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function resolve([string]$targetBinary) {
deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum" "$_"
}
}
if (Test-Path function:\deployAzureKinectSensorSDK) { deployAzureKinectSensorSDK $targetBinaryDir "$g_install_root" "$_" }
resolve "$baseTargetBinaryDir\$_"
} elseif (Test-Path "$targetBinaryDir\$_") {
Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed"
Expand Down Expand Up @@ -107,5 +108,10 @@ if (Test-Path "$g_install_root\bin\magnum\magnumdeploy.ps1") {
. "$g_install_root\bin\magnum-d\magnumdeploy.ps1"
}

# Note: This is a hack to make Azure Kinect Sensor SDK work.
if (Test-Path "$g_install_root\tools\azure-kinect-sensor-sdk\k4adeploy.ps1") {
. "$g_install_root\tools\azure-kinect-sensor-sdk\k4adeploy.ps1"
}

resolve($targetBinary)
Write-Verbose $($g_searched | out-string)