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

remove conan_message #11625

Merged
merged 2 commits into from Jul 13, 2022
Merged

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Jul 12, 2022

Changelog: Fix: Remove conan_message() in CMakeDeps.
Docs: Omit

Close #11369

@memsharded memsharded added this to the 1.51 milestone Jul 12, 2022
@memsharded memsharded marked this pull request as ready for review July 13, 2022 08:26
@lasote lasote merged commit e8918f4 into conan-io:develop Jul 13, 2022
@memsharded memsharded deleted the feature/remove_conan_message branch July 13, 2022 08:51
@@ -66,13 +66,13 @@ def template(self):
foreach(_COMPONENT {{ '${' + pkg_name + '_COMPONENT_NAMES' + '}' }} )
if(NOT TARGET ${_COMPONENT})
add_library(${_COMPONENT} INTERFACE IMPORTED)
conan_message(STATUS "Conan: Component target declared '${_COMPONENT}'")
message(STATUS "Conan: Component target declared '${_COMPONENT}'")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be opposed to changing this and line 75 to VERBOSE instead of STATUS?

I have a project where several submodules import conan packages (the super project is only setting up CMake paths to all the conan packages, not importing them) and these messages get printed several times now. I was previously silencing them by setting CONAN_CMAKE_SILENT_OUTPUT.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that this information is generally super helpful for many users, that will get the targets listed by default. Because not listing them makes challenging to know what would be the available target names, and changing the default verbosity of CMake for this is not that straightforward (or users won't really run in verbose, because they don't know that Conan will show the targets if they do that). So I am concerned about the experience for many Conan users, specially learners.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried you might say that :)

How about checking <PackageName>_FIND_QUIETLY within the generated code and if it's set either disable the message completely or change it to VERBOSE? That would give users control over the printing through the find_package call. I've never tried using this variable before, so unsure if it will actually work, but I could give it a shot and upload a PR.

I found related bug/feature requests too while Googling this, #10857 and #9959

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the current implementation do not implement QUIET handling, and it would make sense that it is listened. If you want to try it, these would be the guidelines:

  • CMakeDeps only. It is not worth the effort of modifying the other legacy ones, Conan 2.0 is next month
  • Don't overengineer with too much abstraction. A bit of repetition is not that bad if makes things cleaner.

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.

[bug] CMakeDeps: CONAN_CMAKE_SILENT_OUTPUT ignores FATAL_ERROR messages
3 participants