I believe I found a piece of code that did exactly that, but with the documentation that CMake is so poor, I can't find it anymore.
In short: is there something like:
if(testing_enabled)
Can I use CMakeLists in?
I think you are thinking about which is allowed: BUILD_TESTING
BUILD_TESTING
include(CTest)
and by default ON .
ON