Skip to content

Commit cbcfd23

Browse files
committed
return viamapi to find components
1 parent c193784 commit cbcfd23

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/viam/config/viam-cpp-sdkConfig.cmake.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ endif()
3131
# the components, it seems like an easy thing to forget.
3232
set(_viam-cpp-sdk_supported_components viamapi viamsdk)
3333

34+
# TODO(acm): I also don't like that we need to manually set things up
35+
# so that asking for viamsdk cause you to ask for viamapi too. I'd
36+
# expect cmake to know that viamsdk dependson viamapi so asking for the
37+
# one should force you to get the other. But, it doesn't seem to do
38+
# that, so force it, and force it ahead of viamsdk so that viamsdk's
39+
# file can resolve viam-cpp-sdk::viamapi
40+
if (viamsdk IN_LIST viam-cpp-sdk_FIND_COMPONENTS)
41+
LIST(PREPEND viam-cpp-sdk_FIND_COMPONENTS viamapi)
42+
endif()
43+
3444
foreach(_comp ${viam-cpp-sdk_FIND_COMPONENTS})
3545
if (NOT _comp IN_LIST _viam-cpp-sdk_supported_components)
3646
set(viam-cpp-sdk_FOUND False)

0 commit comments

Comments
 (0)