[CDRIVER-3756] CMakeLists.txt redefines "message" function Created: 16/Jul/20  Updated: 28/Oct/23  Resolved: 24/Jul/20

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.18.0, 1.17.3, 1.18.0-alpha

Type: Bug Priority: Major - P3
Reporter: Tom Wilson Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Issue Links:
Related
related to CDRIVER-3041 CMakelists.txt logic causes message t... Closed

 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

 



 Comments   
Comment by Githook User [ 24/Nov/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3756 remove unused MESSAGES_ENABLED
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/dad3b7804f2d09df5bfcf37dca22cad4c3464f3c

Comment by Githook User [ 24/Nov/20 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-3756 eliminate CMake function redefinition
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/670c2c7a8805ace341327c148872ae073a4cb6d4

Comment by Githook User [ 06/Aug/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3756 remove unused MESSAGES_ENABLED
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/3e4ee4a5f7ac5611fd01a16f8d79602d3b2d582a

Comment by Githook User [ 24/Jul/20 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-3756 eliminate CMake function redefinition
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5ab86d634e24de99bd1f1b2ca27d69871139ee6d

Generated at Wed Feb 07 21:18:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.