diff options
| author | NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> | 2020-04-17 04:29:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-16 13:29:32 -0700 |
| commit | 8fb29061f4a370aa10913a8a4442215adc14e924 (patch) | |
| tree | 863624688329d7b6d69b27263cb2e95873880115 | |
| parent | 10b71cf0209f73ce484a97dbf9fa7b2b34bad765 (diff) | |
| download | vcpkg-8fb29061f4a370aa10913a8a4442215adc14e924.tar.gz vcpkg-8fb29061f4a370aa10913a8a4442215adc14e924.zip | |
[realsense2] Add tm2 feature for support T265 devices (#10673)
* [realsense2] Add tm2 feature for support T265 devices
* Fix tools build error on Visual Studio 2019
* Update the way to handle features as vcpkg_check_features()
* Update
| -rw-r--r-- | ports/realsense2/CONTROL | 5 | ||||
| -rw-r--r-- | ports/realsense2/fix-tools-compile-on-vs2019.patch | 13 | ||||
| -rw-r--r-- | ports/realsense2/portfile.cmake | 8 |
3 files changed, 23 insertions, 3 deletions
diff --git a/ports/realsense2/CONTROL b/ports/realsense2/CONTROL index ee405e8a0..cef0ee206 100644 --- a/ports/realsense2/CONTROL +++ b/ports/realsense2/CONTROL @@ -1,5 +1,5 @@ Source: realsense2 -Version: 2.33.1 +Version: 2.33.1-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). @@ -10,3 +10,6 @@ Description: Build Intel® RealSense™ examples and tools Feature: openni2 Build-Depends: openni2 Description: Build Intel® RealSense™ OpenNI2 driver + +Feature: tm2 +Description: Build Intel® RealSense™ T265 device diff --git a/ports/realsense2/fix-tools-compile-on-vs2019.patch b/ports/realsense2/fix-tools-compile-on-vs2019.patch new file mode 100644 index 000000000..4a9543ed0 --- /dev/null +++ b/ports/realsense2/fix-tools-compile-on-vs2019.patch @@ -0,0 +1,13 @@ +diff --git a/common/rs-config.cpp b/common/rs-config.cpp
+index ff3a757..c9efa1a 100644
+--- a/common/rs-config.cpp
++++ b/common/rs-config.cpp
+@@ -97,7 +97,7 @@ config_file::config_file(std::string filename)
+ auto j = json::parse(str);
+ for (json::iterator it = j.begin(); it != j.end(); ++it)
+ {
+- _values[it.key()] = it.value();
++ _values[it.key()] = it.value().get<std::string>();
+ }
+ }
+ catch(...)
diff --git a/ports/realsense2/portfile.cmake b/ports/realsense2/portfile.cmake index d1b102203..9694e2fc5 100644 --- a/ports/realsense2/portfile.cmake +++ b/ports/realsense2/portfile.cmake @@ -7,11 +7,16 @@ vcpkg_from_github( PATCHES fix_openni2.patch fix-dependency-glfw3.patch + fix-tools-compile-on-vs2019.patch ) file(COPY ${SOURCE_PATH}/src/win7/drivers/IntelRealSense_D400_series_win7.inf DESTINATION ${SOURCE_PATH}) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tm2 BUILD_WITH_TM2 +) + set(BUILD_TOOLS OFF) if("tools" IN_LIST FEATURES) set(BUILD_TOOLS ON) @@ -25,9 +30,8 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} -DENFORCE_METADATA=ON - -DBUILD_WITH_TM2=OFF -DBUILD_WITH_OPENMP=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} |
