diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/realsense2 | |
Diffstat (limited to 'vcpkg/ports/realsense2')
| -rw-r--r-- | vcpkg/ports/realsense2/add-include-chrono.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/add-stdexcept.diff | 24 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/android-config.diff | 12 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/build.diff | 75 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/devendor-lz4.diff | 33 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/devendor-nlohmann-json.diff | 27 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/devendor-stb.diff | 52 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/fix_openni2.patch | 18 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/libusb.diff | 15 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/portfile.cmake | 102 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/usage | 8 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/using-firmware.diff | 48 | ||||
| -rw-r--r-- | vcpkg/ports/realsense2/vcpkg.json | 54 |
13 files changed, 480 insertions, 0 deletions
diff --git a/vcpkg/ports/realsense2/add-include-chrono.patch b/vcpkg/ports/realsense2/add-include-chrono.patch new file mode 100644 index 0000000..62bfc5f --- /dev/null +++ b/vcpkg/ports/realsense2/add-include-chrono.patch @@ -0,0 +1,12 @@ +diff --git a/src/platform/uvc-device.h b/src/platform/uvc-device.h +index 48bd19e..b626799 100644 +--- a/src/platform/uvc-device.h ++++ b/src/platform/uvc-device.h +@@ -15,6 +15,7 @@ + #include <functional> + #include <memory> + #include <set> ++#include <chrono> + #include <thread> + #include <algorithm> // find + diff --git a/vcpkg/ports/realsense2/add-stdexcept.diff b/vcpkg/ports/realsense2/add-stdexcept.diff new file mode 100644 index 0000000..01a0bbd --- /dev/null +++ b/vcpkg/ports/realsense2/add-stdexcept.diff @@ -0,0 +1,24 @@ +diff --git a/src/core/matcher-factory.cpp b/src/core/matcher-factory.cpp +index ea94209..580af62 100644 +--- a/src/core/matcher-factory.cpp ++++ b/src/core/matcher-factory.cpp +@@ -6,6 +6,7 @@ + #include "stream-interface.h" + + #include <src/sync.h> ++#include <stdexcept> + + + namespace librealsense { +diff --git a/src/core/options-registry.cpp b/src/core/options-registry.cpp +index d22b142..68c62d5 100644 +--- a/src/core/options-registry.cpp ++++ b/src/core/options-registry.cpp +@@ -7,6 +7,7 @@ + #include <vector> + #include <mutex> + #include <map> ++#include <stdexcept> + + + namespace librealsense { diff --git a/vcpkg/ports/realsense2/android-config.diff b/vcpkg/ports/realsense2/android-config.diff new file mode 100644 index 0000000..62a6a92 --- /dev/null +++ b/vcpkg/ports/realsense2/android-config.diff @@ -0,0 +1,12 @@ +diff --git a/CMake/android_config.cmake b/CMake/android_config.cmake +index 203003e..487e60a 100644 +--- a/CMake/android_config.cmake ++++ b/CMake/android_config.cmake +@@ -10,7 +10,6 @@ macro(os_set_flags) + set(BUILD_TOOLS OFF) + set(BUILD_WITH_OPENMP OFF) + set(BUILD_GRAPHICAL_EXAMPLES OFF) +- set(ANDROID_STL "c++_static") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -pedantic -g -D_DEFAULT_SOURCE") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pedantic -g -Wno-missing-field-initializers") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar") diff --git a/vcpkg/ports/realsense2/build.diff b/vcpkg/ports/realsense2/build.diff new file mode 100644 index 0000000..efa9089 --- /dev/null +++ b/vcpkg/ports/realsense2/build.diff @@ -0,0 +1,75 @@ +diff --git a/src/algo.cpp b/src/algo.cpp +index e6b3210..524f2a8 100644 +--- a/src/algo.cpp ++++ b/src/algo.cpp +@@ -5,6 +5,8 @@ + #include "option.h" + #include "core/video-frame.h" + ++#include <algorithm> ++ + using namespace librealsense; + + bool auto_exposure_state::get_enable_auto_exposure() const +diff --git a/src/librealsense-exception.h b/src/librealsense-exception.h +index c9ce838..f02f42f 100644 +--- a/src/librealsense-exception.h ++++ b/src/librealsense-exception.h +@@ -7,6 +7,7 @@ + #include <rsutils/easylogging/easyloggingpp.h> + #include "basics.h" // LRS_EXTENSION_API + ++#include <cstring> + #include <exception> + #include <string> + +diff --git a/src/linux/backend-hid.h b/src/linux/backend-hid.h +index bc70bfd..2a989f0 100644 +--- a/src/linux/backend-hid.h ++++ b/src/linux/backend-hid.h +@@ -6,6 +6,7 @@ + #include "types.h" + + #include <limits.h> ++#include <fstream> + #include <list> + + namespace librealsense +diff --git a/src/platform/platform-utils.cpp b/src/platform/platform-utils.cpp +index 0cfa3a7..12e5868 100644 +--- a/src/platform/platform-utils.cpp ++++ b/src/platform/platform-utils.cpp +@@ -7,6 +7,8 @@ + #include "hid-device-info.h" + #include <src/librealsense-exception.h> + ++#include <algorithm> ++using std::find; + + namespace librealsense { + namespace platform { +diff --git a/third-party/rsutils/src/network-adapter-watcher.cpp b/third-party/rsutils/src/network-adapter-watcher.cpp +index 942fa1f..48414b4 100644 +--- a/third-party/rsutils/src/network-adapter-watcher.cpp ++++ b/third-party/rsutils/src/network-adapter-watcher.cpp +@@ -26,6 +26,8 @@ + #endif + #endif // ! __APPLE__ && ! __ANDROID__ + ++#include <cstring> ++#include <thread> + + namespace rsutils { + namespace os { +diff --git a/third-party/rsutils/src/special-folder.cpp b/third-party/rsutils/src/special-folder.cpp +index 79bc45d..c06afa6 100644 +--- a/third-party/rsutils/src/special-folder.cpp ++++ b/third-party/rsutils/src/special-folder.cpp +@@ -18,6 +18,7 @@ + + #endif + ++#include <stdexcept> + + namespace rsutils { + namespace os { diff --git a/vcpkg/ports/realsense2/devendor-lz4.diff b/vcpkg/ports/realsense2/devendor-lz4.diff new file mode 100644 index 0000000..04107fe --- /dev/null +++ b/vcpkg/ports/realsense2/devendor-lz4.diff @@ -0,0 +1,33 @@ +diff --git a/third-party/realsense-file/rosbag/roslz4/include/roslz4/lz4s.h b/third-party/realsense-file/rosbag/roslz4/include/roslz4/lz4s.h +index 30dce1a..6d8dd27 100644 +--- a/third-party/realsense-file/rosbag/roslz4/include/roslz4/lz4s.h ++++ b/third-party/realsense-file/rosbag/roslz4/include/roslz4/lz4s.h +@@ -35,7 +35,7 @@ + #ifndef ROSLZ4_LZ4S_H + #define ROSLZ4_LZ4S_H + +-#include "../../../../lz4/lz4.h" ++#include <lz4.h> + + #ifdef __cplusplus + extern "C" { +diff --git a/tools/embed/CMakeLists.txt b/tools/embed/CMakeLists.txt +index 77b1b9b..4fd9aa1 100644 +--- a/tools/embed/CMakeLists.txt ++++ b/tools/embed/CMakeLists.txt +@@ -10,13 +10,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1) + + add_executable(rs-embed + rs-embed.cpp +- ${LZ4_DIR}/lz4.h +- ${LZ4_DIR}/lz4.c + ) + + set_property(TARGET rs-embed PROPERTY CXX_STANDARD 11) + +-include_directories(rs-embed ${LZ4_DIR} ../../third-party) ++find_package(lz4 CONFIG REQUIRED) ++target_link_libraries(rs-embed PRIVATE lz4::lz4) + target_link_libraries( rs-embed PRIVATE tclap ) + set_target_properties (rs-embed PROPERTIES FOLDER Tools) + diff --git a/vcpkg/ports/realsense2/devendor-nlohmann-json.diff b/vcpkg/ports/realsense2/devendor-nlohmann-json.diff new file mode 100644 index 0000000..ae881f4 --- /dev/null +++ b/vcpkg/ports/realsense2/devendor-nlohmann-json.diff @@ -0,0 +1,27 @@ +diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt +index c28e66c..18df754 100644 +--- a/third-party/CMakeLists.txt ++++ b/third-party/CMakeLists.txt +@@ -5,7 +5,6 @@ add_subdirectory( "${CMAKE_CURRENT_LIST_DIR}/rsutils" ) + + pop_security_flags() # remove security flags for third party, as we cannot guarantee their security enforcment + +-include(CMake/external_json.cmake) + # Add additional include directories to allow file to include rosbag headers + include(${_rel_path}/realsense-file/config.cmake) + +diff --git a/third-party/rsutils/CMakeLists.txt b/third-party/rsutils/CMakeLists.txt +index b0fc310..50aa0e4 100644 +--- a/third-party/rsutils/CMakeLists.txt ++++ b/third-party/rsutils/CMakeLists.txt +@@ -12,8 +12,9 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER Library ) + target_include_directories( ${PROJECT_NAME} + PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> +- $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/third-party/json/include> + ) ++find_package(nlohmann_json CONFIG REQUIRED) ++target_link_libraries(${PROJECT_NAME} PUBLIC $<BUILD_LOCAL_INTERFACE:nlohmann_json::nlohmann_json>) + + # Headers ----------------------------------------------------------------------------------- + # diff --git a/vcpkg/ports/realsense2/devendor-stb.diff b/vcpkg/ports/realsense2/devendor-stb.diff new file mode 100644 index 0000000..fc1de21 --- /dev/null +++ b/vcpkg/ports/realsense2/devendor-stb.diff @@ -0,0 +1,52 @@ +diff --git a/common/rendering.h b/common/rendering.h +index ed0b525..a36b5ff 100644 +--- a/common/rendering.h ++++ b/common/rendering.h +@@ -233,7 +233,7 @@ namespace rs2 + // Simple font loading code // + ////////////////////////////// + +-#include "../third-party/stb_easy_font.h" ++#include <stb_easy_font.h> + + inline void draw_text(int x, int y, const char * text) + { +diff --git a/src/proc/color-formats-converter.cpp b/src/proc/color-formats-converter.cpp +index f0a54ba..13411fe 100644 +--- a/src/proc/color-formats-converter.cpp ++++ b/src/proc/color-formats-converter.cpp +@@ -9,7 +9,7 @@ + + #define STB_IMAGE_STATIC + #define STB_IMAGE_IMPLEMENTATION +-#include "../third-party/stb_image.h" ++#include <stb_image.h> + + #ifdef RS2_USE_CUDA + #include "cuda/cuda-conversion.cuh" +diff --git a/tools/convert/converters/converter-png.hpp b/tools/convert/converters/converter-png.hpp +index fcfd6ce..adbb1e6 100644 +--- a/tools/convert/converters/converter-png.hpp ++++ b/tools/convert/converters/converter-png.hpp +@@ -7,7 +7,7 @@ + + // 3rd party header for writing png files + #define STB_IMAGE_WRITE_IMPLEMENTATION +-#include <third-party/stb_image_write.h> ++#include <stb_image_write.h> + + #include "../converter.hpp" + +diff --git a/tools/embed/CMakeLists.txt b/tools/embed/CMakeLists.txt +index 4fd9aa1..951bfa6 100644 +--- a/tools/embed/CMakeLists.txt ++++ b/tools/embed/CMakeLists.txt +@@ -19,6 +19,8 @@ target_link_libraries(rs-embed PRIVATE lz4::lz4) + target_link_libraries( rs-embed PRIVATE tclap ) + set_target_properties (rs-embed PROPERTIES FOLDER Tools) + ++find_package(Stb REQUIRED) ++target_include_directories(rs-embed PRIVATE "${Stb_INCLUDE_DIR}") + + install( + TARGETS diff --git a/vcpkg/ports/realsense2/fix_openni2.patch b/vcpkg/ports/realsense2/fix_openni2.patch new file mode 100644 index 0000000..541f837 --- /dev/null +++ b/vcpkg/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/vcpkg/ports/realsense2/libusb.diff b/vcpkg/ports/realsense2/libusb.diff new file mode 100644 index 0000000..7738225 --- /dev/null +++ b/vcpkg/ports/realsense2/libusb.diff @@ -0,0 +1,15 @@ +diff --git a/CMake/libusb_config.cmake b/CMake/libusb_config.cmake +index ca221ca..b62369e 100644 +--- a/CMake/libusb_config.cmake ++++ b/CMake/libusb_config.cmake +@@ -1,6 +1,8 @@ + if (NOT TARGET usb) +- find_library(LIBUSB_LIB usb-1.0) +- find_path(LIBUSB_INC libusb.h HINTS PATH_SUFFIXES libusb-1.0) ++ find_package(PkgConfig) ++ pkg_check_modules(PC_LIBUSB libusb-1.0 REQUIRED) ++ set(LIBUSB_LIB "${PC_LIBUSB_LINK_LIBRARIES}") ++ set(LIBUSB_INC "${PC_LIBUSB_INCLUDE_DIRS}") + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(usb "libusb not found; using internal version" LIBUSB_LIB LIBUSB_INC) + if (USB_FOUND AND NOT USE_EXTERNAL_USB) diff --git a/vcpkg/ports/realsense2/portfile.cmake b/vcpkg/ports/realsense2/portfile.cmake new file mode 100644 index 0000000..c88c5ec --- /dev/null +++ b/vcpkg/ports/realsense2/portfile.cmake @@ -0,0 +1,102 @@ +vcpkg_download_distfile(lz4_patch + URLS https://github.com/IntelRealSense/librealsense/commit/20748445a8e24bee148d8b6f67f3a6c3f259cced.diff?full_index=1 + SHA512 90d754e7da6931b607429035c2fa14aa1137e28fa88d04f5e90220f57fc808fd256b516840922d0938d6b0f3f30b937ddc3568865c9a21fa1a2d8a51788e6f9a + FILENAME IntelRealSense-librealsense-lz4.diff +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO IntelRealSense/librealsense + REF "v${VERSION}" + SHA512 5b5998560ab6a7d81a23b1d84194f4cf3e123af1d46711127d838dc37c3eb1414f232bf0e1a444c68212fabcd79c3e4e1c47ff87b878266558e0027bd522447f + HEAD_REF master + PATCHES + add-include-chrono.patch # https://github.com/IntelRealSense/librealsense/pull/13537 + android-config.diff + build.diff + "${lz4_patch}" + devendor-lz4.diff # https://github.com/IntelRealSense/librealsense/pull/13803#issuecomment-3072432118 + devendor-nlohmann-json.diff + devendor-stb.diff + fix_openni2.patch + libusb.diff + using-firmware.diff + add-stdexcept.diff # https://github.com/IntelRealSense/librealsense/pull/14299 +) +file(GLOB extern "${SOURCE_PATH}/CMake/extern_*.cmake") +file(REMOVE_RECURSE + ${extern} + "${SOURCE_PATH}/third-party/easyloggingpp" + "${SOURCE_PATH}/third-party/realsense-file/lz4" + "${SOURCE_PATH}/third-party/stb_easy_font.h" + "${SOURCE_PATH}/third-party/stb_image.h" + "${SOURCE_PATH}/third-party/stb_image_write.h" +) + +file(READ "${SOURCE_PATH}/common/fw/firmware-version.h" firmware_version_h) +string(REGEX MATCH "D4XX_RECOMMENDED_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" unused "${firmware_version_h}") +set(firmware_filename "D4XX_FW_Image-${CMAKE_MATCH_1}.bin") +vcpkg_download_distfile(firmware_distfile + URLS "https://librealsense.intel.com/Releases/RS4xx/FW/${firmware_filename}" + SHA512 c465cedba2a8df713fb7900bb60a448b15e53ac013175cf7c152909bc9f2324cf46efd1323954633d7c011e33a27f9426eb1347ad48d92839a68c7e4fa680f94 + FILENAME "IntelRealSense-${firmware_filename}" +) + +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + openni2 BUILD_OPENNI2_BINDINGS + rs-usb-backend FORCE_RSUSB_BACKEND + tools BUILD_TOOLS +) + +if("rs-usb-backend" IN_LIST FEATURES) + vcpkg_find_acquire_program(PKGCONFIG) + list(APPEND FEATURE_OPTIONS "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}") +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DBUILD_EASYLOGGINGPP=OFF + -DBUILD_EXAMPLES=OFF + -DBUILD_GRAPHICAL_EXAMPLES=OFF + -DBUILD_RS2_ALL=NO + -DBUILD_UNIT_TESTS=OFF + -DBUILD_WITH_OPENMP=OFF + -DBUILD_WITH_STATIC_CRT=${BUILD_WITH_STATIC_CRT} + -DENABLE_CCACHE=OFF + -DENFORCE_METADATA=ON + "-DFIRMWARE_DISTFILE=${firmware_distfile}" + "-DOPENNI2_DIR=${CURRENT_INSTALLED_DIR}/include/openni2" + -DUSE_EXTERNAL_LZ4=ON + OPTIONS_DEBUG + -DBUILD_TOOLS=OFF + MAYBE_UNUSED_VARIABLES + OPENNI2_DIR +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/realsense2) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +if(BUILD_TOOLS) + set(TOOL_NAMES rs-convert rs-embed rs-enumerate-devices rs-fw-logger rs-fw-update rs-record rs-terminal) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() + +if(BUILD_OPENNI2_BINDINGS) + file(GLOB RS2DRIVER "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/_out/rs2driver*") + if(RS2DRIVER) + file(COPY ${RS2DRIVER} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/openni2/OpenNI2/Drivers") + endif() +endif() + +file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/realsense2/usage b/vcpkg/ports/realsense2/usage new file mode 100644 index 0000000..613c658 --- /dev/null +++ b/vcpkg/ports/realsense2/usage @@ -0,0 +1,8 @@ +realsense2 provides CMake targets: + + find_package(realsense2 CONFIG REQUIRED) + target_link_libraries(main PRIVATE realsense2::realsense2) + +realsense2 provides pkg-config modules: + + realsense2 diff --git a/vcpkg/ports/realsense2/using-firmware.diff b/vcpkg/ports/realsense2/using-firmware.diff new file mode 100644 index 0000000..5bdb93c --- /dev/null +++ b/vcpkg/ports/realsense2/using-firmware.diff @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 24cfb79..b9aafc5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,6 @@ set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) + include_directories(${REPO_ROOT}) + + include(CMake/lrs_options.cmake) +-include(CMake/connectivity_check.cmake) + #Deprecation message, should be removed in future releases + if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC}) + MESSAGE(DEPRECATION "FORCE_LIBUVC, FORCE_WINUSB_UVC and ANDROID_USB_HOST_UVC are deprecated, use FORCE_RSUSB_BACKEND instead") +@@ -17,7 +16,7 @@ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC}) + endif() + + # Checking Internet connection, as DEPTH CAM needs to download the FW from amazon cloud +-if(IMPORT_DEPTH_CAM_FW AND NOT INTERNET_CONNECTION) ++if(0) + message(WARNING "No internet connection, disabling IMPORT_DEPTH_CAM_FW") + set(IMPORT_DEPTH_CAM_FW OFF) + endif() +diff --git a/common/fw/CMakeLists.txt b/common/fw/CMakeLists.txt +index f270844..84538cf 100644 +--- a/common/fw/CMakeLists.txt ++++ b/common/fw/CMakeLists.txt +@@ -31,7 +31,11 @@ if (MSVC) + # even then, the linker won't grab a .res out of a .lib object, so it needs to be explicitly listed + # and to find the name of the .res file (across cmake generators) we need to create our own rule. :( + add_custom_command(TARGET ${PROJECT_NAME} BYPRODUCTS ${PROJECT_NAME}.res COMMAND ${CMAKE_RC_COMPILER} ${CMAKE_RC_FLAGS} /I . /fo "${PROJECT_NAME}.res" "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.rc") +- target_link_libraries(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.res") ++ target_link_libraries(${PROJECT_NAME} PUBLIC ++ "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.res>" ++ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/lib/realsense2/${PROJECT_NAME}.res>" ++ ) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.res" DESTINATION "lib/realsense2") + endif() + + target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) +@@ -39,8 +43,7 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Resources) + + function(target_binary url version sha1 symbol ext) + set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-${version}${ext}") +- message(STATUS "... ${url}/${symbol}-${version}${ext}") +- file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}" ++ file(DOWNLOAD "file://${FIRMWARE_DISTFILE}" "${binary}" + EXPECTED_HASH SHA1=${sha1} + STATUS status) + list(GET status 0 error_code) diff --git a/vcpkg/ports/realsense2/vcpkg.json b/vcpkg/ports/realsense2/vcpkg.json new file mode 100644 index 0000000..e527c8f --- /dev/null +++ b/vcpkg/ports/realsense2/vcpkg.json @@ -0,0 +1,54 @@ +{ + "name": "realsense2", + "version": "2.56.3", + "port-version": 1, + "description": "Intel® RealSense™ SDK 2.0 is a cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300).", + "homepage": "https://github.com/IntelRealSense/librealsense", + "license": "Apache-2.0", + "supports": "!uwp & !(windows & arm)", + "dependencies": [ + { + "name": "libusb", + "platform": "!windows" + }, + "lz4", + "nlohmann-json", + { + "name": "realsense2", + "default-features": false, + "features": [ + "rs-usb-backend" + ], + "platform": "android | osx" + }, + "stb", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "openni2": { + "description": "Build Intel® RealSense™ OpenNI2 driver", + "supports": "!static", + "dependencies": [ + "openni2" + ] + }, + "rs-usb-backend": { + "description": "Use RS USB backend", + "supports": "!windows", + "dependencies": [ + "libusb" + ] + }, + "tools": { + "description": "Build Intel® RealSense™ tools", + "supports": "!android" + } + } +} |