Cleaned up and generalized CMakeLists.txt