Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output PACKAGE_NOT_FOUND_MESSAGE as warning when CMake package is not found #14216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

na-trium-144
Copy link

close #14050
When CMake fails to find package after Meson's preliminary_find_check succeeded, Meson outputs no error messages.
In most cases CMake config file sets the error information to the xxx_NOT_FOUND_MESSAGE variable, so with this PR Meson prints that message as a warning to stdout and meson-log.txt.

example stdout

+ WARNING: CMake reported that the package cpptrace was not found with the following reason:
+ cpptrace could not be found because dependency zstd could not be found.
  Run-time dependency cpptrace found: NO (tried pkgconfig and framework)

  meson.build:103:15: ERROR: Dependency "cpptrace" not found, tried pkgconfig and framework

example meson-log.txt

  Calling CMake (['/opt/homebrew/bin/cmake']) in /Users/kou/projects/y3c-stl/build/meson- 
  private/cmake_cpptrace with:
    - "-DNAME=cpptrace"
    - "-DARCHS="
    - "-DVERSION="
    - "-DCOMPS="
    - "-DSTATIC=OFF"
    - "--trace-expand"
    - "--trace-format=json-v1"
    - "--no-warn-unused-cli"
    - "--trace-redirect=cmake_trace.txt"
    - "-DCMAKE_TOOLCHAIN_FILE=/Users/kou/projects/y3c-stl/build/meson-private/cmake_cpptrace/CMakeMesonToolchainFile.cmake"
    - "."
+ WARNING: CMake reported that the package cpptrace was not found with the following reason:
+ cpptrace could not be found because dependency zstd could not be found.
+ Dependency lookup for cpptrace with method 'cmake' failed: Dependency cpptrace not found: PACKAGE_FOUND is false
  Run-time dependency cpptrace found: NO (tried pkgconfig and framework)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meson should output more detailed error message when trying to find dependency using CMake and raised error
1 participant