Meson CMake dependency lookup ignores CMAKE_PREFIX_PATH after recent changes #5666
Labels
dependency:cmake
Issues related to `dependency` with the `cmake` method
Milestone
After upgrading from 0.49.2 to 0.50.1, my build which relies on a CMake dependency lookup started failing to find the dependency. By using
git bisect
on the Meson repo I found that the lookup starts failing with this PR, specifically this commit (cc @mensinda). I've also tested on 0.51.0 and master and the problem persists.As per that PR, Meson now checks if the expected CMake modules exist before actually invoking CMake, except I believe it fails to consider all the places CMake itself would look. Specifically, as I understand it, CMake looks in the paths of the
CMAKE_PREFIX_PATH
environment variable, which I believe is automatically set by my dependency handling system and was key to finding the dependencies when I used 0.49.2. In newer versions, Meson bails out and never gives CMake the chance to run and check those paths.I can seemingly work around this by configuring with
-Dcmake_prefix_path=$(echo "$CMAKE_PREFIX_PATH" | tr : ,)
, but this feels a bit redundant. It's unclear to me whether it's intended design, given that Meson is happy to read other env vars like CXX/LDFLAGS without passing them through-D
flags, for example. Previously, Meson's CMake support was really "plug and play" and didn't require any thought beyond what would make CMake itself work in the normal way, and I think it would be ideal to preserve that property.Let me know if you need any more specific details.
The text was updated successfully, but these errors were encountered: