Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[realsense2] Enable OpenNI2 driver option #5275

Merged
merged 6 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion ports/realsense2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Source: realsense2
Version: 2.22.0
Version: 2.22.0-1
Homepage: https://github.com/IntelRealSense/librealsense
Description: Intel® RealSense™ SDK 2.0 is a cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300).

Feature: tools
Build-Depends: opengl
Description: Build Intel® RealSense™ examples and tools

Feature: openni2
Build-Depends: openni2
Description: Build Intel® RealSense™ OpenNI2 driver
18 changes: 18 additions & 0 deletions ports/realsense2/fix_openni2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/wrappers/openni2/CMakeLists.txt b/wrappers/openni2/CMakeLists.txt
index 0eee84c2..769e67ff 100755
--- a/wrappers/openni2/CMakeLists.txt
+++ b/wrappers/openni2/CMakeLists.txt
@@ -6,12 +6,7 @@ set(OPENNI2_DIR "c:/Program Files/OpenNI2" CACHE FILEPATH "OpenNI2 SDK directory
set(REALSENSE2_DIR "c:/Program Files (x86)/Intel RealSense SDK 2.0" CACHE FILEPATH "RealSense2 SDK directory")

# INCLUDE DIR
-if (UNIX)
- include_directories (${OPENNI2_DIR})
-else ()
- include_directories (${OPENNI2_DIR}/Include)
-endif ()
-
+include_directories (${OPENNI2_DIR})
include_directories (${REALSENSE2_DIR}/include)
include_directories (src)

27 changes: 20 additions & 7 deletions ports/realsense2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ vcpkg_from_github(
REF v2.22.0
SHA512 7595780c1955a2d4a91df5b70ab6366c672f389bc3d2dcb9f2e78a2ea1fc875c65f878103df483205e17f62dfd024ee5f7ccb15afc5d18978d3c25aa071652ab
HEAD_REF development
PATCHES
"fix_openni2.patch"
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE)

set(BUILD_EXAMPLES OFF)
set(BUILD_GRAPHICAL_EXAMPLES OFF)
set(BUILD_TOOLS OFF)
if("tools" IN_LIST FEATURES)
set(BUILD_EXAMPLES ON)
set(BUILD_GRAPHICAL_EXAMPLES ON)
set(BUILD_TOOLS ON)
endif()

set(BUILD_OPENNI2_BINDINGS OFF)
if(("openni2" IN_LIST FEATURES) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic"))
set(BUILD_OPENNI2_BINDINGS ON)
endif()

vcpkg_configure_cmake(
Expand All @@ -26,9 +31,11 @@ vcpkg_configure_cmake(
-DBUILD_WITH_OPENMP=OFF
-DBUILD_UNIT_TESTS=OFF
-DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE}
-DBUILD_OPENNI2_BINDINGS=${BUILD_OPENNI2_BINDINGS}
-DOPENNI2_DIR=${CURRENT_INSTALLED_DIR}/include/openni2
OPTIONS_RELEASE
-DBUILD_EXAMPLES=${BUILD_EXAMPLES}
-DBUILD_GRAPHICAL_EXAMPLES=${BUILD_GRAPHICAL_EXAMPLES}
-DBUILD_EXAMPLES=${BUILD_TOOLS}
-DBUILD_GRAPHICAL_EXAMPLES=${BUILD_TOOLS}
OPTIONS_DEBUG
-DBUILD_EXAMPLES=OFF
-DBUILD_GRAPHICAL_EXAMPLES=OFF
Expand All @@ -44,7 +51,7 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

if(BUILD_EXAMPLES)
if(BUILD_TOOLS)
file(GLOB EXEFILES_RELEASE
${CURRENT_PACKAGES_DIR}/bin/rs-*
${CURRENT_PACKAGES_DIR}/bin/realsense-*
Expand All @@ -63,5 +70,11 @@ if(BUILD_EXAMPLES)
endif()
endif()


if(BUILD_OPENNI2_BINDINGS)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/_out/rs2driver*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error

CMake Error at ports/realsense2/portfile.cmake:75 (file):
file COPY cannot find
"E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver*".
Call Stack (most recent call first):
scripts/ports.cmake:74 (include)

ls E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver*

E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.dll
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.dll.manifest
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.exp
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.lib
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.pdb

copy tools /openni2 ? *.lib? why?

DESTINATION ${CURRENT_PACKAGES_DIR}/tools/openni2/OpenNI2/Drivers)
endif()

file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/realsense2)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/realsense2/LICENSE ${CURRENT_PACKAGES_DIR}/share/realsense2/copyright)