Eclipse,cmake,Windows,MingW-什么Makefile生成器? [英] Eclipse, cmake, Windows, MingW - What Makefile generator?

查看:43
本文介绍了Eclipse,cmake,Windows,MingW-什么Makefile生成器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我选择"Eclipse MingW Makefile"或"Eclipse Unix Makefile",则在Windows上使用cmake和eclipse以及MingW有什么区别?

What's the difference on Windows with cmake and eclipse and MingW if I choose "Eclipse MingW Makefile" or "Eclipse Unix Makefile"?

使用MingW,我总是会遇到"sh.exe"错误(如果我再次按"Configure",该错误将消失),对于Unix,我总是必须手动指定windes,因为cmake找不到它.

With the MingW one I always get an error with "sh.exe" (that vanishes if I re-hit "Configure"), with the Unix one I always have to specifiy windres manually because cmake can't find it.

这对Eclipse或其他东西有什么影响吗?

Does this make any difference for Eclipse or something else?

两个生成的Makefile都可以与Eclipse和MingW一起使用,并编译我的项目.

Both generated Makefiles work with Eclipse and MingW and compile my project.

我应该选择哪个Makefile?为什么呢?

What Makefile should I choose? And why?

推荐答案

这真是一团糟.

CMake在Windows上具有许多不同的Makefile生成器:MSYS,MinGW,NMake和Unix.CDT生成器在Makefile生成器之上工作,通过为您生成一个Eclipse项目.当前,CDT生成器仅支持MinGW,NMake和Unix.

CMake has a number of different Makefile generators on Windows: MSYS, MinGW, NMake, and Unix. The CDT generator works on top of the Makefile generators by also generating an Eclipse project for you. Currently, only MinGW, NMake, and Unix are supported by the CDT generator.

它们之间的区别在于它使用哪种制造"风味.MinGW,MSYS和Unix都是GNU make的变体(在这种情况下,Unix的意思是"Cygwin").这些差异主要与如何执行命令,更具体地说,是使用哪个外壳程序来执行命令.GNU make会非常努力地使用"sh.exe"而不是"cmd.exe",这通常是出问题的地方:在Makefile中有一个命令,该命令假定有关要使用哪个shell的详细信息.选择GNU make风味时的另一个问题是弄清楚哪些标准的Unix实用程序可用(sed/grep/etc).一个值得注意的细节是,如果GNU make使用cmd.exe执行命令,它将不支持并行构建.

The difference between these are which "make" flavor it uses. MinGW, MSYS, and Unix are all variants of GNU make (in this context, Unix means "Cygwin"). The difference between these are mostly related to how commands are executed, more specifically which shell is used to execute the commands. GNU make will try very hard to use "sh.exe" instead of "cmd.exe", and this is usually where things go wrong: having a command in a Makefile which assumes details about which shell being used for execution. Another problem when choosing GNU make flavor is to figure out which standard Unix utilities are available (sed/grep/etc). One notable detail is that if GNU make is using cmd.exe to execute commands, it will not support parallell builds.

如果您使用Unix Makefile,则CMake将假定您的make是Cygwin,带有完整的Unix仿真.

If you use Unix Makefiles, CMake will assume that your make is a Cygwin one, with full Unix emulation.

还请确保您实际运行的是正确的" make.如果生成了Unix Makefile,但是首先在PATH中设置了MinGW make,那么在生成树中键入"make"可能会因奇怪的错误而失败.

Also make sure that you actually run the "right" make. If you have generated Unix Makefiles, but you have MinGW make first in your PATH, then typing "make" in your build tree is likely to fail with weird errors.

但是关于您的问题:只要有效,这并不重要.

But about your question: it really doesn't matter as long as it works.

这篇关于Eclipse,cmake,Windows,MingW-什么Makefile生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆