安装最新的 cmake 二进制文件并自动接受许可证

Rek*_*vni 8 c++ cmake 16.04

我正在尝试在 Ubuntu 16.04 LTS 上自动(通过 ansible)安装最新的二进制版本的 cmake。

到目前为止,我已经完成了:

mkdir ~/tmp
cd ~/tmp
wget https://cmake.org/files/v3.10/cmake-3.10.0-rc4-Linux-x86_64.sh
chmod +x cmake-3.10.0-rc4-Linux-x86_64.sh
sudo ./cmake-3.10.0-rc4-Linux-x86_64.sh
Run Code Online (Sandbox Code Playgroud)

但是,这会带来许可协议。

有没有办法添加前缀,或者自动接受协议的东西?

ste*_*ver 12

如果你运行安装程序,--help你会发现它有一个--skip-license命令行选项:

$ ./cmake-3.10.0-rc4-Linux-x86_64.sh --help
Usage: ./cmake-3.10.0-rc4-Linux-x86_64.sh [options]
Options: [defaults in brackets after descriptions]
  --help            print this message
  --version         print cmake installer version
  --prefix=dir      directory in which to install
  --include-subdir  include the cmake-3.10.0-rc4-Linux-x86_64 subdirectory
  --exclude-subdir  exclude the cmake-3.10.0-rc4-Linux-x86_64 subdirectory
  --skip-license    accept license
Run Code Online (Sandbox Code Playgroud)