CMake generalizations

Made CMake easier to configure