CMakeLists.txt redefines "message" function

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.18.0, 1.17.3, 1.18.0-alpha
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      All
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      At the beginning of the top level CMakeLists.txt, the "message" function is redefined

      This causes significant problems if the mongo C driver is included as a sub-project within a larger CMake built code base. 

      After adding mongo C to my project I was unable to get any messages from CMake after the mongo scripts had been parsed.  Commenting out the following, solved the issue:

      #function (message)

      1. list (GET ARGV 0 MessageType)
      2. if (MESSAGES_ENABLED)
      3. list (REMOVE_AT ARGV 0)
      4. _message (${MessageType} "${ARGV}")
      5. endif ()
        #endfunction ()

       

      CMake already has log levels, could these not be used?  I have included a link to the documentation below

      https://cmake.org/cmake/help/latest/command/message.html

       

      Thanks

       

            Assignee:
            Roberto Sanchez
            Reporter:
            Tom Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: