2017-11-07 15:59:02 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO IntelRealSense/librealsense
|
2022-09-07 03:45:36 +08:00
|
|
|
REF v2.51.1
|
|
|
|
SHA512 e03a0188f11634ba645f321f190758807670fcaeaa2695c1d1ddc4585e43c2b00ca42b4e820b07f5e0c1ee7c026347b3802d4a86717a3d0500c359c08494aa32
|
2020-01-11 07:39:20 +08:00
|
|
|
HEAD_REF master
|
2019-06-18 07:04:18 +08:00
|
|
|
PATCHES
|
2019-09-24 01:43:25 +08:00
|
|
|
fix_openni2.patch
|
2021-06-03 10:22:16 +08:00
|
|
|
fix_config_osx.patch
|
2017-11-07 15:59:02 +08:00
|
|
|
)
|
|
|
|
|
2021-09-28 12:10:48 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/src/win7/drivers/IntelRealSense_D400_series_win7.inf" DESTINATION "${SOURCE_PATH}")
|
2018-04-18 01:01:22 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE)
|
|
|
|
|
2020-04-17 04:29:32 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-06-03 10:22:16 +08:00
|
|
|
FEATURES
|
|
|
|
tm2 BUILD_WITH_TM2
|
2021-09-28 12:10:48 +08:00
|
|
|
tools BUILD_TOOLS
|
2020-04-17 04:29:32 +08:00
|
|
|
)
|
|
|
|
|
2019-06-18 07:04:18 +08:00
|
|
|
set(BUILD_OPENNI2_BINDINGS OFF)
|
|
|
|
if(("openni2" IN_LIST FEATURES) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic"))
|
|
|
|
set(BUILD_OPENNI2_BINDINGS ON)
|
2018-04-18 01:01:22 +08:00
|
|
|
endif()
|
2017-11-07 15:59:02 +08:00
|
|
|
|
2021-01-20 07:28:30 +08:00
|
|
|
set(PLATFORM_OPTIONS)
|
|
|
|
if (VCPKG_TARGET_IS_ANDROID)
|
|
|
|
list(APPEND PLATFORM_OPTIONS -DFORCE_RSUSB_BACKEND=ON)
|
|
|
|
endif()
|
|
|
|
|
2021-09-28 12:10:48 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-04-17 04:29:32 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2017-12-24 22:46:16 +08:00
|
|
|
-DENFORCE_METADATA=ON
|
2018-03-08 03:01:49 +08:00
|
|
|
-DBUILD_WITH_OPENMP=OFF
|
2019-06-18 05:38:05 +08:00
|
|
|
-DBUILD_UNIT_TESTS=OFF
|
2018-03-08 03:01:49 +08:00
|
|
|
-DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE}
|
2019-06-18 07:04:18 +08:00
|
|
|
-DBUILD_OPENNI2_BINDINGS=${BUILD_OPENNI2_BINDINGS}
|
|
|
|
-DOPENNI2_DIR=${CURRENT_INSTALLED_DIR}/include/openni2
|
2021-01-20 07:28:30 +08:00
|
|
|
${PLATFORM_OPTIONS}
|
2018-04-24 22:07:37 +08:00
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_GRAPHICAL_EXAMPLES=OFF
|
2021-09-28 12:10:48 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
OPENNI2_DIR
|
2017-11-07 15:59:02 +08:00
|
|
|
)
|
|
|
|
|
2021-09-28 12:10:48 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-06-18 05:38:05 +08:00
|
|
|
|
2021-09-28 12:10:48 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/realsense2)
|
2021-11-30 09:05:33 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/realsense2/realsense2Targets.cmake" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "\${_IMPORT_PREFIX}")
|
2022-03-29 04:23:46 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/realsense2/realsense2Targets.cmake" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "\${_IMPORT_PREFIX}")
|
2021-11-30 09:05:33 +08:00
|
|
|
endif()
|
2018-04-18 01:01:22 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-11-07 15:59:02 +08:00
|
|
|
|
2021-09-28 12:10:48 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-11-07 15:59:02 +08:00
|
|
|
|
2019-06-18 07:04:18 +08:00
|
|
|
if(BUILD_TOOLS)
|
2022-01-12 06:50:36 +08:00
|
|
|
set(TOOL_NAMES rs-convert rs-embed rs-enumerate-devices rs-fw-logger rs-fw-update rs-record rs-terminal)
|
2021-09-28 12:10:48 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
|
2018-04-18 01:01:22 +08:00
|
|
|
endif()
|
2017-11-07 15:59:02 +08:00
|
|
|
|
2019-06-18 07:04:18 +08:00
|
|
|
if(BUILD_OPENNI2_BINDINGS)
|
2021-09-28 12:10:48 +08:00
|
|
|
file(GLOB RS2DRIVER "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/_out/rs2driver*")
|
2020-03-17 05:56:05 +08:00
|
|
|
if(RS2DRIVER)
|
2021-09-28 12:10:48 +08:00
|
|
|
file(COPY ${RS2DRIVER} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/openni2/OpenNI2/Drivers")
|
2020-03-17 05:56:05 +08:00
|
|
|
endif()
|
2019-06-18 07:04:18 +08:00
|
|
|
endif()
|
|
|
|
|
2021-10-28 06:19:28 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
|
|
vcpkg_fixup_pkgconfig()
|