Repository navigation
fix(cvcGL): link X11 by name so the static export is relocatable - #202
Merged
Merged
Conversation
The CameraController's X11 pointer-capture linked ${X11_LIBRARIES}, which
find_package(X11) fills with ABSOLUTE builder paths (…/py/lib/libX11.so, libSM.so,
libICE.so, libXext.so). cvcGL ships as a STATIC archive, so its PRIVATE link deps
propagate to consumers through INTERFACE_LINK_LIBRARIES — baking those builder
paths into cvcGLTargets.cmake. A downstream consumer on another machine (volrover3
building against the published cvcgl SDK) then fails to link:
ninja: error: '…/py/lib/libSM.so', needed by 'bin/volrover3', missing and no
known rule to make it
cvcGL only calls Xlib (XWarpPointer/XFlush), so link libX11 BY NAME. The export
now carries a relocatable `$<LINK_ONLY:X11>` (-lX11) the consumer's own linker
resolves, and drops the unused SM/ICE/Xext (VTK pulls those transitively via its
own relocatable targets). Verified: a static install's cvcGLTargets.cmake no longer
contains any absolute X11 path. Works for both static (propagates X11) and shared
(the .so resolves libX11 itself, never exported) cvcpkg builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unblocks volrover3 (and any external consumer) building against the published cvcgl SDK.
The CameraController's X11 pointer-capture (added in #199) linked
${X11_LIBRARIES}— absolute builder paths fromfind_package(X11). cvcGL is a static archive, so its PRIVATE link deps propagate to consumers viaINTERFACE_LINK_LIBRARIES, baking…/py/lib/libSM.so(etc.) intocvcGLTargets.cmake. volrover3's link then fails:ninja: error: '…/py/lib/libSM.so', needed by 'bin/volrover3', missing and no known rule to make it.Fix: link libX11 by name (cvcGL only calls Xlib — XWarpPointer/XFlush). The export now carries a relocatable
$<LINK_ONLY:X11>→-lX11, and drops the unused SM/ICE/Xext (VTK provides those transitively).Verified locally: a static
cmake --installproducescvcGLTargets.cmakewith…;$<LINK_ONLY:X11>and no absolute X11 path. Correct for both static (propagatesX11) and shared (.soself-resolves, never exported) builds.Follow-up to #199; needs a cvcgl republish so volrover3 can build against the fixed SDK.