Skip to content

fix(cvcGL): link X11 by name so the static export is relocatable - #202

Merged
transfix merged 1 commit into
masterfrom
fix/cvcgl-x11-export-relocatable
Aug 20, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/cvcgl-x11-export-relocatable

Conversation

@transfix

Copy link
Copy Markdown
Owner

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 from find_package(X11). cvcGL is a static archive, so its PRIVATE link deps propagate to consumers via INTERFACE_LINK_LIBRARIES, baking …/py/lib/libSM.so (etc.) into cvcGLTargets.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 --install produces cvcGLTargets.cmake with …;$<LINK_ONLY:X11> and no absolute X11 path. Correct for both static (propagates X11) and shared (.so self-resolves, never exported) builds.

Follow-up to #199; needs a cvcgl republish so volrover3 can build against the fixed SDK.

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.
@transfix
transfix merged commit 7383cab into master Aug 20, 2026
12 checks passed
@transfix
transfix deleted the fix/cvcgl-x11-export-relocatable branch October 29, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant