[
https://issues.apache.org/jira/browse/PROTON-2031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16818185#comment-16818185
]
Jiri Daněk commented on PROTON-2031:
------------------------------------
Asking the library consumer to manage the log messages makes sense, but that is
not how CMake seems to operate. For example
{code:java}
find_package(Threads REQUIRED)
{code}
gives you
{noformat}
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
{noformat}
When I change it to {{find_package(Threads REQUIRED QUIET)}} I get absolutely
no messages whatsoever.
Similarly, the existing CMake modules, like
{{/usr/share/cmake/Modules/FindSWIG.cmake}} do the message printing themselves
(in the included {{FindPackageHandleStandardArgs.cmake}}).
I cannot think of some established library project using CMake that ships their
own .cmake files, to try to see what they are doing.
> CMake files for find_package() in /lib64/cmake/Proton/ProtonConfig.cmake
> should log a message
> ---------------------------------------------------------------------------------------------
>
> Key: PROTON-2031
> URL: https://issues.apache.org/jira/browse/PROTON-2031
> Project: Qpid Proton
> Issue Type: Improvement
> Components: proton-c
> Affects Versions: proton-c-0.27.0
> Reporter: Jiri Daněk
> Priority: Minor
>
> Currently, Qpid Dispatch does
> {noformat}
> find_package(Proton 0.23 REQUIRED COMPONENTS Core Proactor)
> message(STATUS "Found Proton: ${Proton_LIBRARIES} (found version
> \"${Proton_VERSION}\")" ){noformat}
> but that {{message()}} should not be necessary. Instead, Proton's
> {{/lib64/cmake/Proton/ProtonConfig.cmake}} and
> {{/lib64/cmake/ProtonCpp/ProtonCppConfig.cmake}} files should each be taking
> care of printing that, unless the {{QUIET}} flag is specified
> https://cmake.org/cmake/help/v2.8.12/cmake.html#command:find_package
> Adding the message to Proton would mean Dispatch compilation will print the
> same message twice. I think that is acceptable temporary state.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]