Adapt run and build scripts for cmake