Modified build scripts to use CMake