Qt 从源代码构建 Qt 时如何清理旧的配置?

发布于 2024-11-08 22:00:38 字数 62 浏览 0 评论 0原文

我正在从源代码编译 Qt,但我不想每次构建它时都提取源代码。

如何使用配置工具清除以前的配置?

I'm compiling Qt from source, but I don't want to extract the source each time I want to build it.

How can I clean previous configuration with the configure tool?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

分開簡單 2024-11-15 22:00:38

对于 Qt4 及更早版本,请尝试以下操作:

nmake confclean

然后您可以重新配置并重新编译 QT。

正如评论中所指出的,这在 QT 5 中不再有效。这是因为 Qt 项目现在对不同部分使用单独的子模块。如果您有 Qt git 存储库的本地克隆,您可以尝试从主 Qt 目录调用它:

git submodule foreach --recursive "git clean -dfx"

如前所述 这里,如果您下载了源存档,可能会出现一些问题。我发布的链接建议使用影子构建,因此进行干净配置的过程就像配置在新的影子构建目的地进行构建一样简单。

For Qt4 and earlier, try this:

nmake confclean

You can then re-configure and re-compile QT.

As noted in the comments, this no longer works in QT 5. This is due to the fact that the Qt project now uses separate sub-modules for different parts. If you have a local clone of the Qt git repos, you can try calling this from the main Qt directory:

git submodule foreach --recursive "git clean -dfx"

As noted here, there may be some problems if you have a downloaded source archive. The link I posted suggests using a shadow build instead so the process of making a clean configuration is as simple as configuring to build at a new shadow build destination.

素年丶 2024-11-15 22:00:38

截至今天(Qt 5.9.0 beta2),Linux 中没有 confclean 目标,您需要手动删除 .config.cache 文件才能重新配置。

请注意,make distclean 根本没有帮助。

As of today (Qt 5.9.0 beta2) there is no confclean target in Linux, and you need to manually remove .config.cache file to reconfigure.

Note that make distclean doesn't help at all.

追我者格杀勿论 2024-11-15 22:00:38

对于最新版本,使用影子构建,然后您可以直接删除您的目录。我的用于配置的批处理文件有效地创建了一个新文件夹,移入其中,然后调用配置。
然后你只需进入影子目录并运行“jom”。
当您想要进行不同的配置时,只需使用不同的影子目录即可。
这实际上意味着您的源代码树不会充满构建工件,当您需要不同的配置时,这些构建工件是不可能删除的。相信我,这就是要做的事情......

mkdir shadow_dir
cd shadow_dir
%~dp0\src\configure.bat ....

For the latest versions, use a shadow build, then you can just nuke your directory. My batch file for configuring effectively creates a new folder, moves into it, then calls configure.
Then you just go into the shadow directory and run 'jom'.
When you want to make a different configuration, just use a different shadow directory.
This effectively means that your source tree doesn't get filled with build artifacts, which are impossible to remove when you want a different configuration. Trust me, this is the thing to do....

mkdir shadow_dir
cd shadow_dir
%~dp0\src\configure.bat ....
我是男神闪亮亮 2024-11-15 22:00:38

在 Ubuntu 上:

make confclean

顺便说一句,运行配置后显示以下文本:

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /home/ben/qt/qt-everywhere-opensource-4.7.4-debug

To reconfigure, run 'make confclean' and 'configure'. 

On Ubuntu:

make confclean

BTW, the following text displayed after run configure:

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /home/ben/qt/qt-everywhere-opensource-4.7.4-debug

To reconfigure, run 'make confclean' and 'configure'. 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文