Skip to content

Commit

Permalink
[azure-kinect-sensor-sdk] fix single config builds (microsoft#42719)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neumann-A authored Dec 16, 2024
1 parent 78df968 commit 3c24aa3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ports/azure-kinect-sensor-sdk/fix-builds.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ index 4f002b5..dd9b1df 100644
+add_library(libjpeg-turbo::libjpeg-turbo UNKNOWN IMPORTED)
+set_property(TARGET libjpeg-turbo::libjpeg-turbo PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TURBOJPEG_INCLUDE_DIR})
+set_property(TARGET libjpeg-turbo::libjpeg-turbo PROPERTY IMPORTED_LOCATION_RELEASE ${TURBOJPEG_LIBRARY_RELEASE})
+if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib")
+ find_library(TURBOJPEG_LIBRARY_DEBUG NAMES turbojpeg PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH REQUIRED)
+find_library(TURBOJPEG_LIBRARY_DEBUG NAMES turbojpeg PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
+if(TURBOJPEG_LIBRARY_DEBUG)
+ set_property(TARGET libjpeg-turbo::libjpeg-turbo PROPERTY IMPORTED_LOCATION_DEBUG ${TURBOJPEG_LIBRARY_DEBUG})
+endif()
+find_package(Matroska CONFIG REQUIRED)
Expand Down
14 changes: 10 additions & 4 deletions ports/azure-kinect-sensor-sdk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()

# Avoid deleting debug/lib/cmake when fixing the first cmake
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/cmake" "${CURRENT_PACKAGES_DIR}/debug/share")
if(NOT VCPKG_BUILD_TYPE)
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/cmake" "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/cmake" "${CURRENT_PACKAGES_DIR}/share")

vcpkg_cmake_config_fixup(PACKAGE_NAME k4a CONFIG_PATH share/k4a)
Expand Down Expand Up @@ -83,12 +85,16 @@ endif ()

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")
if(NOT VCPKG_BUILD_TYPE)
file(COPY "${PACKAGE_PATH}/linux/lib/native/${VCPKG_TARGET_ARCHITECTURE}/release/libdepthengine.so.2.0" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
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")
if(NOT VCPKG_BUILD_TYPE)
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}/debug/tools/azure-kinect-sensor-sdk")
endif()
endif()

# Handle copyright
Expand Down
2 changes: 1 addition & 1 deletion ports/azure-kinect-sensor-sdk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-kinect-sensor-sdk",
"version": "1.4.1",
"port-version": 7,
"port-version": 8,
"description": "Azure Kinect SDK is a cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.",
"homepage": "https://github.com/microsoft/Azure-Kinect-Sensor-SDK",
"supports": "linux | windows",
Expand Down
5 changes: 5 additions & 0 deletions versions/a-/azure-kinect-sensor-sdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f19cdb3144d4296ac862b6e94c9967c056325476",
"version": "1.4.1",
"port-version": 8
},
{
"git-tree": "a684e03aa0836ede2caba93683bee3fd3d1ed15f",
"version": "1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
},
"azure-kinect-sensor-sdk": {
"baseline": "1.4.1",
"port-version": 7
"port-version": 8
},
"azure-macro-utils-c": {
"baseline": "2022-01-21",
Expand Down

0 comments on commit 3c24aa3

Please sign in to comment.