Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3756

CMakeLists.txt redefines "message" function

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

      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@mongodb.com Roberto Sanchez
            Reporter:
            bitshifthero@googlemail.com Tom Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: