Refactors CMakeLists.txt into a single file