Replies: 1 comment
-
|
This looks good. The On CMake 3.24+ there's a lighter option: FetchContent's find_package redirection (OVERRIDE_FIND_PACKAGE / dependency providers) gives the same uniform |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What I would like
find_package(Slint)currently works only against an installed Slint.When Slint is vendored into a C++ project via
FetchContent(add_subdirectory), theSlint::Slinttarget is available, butfind_package(Slint)does not resolve from the build tree.I would like
find_package(Slint)to work directly from the build tree too, so a consumer can keep one uniformfind_package(Slint)+slint_target_sources()code path whether Slint is installed or vendored.Why (use case)
I am building a C++ app that vendors both maplibre-native and Slint through
FetchContentand wants a hermetic build with no dependency on a system-installed Slint (a system Slint on the build host was contaminated with unrelated Qt/ICU paths).The clean way to consume Slint like everyone else is
find_package(Slint), but today that forces an install step or a subproject-specific special case.Being able to
find_package(Slint)from the build tree removes that friction and keeps the build self-contained.What is missing today
From a quick look, the build-tree side of the CMake packaging is wired for the install case only: the exported targets file is written relative to the top-level build dir (so it lands in the wrong place when Slint is a subproject), the generated
SlintConfig.cmakeuses install-prefix-relative paths, andSlintMacro.cmakeis not placed next to a build-tree config.So
find_package(Slint)from the build tree either does not find the config or resolves to install paths that do not exist yet.Offer
I have a small, working patch (that changes
api/cpp/CMakeLists.txtonly) that emits a build-tree package config with absolute paths, the built slint-compiler, andSlintMacro/SlintTargetsalongside it, and I verifiedfind_package(Slint)resolving from a FetchContent build tree with it.The diff is here:
If this direction is welcome I am happy to open a PR, including a test that FetchContents Slint and calls
find_package(Slint)from the build tree.Beta Was this translation helpful? Give feedback.
All reactions