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

[bug] CMake Generator QUIET behaviour and message types. #9959

Closed
n00b42 opened this issue Nov 5, 2021 · 0 comments · Fixed by #12967
Closed

[bug] CMake Generator QUIET behaviour and message types. #9959

n00b42 opened this issue Nov 5, 2021 · 0 comments · Fixed by #12967

Comments

@n00b42
Copy link

n00b42 commented Nov 5, 2021

  1. According to CMake find_package(<pkg> QUIET) should not print (informational) message (unless it could not be found...). However both cmake_find_package as well as CMakeDeps generators still print output even on success.
    E.g. find_package(libsystemd REQUIRED QUIET) results in:
-- Conan: Target declared 'libsystemd::libsystemd'
-- Conan: Component target declared 'libcap::cap'
-- Conan: Target declared 'libcap::libcap'
-- Conan: Target declared 'libmount::libmount'
[...]

I found CONAN_CMAKE_SILENT_OUTPUT which silences the output, but my question is if "QUIET" should not already do that.

  1. Looking into the corresponding generated cmake files, I found something else: it looks like the message type is dropped, is this intentional?
 function(conan_message MESSAGE_OUTPUT)
     if(NOT CONAN_CMAKE_SILENT_OUTPUT)
         message(${ARGV${0}})

I.e. conan_message(FATAL_ERROR [...] will result in a message([...]

Environment Details (include every applicable attribute)

  • Operating System+version: debian/testing (Debian 5.14.9-2 (2021-10-03) x86_64 GNU/Linux)
  • Compiler+version: gcc 10.3.0
  • Conan version: 1.42.0
  • Python version: 3.9.7
praetorian20 added a commit to praetorian20/conan that referenced this issue Jan 24, 2023
Conan packages using the CMakeDeps generator will now stop printing
status messages if the QUIET argument is passed to the respective
find_package() CMake call.

Fixes conan-io#9959
Fixes conan-io#10857
praetorian20 added a commit to praetorian20/conan that referenced this issue Jan 24, 2023
Conan packages using the CMakeDeps generator will now stop printing
status messages if the QUIET argument is passed to the respective
find_package() CMake call.

Fixes conan-io#9959
Fixes conan-io#10857
praetorian20 added a commit to praetorian20/conan that referenced this issue Jan 25, 2023
Conan packages using the CMakeDeps generator will now stop printing
status messages if the QUIET argument is passed to the respective
find_package() CMake call.

Fixes conan-io#9959
Fixes conan-io#10857
czoido pushed a commit that referenced this issue Jan 26, 2023
* CMakeDeps: heed <PackageName>_FIND_QUIETLY

Conan packages using the CMakeDeps generator will now stop printing
status messages if the QUIET argument is passed to the respective
find_package() CMake call.

Fixes #9959
Fixes #10857

* add test

Co-authored-by: memsharded <james@conan.io>
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 a pull request may close this issue.

1 participant