使用 IDE 的跨平台构建系统?

发布于 2024-12-07 14:20:03 字数 1539 浏览 1 评论 0 原文

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

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

发布评论

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

评论(4

青柠芒果 2024-12-14 14:20:03

Qt 框架使用 Qmake - 它具有跨平台 ide <使用 qmake .pro 文件的 href="http://qt.nokia.com/products/developer-tools/" rel="nofollow">QtCreator。

还有一个 Visual Studio 插件,可以将 .pro 与 Visual Studio 项目相互转换

The Qt framework uses Qmake - it has a cross platform ide QtCreator that uses the qmake .pro files.

There is also a plugin for visual studio that will convert .pro to and from visual studio projects

扮仙女 2024-12-14 14:20:03

Codeblocks 还具有跨平台构建系统。

Codeblocks 通过其 Codeblocks 项目文件自行构建。

Codeblocks also has a cross-platform build system.

Codeblocks builds itself through its Codeblocks project file.

睫毛上残留的泪 2024-12-14 14:20:03

我已经研究了类似您正在寻找的解决方案,但没有找到任何令人满意的解决方案。我目前正在为每个平台维护单独的项目文件(Visual Studio、OSX 和 iOS 的 XCode、Linux、Android 和 webOS 的 makefile)。我发现让它们保持同步并不需要太多工作,所以我不介意。

但无论如何,这里有一些我认为最有希望实现您想要的想法:

  1. 我认为您正在使用的 CMake 解决方案是最好的,但确实每次您重新生成您的项目自定义设置丢失。您可能希望生成包含所有设置的补丁文件,以便在运行 CMake 更新项目后可以重新应用这些更改。这应该适用于存储在文本文件中的设置,因此它适用于 .sln、.vcxproj、vcxproj.filters 和 vcxproj.user 文件。

  2. 您可能会幸运地使用 EclipseNetbeans。两者都是跨平台 IDE,允许您在多个平台上使用单个项目文件。如果您的项目处于源代码控制之下,那么您可以从主平台提交项目文件,然后在其他平台上您只需检出项目并对设置(目录等)进行必要的更改。您只需要记住始终从主平台提交对项目的更改,而在其他平台上,本地更改将仅保留在本地源代码树中。

上面的选项 #2 不错,但不适合我,因为我已经对 VS 调试器上瘾了,它比其他任何东西都要好得多,我不会考虑任何不包含它的设置。

祝你好运!

I have investigated a solution like the one you are looking for and haven't found anything satisfactory. I'm currently maintaining separate project files for each of my platforms (Visual Studio, XCode for OSX and iOS, makefiles for Linux, Android and webOS). I have found that it isn't a lot of work to keep them in sync, so I don't mind.

But in any case, here are a couple of ideas that I think are the most promising to achieve what you want:

  1. I think the CMake solution that you are using is the best, but it is true that each time you regenerate your project custom settings are lost. You may want to generate a patch file with all your settings, so that you can reapply those changes after running CMake to update your projects. This should work for settings stored in text files, so it works for .sln, .vcxproj, vcxproj.filters and vcxproj.user files.

  2. You may have some luck with Eclipse or Netbeans. Both are cross-platform IDEs that will allow you to work with a single project file on multiple platforms. If you have your project under source control, then you can commit the project files from your main platform, and then on other platforms you just check out the projects and make the necessary changes to the settings (directories, etc.). You just need to remember to always commit changes to the projects from the main platform, and on the other ones the local changes will stay only in your local source tree.

Option #2 above is decent, but not an option for me, as I have developed an addiction to the VS debugger, it is so much better than anything else that I would not consider any setup that does not include it.

Good luck!

清风无影 2024-12-14 14:20:03

这就是我最终所做的:

  • 我坚持使用 CMake 而不是 qmake,因为它看起来更强大,并且易于单独安装。而且两者都只生成 Makefile,所以它们对我来说几乎做同样的事情。
  • 由于 CMake 创建的 Eclipse/VisualStudio 项目文件仅用于构建,因此我无法使用它们(不可能在 IDE 内部运行/调试)。现在我正在创建标准 Makefile,然后使用手动维护 Eclipse 项目来构建它们。
  • 我添加了一个到源目录的文件系统链接,并且代码完成和调试正在工作。

Here is what I ended up doing:

  • I stuck to CMake over qmake, since it simply seems more powerful, and is easy to install seperatly. Also both only generate Makefiles so they pretty much do the same for me.
  • Since the Eclipse/VisualStudio project files created by CMake are only there for building I couldn't use them (running/debugging inside of IDE is not possible). Now I'm creating standard Makefiles and then build these with a hand mantainend Eclipse Project.
  • I added a filesystem link to my source directory and code completion and debugging are working.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文