Using cmake 3.5.2 installed through MSYS2 under Wi

2019-04-16 04:21发布

I'm trying an hello world test to make cmake under Windows, using MinGW as compiler. This answer suggests to run cmake with the -G flag as following:

 cmake -G "MinGW Makefiles" .

However, if I do this, I get a message saying that that is not a known generator. Indeed, running cmake --help, under the Generators section it lists the following generators:

enter image description here

and as you can see, "MinGW Makefiles" is not listed.

If this is relevant, I have MinGW installed and working on my system in the usual folder C:\MinGW. I also have MinGW-w64 installed through WinBuilds and MSYS2, again in the default installation folders. I'm using cmake version 3.5.2, installed through MSYS2.

Why is "MinGW Makefiles" not listed among the generators?

1条回答
在下西门庆
2楼-- · 2019-04-16 04:52

Only the Windows version of CMake does know the MinGW Makefiles and MSYS Makefiles generators.

If you have downloaded the MinGW/MSYS CMake version try using the Unix Makefiles generator or don't use the -G option (to auto-detect your compiler toolchain).

If you still get errors, please see the references below.

References

查看更多
登录 后发表回答