【发布时间】:2014-06-27 04:18:51
【问题描述】:
$ wget --quiet http://download.qt-project.org/official_releases/qt/5.2/5.2.1/qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe
$
如上所示,我首先在 Cygwin Bash shell 中下载了 Visual Studio 的 Qt 包。
旁注:Cygwin 中打包的 Qt 库对我没有用,因为我需要使用 Visual Studio C++ 编译器。
首先我对文件设置了正确的权限
$ chmod 755 qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe
如果我这样开始
$ ./qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe
显示了一个图形窗口 (GUI),但这不是我想要的,因为我稍后希望将安装过程写入可以在 Cygwin 中运行的 Bash 脚本。
如果我添加选项--help,像这样
$ ./qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe --help
打开一个新的终端窗口,显示以下文本
Usage: SDKMaintenanceTool [OPTIONS]
User:
--help Show commandline usage
--version Show current version
--checkupdates Check for updates and return an XML file describing
the available updates
--updater Start in updater mode.
--manage-packages Start in packagemanager mode.
--proxy Set system proxy on Win and Mac.
This option has no effect on Linux.
--verbose Show debug output on the console
--create-offline-repository Offline installer only: Create a local repository inside the
installation directory based on the offline
installer's content.
Developer:
--runoperation [OPERATION] [arguments...] Perform an operation with a list of arguments
--undooperation [OPERATION] [arguments...] Undo an operation with a list of arguments
--script [scriptName] Execute a script
--no-force-installations Enable deselection of forced components
--addRepository [URI] Add a local or remote repo to the list of user defined repos.
--addTempRepository [URI] Add a local or remote repo to the list of temporary available
repos.
--setTempRepository [URI] Set a local or remote repo as tmp repo, it is the only one
used during fetch.
Note: URI must be prefixed with the protocol, i.e. file:///
http:// or ftp://. It can consist of multiple
addresses separated by comma only.
--show-virtual-components Show virtual components in package manager and updater
--binarydatafile [binary_data_file] Use the binary data of another installer or maintenance tool.
--update-installerbase [new_installerbase] Patch a full installer with a new installer base
--dump-binary-data -i [PATH] -o [PATH] Dumps the binary content into specified output path (offline
installer only).
Input path pointing to binary data file, if omitted
the current application is used as input.
我不知道如何从这里继续。你知道我如何从 Cygwin 中的 Bash shell 安装 Qt 5.2.1 库(用于 Visual Studio)吗?
更新: 为 Cygwin 环境编写构建脚本的优势在于,像 git、wget 和 scp 这样的命令 可用。这个Stackoverflow answer 描述了如何从 Cygwin bash 脚本调用 MSVC 编译器。请注意,我正在构建的 Qt 应用程序不会对 Cygwin 有任何依赖。
【问题讨论】:
-
为 MSVC 编译的二进制文件与为 Cygwin 编译的二进制文件不兼容。也许你可以解释一下你真正想要完成的事情?
-
您最好不要将 cygwin 与此混合。只需编写一个 bat 文件(如果您尝试做的事情是可能的)。
-
我现在更新了这个问题。至于“社区”编辑,只是我忘记登录了。
-
现在可能已经解决了。我还没有验证它,但在 Qt bug report 中写了这条评论:最新的在线安装程序和 5.5.0 离线安装程序提供了一种无人值守安装的方式。即使从普通终端。
-
@ErikSjölund 我也对该错误报告中的评论的含义感到困惑。这不是很有帮助,因为它仍然让我不知道如何真正实现自动化。你找到解决办法了吗?
标签: qt command-line installation cygwin