docker: put the static libdbus on CMAKE_PREFIX_PATH for Qt6::DBus consumers
The Qt build found dbus via -DDBus1_DIR, but a static Qt records the dependency and every consumer re-runs find_package(DBus1) through Qt's exported config (Qt6Gui -> Qt6DBus -> find_dependency(WrapDBus1)). Without the dbus prefix on the consumer's search path that fails: Could NOT find WrapDBus1 (missing: DBus1_LIBRARY DBus1_INCLUDE_DIR ...) Qt6DBus could not be found because dependency WrapDBus1 could not be found. Add /opt/dbus-<ver>-static to the image's CMAKE_PREFIX_PATH env so the viewer build (and the CI .deb/.rpm and tarball builds) resolve it. Verified against the rocky9 image: find_package(Qt6 ... DBus) fails with the old path and passes with dbus on the env CMAKE_PREFIX_PATH. Also make build_in_rocky9.sh self-sufficient on images built before this fix: it discovers /opt/dbus-*-static/lib/cmake/DBus1 and passes -DDBus1_DIR, so the viewer verification works without rebuilding the image first. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,8 +28,13 @@ docker run --rm \
|
||||
"$IMG" bash -lc '
|
||||
set -eux
|
||||
git config --global --add safe.directory /workspace || true
|
||||
# If this image predates the CMAKE_PREFIX_PATH fix, point cmake at the static libdbus config
|
||||
# dir so the viewer (Qt6::DBus -> find_package(DBus1)) resolves WrapDBus1. Harmless once the
|
||||
# image ENV already carries it.
|
||||
dbus_dir=$(ls -d /opt/dbus-*-static/lib/cmake/DBus1 2>/dev/null | head -1)
|
||||
cmake -G Ninja -S /workspace -B /tmp/build \
|
||||
-DJFJOCH_VIEWER_ONLY=ON -DJFJOCH_USE_CUDA=ON \
|
||||
${dbus_dir:+-DDBus1_DIR=$dbus_dir} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_FLAGS="-march=x86-64-v3" -DCMAKE_C_FLAGS="-march=x86-64-v3"
|
||||
ninja -C /tmp/build -j"$(nproc)" jfjoch_viewer
|
||||
|
||||
@@ -168,8 +168,10 @@ RUN set -eux; \
|
||||
cmake --install eigen-build; \
|
||||
cd /; rm -rf /tmp/eigen /tmp/eigen-build
|
||||
|
||||
# Make Qt and Eigen discoverable by CMake
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4
|
||||
# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is
|
||||
# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1)
|
||||
# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build.
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4
|
||||
|
||||
# Set workdir for your project
|
||||
WORKDIR /workspace
|
||||
|
||||
@@ -207,8 +207,10 @@ RUN set -eux; \
|
||||
cmake --install eigen-build; \
|
||||
cd /; rm -rf /tmp/eigen /tmp/eigen-build
|
||||
|
||||
# Make Qt and Eigen discoverable by CMake
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4
|
||||
# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is
|
||||
# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1)
|
||||
# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build.
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4
|
||||
|
||||
ENV LANG=en_US.UTF-8
|
||||
ENV LANGUAGE=en_US:en
|
||||
|
||||
@@ -196,8 +196,10 @@ RUN set -eux; \
|
||||
cmake --install eigen-build; \
|
||||
cd /; rm -rf /tmp/eigen /tmp/eigen-build
|
||||
|
||||
# Make Qt and Eigen discoverable by CMake
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4
|
||||
# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is
|
||||
# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1)
|
||||
# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build.
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4
|
||||
|
||||
# Set workdir for your project
|
||||
WORKDIR /workspace
|
||||
|
||||
@@ -183,8 +183,10 @@ RUN set -eux; \
|
||||
cmake --install eigen-build; \
|
||||
cd /; rm -rf /tmp/eigen /tmp/eigen-build
|
||||
|
||||
# Make Qt and Eigen discoverable by CMake
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4
|
||||
# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is
|
||||
# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1)
|
||||
# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build.
|
||||
ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4
|
||||
|
||||
# Set workdir for your project
|
||||
WORKDIR /workspace
|
||||
|
||||
Reference in New Issue
Block a user