Hi Olivier, glad to hear there’s some interest in adding this functionality to CMake. @alcroito and perhaps @ben.boeckel may be quite interested in your work.
ctest -R "RunCMake.GoogleTest"
We typically do want to have tests for any new features that are added to CMake. For what you are proposing, I think that would apply.
From what I recall, those tests don’t actually build a real gtest binary but instead a fake one so that GoogleTest doesn’t actually have to be available on the system. @matthew-woehlke may be able to give you some guidance on how that works (seems he’s not here on the forums yet though - look him up in CMake’s gitlab).