In your main CMakeLists.txt you need to add the following function call (not in a subfolder):
enable_testing()
Look at the subchapters for recipes for popular frameworks.