Skip to content

FindGTest Update, main branch (2023.09.21.)

This is my own attempt at solving the same thing as !1064 (closed). 🤔

Instead of mucking about with CMake compatibility rules, switched from GTEST_ROOT to CMAKE_PREFIX_PATH for finding GoogleTest.

At the same time removed the explicit CMP0074 setting from AtlasLCG, as it was not making a difference anyway. (This setting was only ever active for the code in LCGConfig.cmake, not for the user who called find_package(LCG ...).) Edit: It turns out that during the generation of the environment setup scripts we do make use of that compatibility rule after all.

Note that this update actually changes the behaviour of find_package(GTest). 🤔 Now CMake finds the CMake code coming with GoogleTest itself.

-- Found GTest: /cvmfs/sft.cern.ch/lcg/releases/LCG_104/gtest/1.13.0/x86_64-centos7-gcc11-opt/lib64/cmake/GTest/GTestConfig.cmake (found version "1.13.0")

Just like stated on: https://cmake.org/cmake/help/latest/module/FindGTest.html

While previously we were using just the code from the CMake's own FindGTest.cmake module. I.e.:

-- Found GTest: /cvmfs/sft.cern.ch/lcg/releases/LCG_104/gtest/1.13.0/x86_64-centos7-gcc11-opt/lib64/libgtest.a

So I'll try an Athena build before going forward with this MR... 🤔

Edited by Attila Krasznahorkay

Merge request reports