improve flexibility of setup_with_cmake.py