The FindPackageHandleStandardArgs module is quite handy for use in Find modules. In addition to other functionality, it provides a clear notification when a package is found.
What are the best practices for notifying users about a package’s details (such as path and version) when working with a config file?
That’s a contentious question. I’ll give my opinion, but you should expect others to have opposite views. Personally, I follow the principle of “if things are successful, there should be no output by default”. This is what compilers do, and it ensures the log is fairly concise. This means when something is output to the log, the user is more likely to notice it. If you output a lot of information, you train the users to ignore all the output, so they miss warnings and other important messages that get lost in the noise.
There’s nothing wrong with outputting more info if the verbosity level is raised. You could use cmake_language(GET_MESSAGE_LOG_LEVEL) to work out what the verbosity level is, but you should check if the user is using a new enough CMake version (3.25) before you try to do that. Don’t call it if the user is using CMake 3.24 or older, just assume the default verbosity level in that case.
As for FindPackageHandleStandardArgs, or more specifically the find_package_handle_standard_args() command it provides, I actually never use that myself. Before the more target-centric “modern CMake” became a thing, find_package_handle_standard_args() was a useful way to handle “was I successful or not” processing at the end of a Find module. But now that Find modules are generally going to be providing targets too (or at least should ideally be), a well-behaved Find module should not create any targets if it is going to be unsuccessful, and that usually means you would have to manually implement all the checks yourself anyway. By the time you get to the point in your Find module’s logic where you would call find_package_handle_standard_args(), you would already have implemented most of it. The find_package_handle_standard_args() command also logs output, and as I mentioned above, I much prefer to output nothing by default unless there is a problem.
Sorry, I skipped over an important part of your question. You were asking about config files, not Find modules. A package config file should follow the same principle, not outputting anything unless there’s a problem. But for config files, it is a bit more complicated. A single call to find_package() can read and process many config packages’ version files (packagename-config-version.cmake or PackageNameConfigVersion.cmake). These must never log any output at all. For the actual config file (packagename-config.cmake or PackageNameConfig.cmake), it should not log any messages directly, but rather it should provide error information by setting ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE if there’s a problem. The find_package() command will then use that to provide the relevant handling. The Importing and Exporting Guide contains an example that demonstrates its use.