Skip to content

Commit 2f52e03

Browse files
authored
[libmultisense] Update to 7.2.0 (#46985)
1 parent e24f21e commit 2f52e03

9 files changed

+242
-38
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
diff --git a/source/Legacy/CMakeLists.txt b/source/Legacy/CMakeLists.txt
2+
index 2a7367c..a0bfbd3 100644
3+
--- a/source/Legacy/CMakeLists.txt
4+
+++ b/source/Legacy/CMakeLists.txt
5+
@@ -86,12 +86,12 @@ set_target_properties(MultiSense PROPERTIES PUBLIC_HEADER "${MULTISENSE_HEADERS}
6+
# We want to link against our child libraries.
7+
#
8+
9+
-if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
10+
+find_package(Threads REQUIRED)
11+
+target_link_libraries(MultiSense Threads::Threads)
12+
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
13+
target_link_libraries(MultiSense ws2_32)
14+
-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
15+
- target_link_libraries(MultiSense pthread)
16+
-else()
17+
- target_link_libraries(MultiSense pthread rt)
18+
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
19+
+ target_link_libraries(MultiSense rt)
20+
endif()
21+
22+
include(CMakePackageConfigHelpers)
23+
diff --git a/source/LibMultiSense/CMakeLists.txt b/source/LibMultiSense/CMakeLists.txt
24+
index 7a4cb8e..72e2e54 100644
25+
--- a/source/LibMultiSense/CMakeLists.txt
26+
+++ b/source/LibMultiSense/CMakeLists.txt
27+
@@ -66,12 +66,12 @@ set_target_properties(MultiSense PROPERTIES PUBLIC_HEADER "${MULTISENSE_HEADERS}
28+
# We want to link against our child libraries.
29+
#
30+
31+
-if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
32+
+find_package(Threads REQUIRED)
33+
+target_link_libraries(MultiSense Threads::Threads)
34+
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
35+
target_link_libraries(MultiSense ws2_32)
36+
-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
37+
- target_link_libraries(MultiSense pthread)
38+
-else()
39+
- target_link_libraries(MultiSense pthread rt)
40+
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
41+
+ target_link_libraries(MultiSense rt)
42+
endif()
43+
44+
if (BUILD_TESTS)
45+
diff --git a/source/Utilities/Legacy/CMakeLists.txt b/source/Utilities/Legacy/CMakeLists.txt
46+
index 21c747d..da05f78 100644
47+
--- a/source/Utilities/Legacy/CMakeLists.txt
48+
+++ b/source/Utilities/Legacy/CMakeLists.txt
49+
@@ -8,32 +8,16 @@ include_directories(shared)
50+
# Common libraries that each utility needs to link with.
51+
#
52+
53+
-if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
54+
-
55+
-set (MULTISENSE_UTILITY_LIBS
56+
- ${MULTISENSE_UTILITY_LIBS}
57+
- MultiSense
58+
- ws2_32
59+
-)
60+
-
61+
-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
62+
-
63+
-set (MULTISENSE_UTILITY_LIBS
64+
- ${MULTISENSE_UTILITY_LIBS}
65+
+find_package(Threads REQUIRED)
66+
+list(APPEND MULTISENSE_UTILITY_LIBS
67+
MultiSense
68+
- pthread
69+
+ Threads::Threads
70+
)
71+
-
72+
-else ()
73+
-
74+
-set (MULTISENSE_UTILITY_LIBS
75+
- ${MULTISENSE_UTILITY_LIBS}
76+
- MultiSense
77+
- pthread
78+
- rt
79+
-)
80+
-
81+
-endif ()
82+
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
83+
+ list(APPEND MULTISENSE_UTILITY_LIBS ws2_32)
84+
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
85+
+ list(APPEND MULTISENSE_UTILITY_LIBS rt)
86+
+endif()
87+
88+
#
89+
# Recurse into each of these directories.
90+
diff --git a/source/Utilities/LibMultiSense/CMakeLists.txt b/source/Utilities/LibMultiSense/CMakeLists.txt
91+
index 3d21f9b..0d9a992 100644
92+
--- a/source/Utilities/LibMultiSense/CMakeLists.txt
93+
+++ b/source/Utilities/LibMultiSense/CMakeLists.txt
94+
@@ -1,30 +1,13 @@
95+
-
96+
-if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
97+
-
98+
-set (MULTISENSE_UTILITY_LIBS
99+
- ${MULTISENSE_UTILITY_LIBS}
100+
- MultiSense
101+
- ws2_32
102+
-)
103+
-
104+
-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
105+
-
106+
-set (MULTISENSE_UTILITY_LIBS
107+
- ${MULTISENSE_UTILITY_LIBS}
108+
- MultiSense
109+
- pthread
110+
+find_package(Threads REQUIRED)
111+
+list(APPEND MULTISENSE_UTILITY_LIBS
112+
+ MultiSense
113+
+ Threads::Threads
114+
)
115+
-
116+
-else ()
117+
-
118+
-set (MULTISENSE_UTILITY_LIBS
119+
- ${MULTISENSE_UTILITY_LIBS}
120+
- MultiSense
121+
- pthread
122+
- rt
123+
-)
124+
-
125+
-endif ()
126+
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
127+
+ list(APPEND MULTISENSE_UTILITY_LIBS ws2_32)
128+
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
129+
+ list(APPEND MULTISENSE_UTILITY_LIBS rt)
130+
+endif()
131+
132+
add_subdirectory(ChangeIpUtility)
133+
add_subdirectory(DeviceInfoUtility)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
diff --git a/source/LibMultiSense/MultiSenseConfig.cmake.in b/source/LibMultiSense/MultiSenseConfig.cmake.in
2-
index 99f4264..74ffff4 100644
2+
index cf98076..dee7a62 100644
33
--- a/source/LibMultiSense/MultiSenseConfig.cmake.in
44
+++ b/source/LibMultiSense/MultiSenseConfig.cmake.in
5-
@@ -1,5 +1,10 @@
6-
@PACKAGE_INIT@
5+
@@ -2,6 +2,10 @@
76

7+
include(CMakeFindDependencyMacro)
8+
find_dependency(MultiSenseWire)
9+
+find_dependency(Threads)
810
+if (@BUILD_JSON_SERIALIZATION@)
9-
+ find_package(nlohmann_json CONFIG REQUIRED)
11+
+ find_dependency(nlohmann_json 3.9)
1012
+endif ()
11-
+
12-
+include("${CMAKE_CURRENT_LIST_DIR}/MultiSenseWireTargets.cmake")
13+
1314
include("${CMAKE_CURRENT_LIST_DIR}/MultiSenseTargets.cmake")
1415

15-
check_required_components(MultiSense)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 333d8ca..d0e6160 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -24,6 +24,7 @@ project(LibMultiSense
6+
7+
include (CheckCXXSourceCompiles)
8+
9+
+if(0)
10+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
11+
string (REGEX REPLACE "/W3" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
12+
string (REGEX REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
13+
@@ -41,6 +42,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Ap
14+
#
15+
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
16+
endif()
17+
+endif()
18+
19+
option(BUILD_LEGACY_API "Build the legacy MultiSense API. Defaults to On for backwards compatibility." ON)
20+
option(MULTISENSE_BUILD_UTILITIES "Build MultiSense utility applications. Defaults to ON for backwards compatibility." ON)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/source/LibMultiSense/details/utilities.cc b/source/LibMultiSense/details/utilities.cc
2+
index 5c20566..768a291 100644
3+
--- a/source/LibMultiSense/details/utilities.cc
4+
+++ b/source/LibMultiSense/details/utilities.cc
5+
@@ -185,7 +185,6 @@ bool write_image(const Image &image, const std::filesystem::path &path)
6+
}
7+
throw std::runtime_error("Unsupported path extension: " + extension.string() + ". Try compiling with OpenCV");
8+
#endif
9+
- return false;
10+
}
11+
12+
std::optional<Image> create_depth_image(const ImageFrame &frame,

ports/libmultisense/fix-missing-algorithm.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

ports/libmultisense/portfile.cmake

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,100 @@ vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
33
REPO carnegierobotics/LibMultiSense
44
REF ${VERSION}
5-
SHA512 4fb2343fc2288792c732e7e61cb447b953ed8e8354c3c1e401c5b2bc8151f4b3d8f692882e015e5e56d8dc2d08f121a798138a6974d3b02348b1689c9015fe00
5+
SHA512 69472f288de46c0ecdbbbcb8c280610c1c80778d660098e3b639ab653b108096c3fb4cd92a21afd4745b959a0c80812c5bf2d42053760bbceeafd90e67c20388
66
HEAD_REF master
77
PATCHES
8-
fix-missing-algorithm.patch
9-
fix-find-package-config-file.patch
8+
0000-platform-specific-links.patch
9+
0001-find-public-api-dependencies.patch
10+
0002-disable-error-on-warning.patch
11+
0003-utilities-cc-unreachable-code.patch
1012
)
1113

1214
vcpkg_check_features(
1315
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
1416
FEATURES
1517
json-serialization BUILD_JSON_SERIALIZATION
18+
json-serialization CMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json
1619
opencv BUILD_OPENCV
1720
utilities MULTISENSE_BUILD_UTILITIES
1821
)
22+
1923
vcpkg_cmake_configure(
2024
SOURCE_PATH "${SOURCE_PATH}"
2125
OPTIONS
2226
-DBUILD_LEGACY_API=OFF
2327
${FEATURE_OPTIONS}
2428
)
2529

26-
set(PACKAGE_NAME MultiSense)
2730
vcpkg_cmake_install()
31+
2832
vcpkg_cmake_config_fixup(
29-
PACKAGE_NAME "${PACKAGE_NAME}"
30-
CONFIG_PATH "lib/cmake/${PACKAGE_NAME}"
33+
PACKAGE_NAME "MultiSenseWire"
34+
CONFIG_PATH "lib/cmake/MultiSenseWire"
35+
DO_NOT_DELETE_PARENT_CONFIG_PATH
36+
)
37+
vcpkg_cmake_config_fixup(
38+
PACKAGE_NAME "MultiSense"
39+
CONFIG_PATH "lib/cmake/MultiSense"
3140
)
3241
vcpkg_fixup_pkgconfig()
3342

3443
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
3544

3645
if ("utilities" IN_LIST FEATURES)
46+
set(_tool_names
47+
ChangeIpUtility
48+
ImageCalUtility
49+
PointCloudUtility
50+
RectifiedFocalLengthUtility
51+
SaveImageUtility
52+
VersionInfoUtility
53+
)
54+
if ("json-serialization" IN_LIST FEATURES)
55+
list(APPEND _tool_names DeviceInfoUtility)
56+
endif ()
3757
vcpkg_copy_tools(
38-
TOOL_NAMES
39-
ChangeIpUtility
40-
ImageCalUtility
41-
PointCloudUtility
42-
RectifiedFocalLengthUtility
43-
SaveImageUtility
44-
VersionInfoUtility
58+
TOOL_NAMES ${_tool_names}
4559
AUTO_CLEAN
4660
)
61+
62+
# Python equivalents of the above tools are also installed into bin. These tools are duplicates and require that
63+
# the Python bindings be built, which we are not doing. Since they provide no additional functionality, remove
64+
# them.
65+
set(_python_tool_names
66+
change_ip_utility.py
67+
device_info_utility.py
68+
image_cal_utility.py
69+
point_cloud_utility.py
70+
rectified_focal_length_utility.py
71+
save_image_utility.py
72+
version_info_utility.py
73+
)
74+
foreach (_python_tool_name IN LISTS _python_tool_names)
75+
file(
76+
REMOVE
77+
"${CURRENT_PACKAGES_DIR}/debug/bin/${_python_tool_name}"
78+
"${CURRENT_PACKAGES_DIR}/bin/${_python_tool_name}"
79+
)
80+
endforeach ()
81+
82+
# Remove the bin directory if its empty (anticipated on non-Windows platforms).
83+
foreach (_directory IN ITEMS
84+
"${CURRENT_PACKAGES_DIR}/debug/bin/${_python_tool_name}"
85+
"${CURRENT_PACKAGES_DIR}/bin/${_python_tool_name}")
86+
if (NOT IS_DIRECTORY "${_directory}")
87+
continue()
88+
endif ()
89+
90+
file(GLOB _files_in_directory "${_directory}/*")
91+
if("${_files_in_directory}" STREQUAL "")
92+
file(REMOVE_RECURSE "${_directory}")
93+
endif()
94+
endforeach()
4795
endif ()
4896

49-
file(
50-
INSTALL "${SOURCE_PATH}/LICENSE.TXT"
51-
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
52-
RENAME copyright
97+
vcpkg_install_copyright(
98+
FILE_LIST "${SOURCE_PATH}/LICENSE.TXT"
5399
)
54100
file(
55101
INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage"

ports/libmultisense/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "libmultisense",
3-
"version": "7.1.0",
3+
"version": "7.2.0",
44
"description": "A C++ library for interfacing with the MultiSense S family of sensors from Carnegie Robotics.",
55
"homepage": "https://github.com/carnegierobotics/LibMultiSense",
66
"dependencies": [

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5105,7 +5105,7 @@
51055105
"port-version": 0
51065106
},
51075107
"libmultisense": {
5108-
"baseline": "7.1.0",
5108+
"baseline": "7.2.0",
51095109
"port-version": 0
51105110
},
51115111
"libmupdf": {

versions/l-/libmultisense.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "c56632e5b66a90b161ea41a53be72642e9353250",
5+
"version": "7.2.0",
6+
"port-version": 0
7+
},
38
{
49
"git-tree": "3d9ad2b386e8089ebfc19a99195434e4cf56809e",
510
"version": "7.1.0",

0 commit comments

Comments
 (0)