Repository navigation
Fix Qt and libcaesium detection in CMakeLists.txt - #392
Merged
Lymphatus merged 4 commits intoOct 5, 2026
Merged
Conversation
This check assumes the only way CMake can find Qt is via an explicitly set CMAKE_PREFIX_PATH (as an env var or cache variable), which isn't true in general: a build system can locate Qt6Config.cmake through other legitimate channels (Qt6_DIR, CMAKE_MODULE_PATH, a default system prefix, or a package-manager-specific search path mechanism) without CMAKE_PREFIX_PATH ever being set. The following find_package(QT NAMES Qt6 Qt5 ... REQUIRED) call already fails loudly and clearly if Qt truly can't be found, making this earlier check both redundant and a source of false negatives.
ExternalProject_Add(libcaesium ...) and the matching add_dependencies() ran unconditionally, even though it's only meant to be a fallback for when find_library(LIBCAESIUM caesium) fails to find an existing system library. The install() rules further down are already correctly gated behind `if (NOT LIBCAESIUM)`. As written, every build attempts to git-clone and cargo-build libcaesium, which fails outright in network- or git-less build environments (e.g. sandboxed package builds) even when a system libcaesium is readily available.
The Linux target_link_libraries() call only linked the "caesium" library when LIBCAESIUM was NOT found (i.e. only in the cargo-built fallback case, relying on the earlier link_directories() pointing at the ExternalProject's cargo target dir). When a system libcaesium IS found via find_library(LIBCAESIUM caesium), it was never linked in at all, leading to undefined references to c_compress/c_compress_to_size at link time. Link against the full path returned by find_library() in that case.
MainWindow declares a QElapsedTimer member (compressionTimer) without including <QElapsedTimer>, relying on it being pulled in transitively by another Qt header. This is fragile and breaks with some Qt/stdlib header configurations, failing with "'QElapsedTimer' does not name a type".
2 of 12 tasks
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.
Found while packaging this project for nixpkgs, where the build must use a system-installed
libcaesiumwith no network/git access available during the build. See individual commits for details on each fix.