2021-03-12 04:17:41 +08:00
|
|
|
set(VERSION 1.4.1)
|
2019-12-24 07:59:34 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO microsoft/Azure-Kinect-Sensor-SDK
|
2020-05-09 06:35:59 +09:00
|
|
|
REF v${VERSION}
|
2021-03-12 04:17:41 +08:00
|
|
|
SHA512 ef94c072caae43b0a105b192013e09082d267d4064e6676fac981b52e7576a663f59fcb53f0afe66b425ef2cea0cb3aa224ff7be6485c0b5543ff9cdabd82d4d
|
2019-12-24 07:59:34 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
fix-builds.patch
|
2020-05-01 13:57:38 +08:00
|
|
|
fix-dependency-imgui.patch
|
2021-03-29 19:17:50 +02:00
|
|
|
fix-linux.patch
|
|
|
|
fix-calibration-c.patch
|
2019-12-24 07:59:34 +08:00
|
|
|
)
|
|
|
|
|
2020-01-11 02:47:09 +08:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
|
|
|
vcpkg_add_to_path("${PYTHON3_DIR}")
|
|
|
|
|
2019-12-24 07:59:34 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-07-20 12:24:58 -05:00
|
|
|
FEATURES
|
|
|
|
docs K4A_BUILD_DOCS
|
|
|
|
tool BUILD_TOOLS
|
2019-12-24 07:59:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# .rc file needs windows.h, so do not use PREFER_NINJA here
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2020-05-01 09:45:05 -07:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2019-12-24 07:59:34 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
|
|
|
-DK4A_SOURCE_LINK=OFF
|
|
|
|
-DK4A_MTE_VERSION=ON
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
2020-01-11 02:47:09 +08:00
|
|
|
-DWITH_TEST=OFF
|
2020-05-01 13:57:38 +08:00
|
|
|
-DIMGUI_EXTERNAL_PATH=${CURRENT_INSTALLED_DIR}/include/bindings
|
2019-12-24 07:59:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
# Avoid deleting debug/lib/cmake when fixing the first cmake
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/k4a TARGET_PATH share/k4a)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/k4arecord TARGET_PATH share/k4arecord)
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2020-05-01 13:57:38 +08:00
|
|
|
if ("tool" IN_LIST FEATURES)
|
|
|
|
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
|
|
|
|
file(GLOB AZURE_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX})
|
|
|
|
file(COPY ${AZURE_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
|
|
|
file(REMOVE ${AZURE_TOOLS})
|
|
|
|
endif()
|
|
|
|
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
|
|
|
|
file(GLOB AZURE_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX})
|
|
|
|
file(REMOVE ${AZURE_TOOLS})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-01-11 02:47:09 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
|
2020-05-09 06:35:59 +09:00
|
|
|
# Install Depth Engine
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://www.nuget.org/api/v2/package/Microsoft.Azure.Kinect.Sensor/${VERSION}"
|
2021-03-29 19:17:50 +02:00
|
|
|
FILENAME "azure-kinect-sensor-sdk_17630a00.zip"
|
|
|
|
SHA512 17630a00f4e9ff3ef68945b62021f6d0390030b43c120c207afe934075a7a87c5848be1f46f4c35c7ecd5698012452ffcbb67f739e9048857410ec7077e5e8c6
|
2020-05-09 06:35:59 +09:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH PACKAGE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
|
|
|
)
|
|
|
|
|
|
|
|
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 ()
|
|
|
|
|
2021-03-29 19:17:50 +02:00
|
|
|
if (VCPKG_TARGET_IS_LINUX)
|
|
|
|
file(COPY ${PACKAGE_PATH}/linux/lib/native/${VCPKG_TARGET_ARCHITECTURE}/release/libdepthengine.so.2.0 DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
|
|
|
file(COPY ${PACKAGE_PATH}/linux/lib/native/${VCPKG_TARGET_ARCHITECTURE}/release/libdepthengine.so.2.0 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
else()
|
|
|
|
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)
|
|
|
|
endif()
|
2020-05-09 06:35:59 +09:00
|
|
|
|
2019-12-24 07:59:34 +08:00
|
|
|
# Handle copyright
|
2020-05-09 06:35:59 +09:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|