modified generate_cmake.sh