Skip to content

FindGMock Fix, master branch (2022.05.05.)

This is to fix one of the issues that I found while debugging ATLASG-1634. As it turned out, we've never used GoogleMock correctly in debug builds so far. The reason that this didn't show up before is that we really only use GoogleMock in AnalysisBase but since we practically never build that project in Debug mode, this just never showed up...

I did two things to fix the issue:

  • First of all I made not finding any requested libraries in lcg_external_module(...) into an error. Previously if none of the libraries were found for a given component, the component was still reported as found. With an empty <FOO>_LIBRARIES variable. (Which the module treated as a valid thing.) In the new setup <FOO>_LIBRARIES becomes invalid in such a situation. (Note that not finding just some of the requested libraries is still not treated as an error, as the offline configuration relies on that behaviour in a couple of places.)
  • I updated FindGMock.cmake to look for both gmock/gmockd and gmock_main/gmock_maind. And set up the appropriate variables with the same logic as FindGTest does it.

With this included, even though I found some errors in how GTest and GMock are used in some packages in atlas/athena, AnalysisBase does build successfully with CMAKE_BUILD_TYPE=Debug.

Pinging @krumnack.

Merge request reports