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

CMakeLists.txt redefines "message" function

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.18.0, 1.17.3, 1.18.0-alpha
    • None
    • None
    • All

    Description

      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

       

      Attachments

        Issue Links

          Activity

            People

              roberto.sanchez@mongodb.com Roberto Sanchez
              bitshifthero@googlemail.com Tom Wilson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: