minor reorganization of root cmakelist

This will allow for slightly easier expansion
stupid mistake: wrong order of typedef