You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When trying to find a dependency using CMake and it raised error despite being found, meson should give more detailed error message instead of just saying the dependency not found.
To Reproduce
I think this can be reproduced with any other projects and platforms, but I first encountered this with the following situation:
Now /tmp/cpptrace/lib/cmake/cpptrace/cpptrace-config.cmake is installed, and I try to use this from Meson using the following meson.build and setup with -Dcmake_prefix_path=/tmp/cpptrace.
Meson should output more detailed message why the CMake call raised error to the console output or at least to the meson-log.txt.
In this case that's because zstd was not found, which is a dependency required by cpptrace.
If I try to use cpptrace from CMake like the following, CMake gives exact error message about this.
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/opt/llvm@17/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/opt/llvm@17/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find zstd (missing: zstd_LIBRARY zstd_INCLUDE_DIR)
Call Stack (most recent call first):
/opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/lib/cmake/cpptrace/Findzstd.cmake:20 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
/opt/homebrew/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
/opt/homebrew/lib/cmake/cpptrace/cpptrace-config.cmake:13 (find_dependency)
CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
system parameters
Is this a cross build or just a plain native build (for the same computer)?
Native
what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
MacOS Sonoma
what Python version are you using e.g. 3.8.0
Python 3.13.1
what meson --version
1.6.1
what ninja --version if it's a Ninja build
The text was updated successfully, but these errors were encountered:
Describe the bug
When trying to find a dependency using CMake and it raised error despite being found, meson should give more detailed error message instead of just saying the dependency not found.
To Reproduce
I think this can be reproduced with any other projects and platforms, but I first encountered this with the following situation:
On MacOS, install zstd and jeremy-rifkin/cpptrace with external zstd using CMake.
brew install zstd git clone https://github.com/jeremy-rifkin/cpptrace cd cpptrace cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/tmp/cpptrace -DCPPTRACE_USE_EXTERNAL_ZSTD=ON cmake --build build -t install
Now /tmp/cpptrace/lib/cmake/cpptrace/cpptrace-config.cmake is installed, and I try to use this from Meson using the following meson.build and setup with
-Dcmake_prefix_path=/tmp/cpptrace
.But if I remove zstd (
brew unlink zstd
) this happens, despite cpptrace-config.cmake still exists and I'm sure passing correct cmake_prefix_path:meson-log.txt does not provide any useful information either:
Expected behavior
Meson should output more detailed message why the CMake call raised error to the console output or at least to the meson-log.txt.
In this case that's because zstd was not found, which is a dependency required by cpptrace.
If I try to use cpptrace from CMake like the following, CMake gives exact error message about this.
system parameters
meson --version
ninja --version
if it's a Ninja buildThe text was updated successfully, but these errors were encountered: