restructured the cmake build script a bit