diff --git a/ports/realsense2/CONTROL b/ports/realsense2/CONTROL index 34698dbd65..40341f080a 100644 --- a/ports/realsense2/CONTROL +++ b/ports/realsense2/CONTROL @@ -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 diff --git a/ports/realsense2/fix_openni2.patch b/ports/realsense2/fix_openni2.patch new file mode 100644 index 0000000000..541f8376af --- /dev/null +++ b/ports/realsense2/fix_openni2.patch @@ -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) + diff --git a/ports/realsense2/portfile.cmake b/ports/realsense2/portfile.cmake index 8d5def7c80..decc9b504b 100644 --- a/ports/realsense2/portfile.cmake +++ b/ports/realsense2/portfile.cmake @@ -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( @@ -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 @@ -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-* @@ -63,5 +70,11 @@ if(BUILD_EXAMPLES) endif() endif() + +if(BUILD_OPENNI2_BINDINGS) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/_out/rs2driver* + 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)