Welcome to the ESMA_cmake wiki!
To build just one subtree with debug flags:
cmake <src-dir> -DDEBUG_<dir>=ON
where <dir> is the top directory of the subtree to be targeted.
To deactivate:
cmake <src-dir> -DDEBUG_<dir>=OFF