cmake MSYS Makefiles生成器丢失 [英] cmake MSYS Makefiles generator missing

查看:2518
本文介绍了cmake MSYS Makefiles生成器丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有通过pacman安装的cmake 3.2.3。我尝试从msys64 shell使用它时出现错误:

I have cmake 3.2.3 installed via pacman. I get an error when I try to use it from a msys64 shell:

$ cmake -G "MSYS Makefiles" ..
CMake Error: Could not create named generator MSYS Makefiles

cmake --help不列出作为一个可用的生成器。

cmake --help does not list it as an available generator.

我看到有一个MSYS.cmake在/usr/share/cmake-3.2.3/Modules/Platform。

I do see there is an MSYS.cmake in /usr/share/cmake-3.2.3/Modules/Platform.

我缺少什么?

推荐答案

Linux with MinGW

MinGW MSYS 发生器仅适用于基于Windows的发行版。请参阅 #ifdef > cmake.cxx

The MinGW and MSYS generators are only available on Windows based distributions. See #ifdef in cmake.cxx:


#if defined(_WIN32) && !defined(__CYGWIN__)


如果要进行交叉编译一个可用的MinGW工具链。参见例如。在CMake的wiki中如何使用MinGW交叉编译Windows软件

If you're cross-compiling use one of the available MinGW toolchains. See e.g. "How to use MinGW to cross compile software for Windows" chapter in CMake's wiki.

如果您在Windows上使用MinGW编译Windows二进制文件

在我的Windows PC上, CMake安装(正常的MSI Windows Installer与CMake目录添加到PATH环境),它工作从标准的CMD shell和我的MSYS shell。

On my Windows PC I only have one CMake installation (the normal MSI Windows Installer with CMake directory added to PATH environment), which works from standard CMD shells and from my MSYS shells.

所以在这种情况下,不需要安装一个特殊的MinGW版本的CMake(例如CygWin)。

So in this case there is no need to install a special MinGW version of CMake (like e.g. for CygWin).

但我最近几次用MinGW-w64从源代码重建CMake,以测试 cmake.exe 它没有开箱即用。要解决链接器错误,我添加了 -DCMAKE_EXE_LINKER_FLAGS = - Wl, - allow-multiple-definition如推荐这里,结果 cmake.exe 支持MSYS Makefile生成器。

But I've rebuild CMake from source with MinGW-w64 several times lately to test some performance optimizations of cmake.exe and it did not work out-of-the-box. To work around the linker errors I've added -DCMAKE_EXE_LINKER_FLAGS="-Wl,--allow-multiple-definition" like recommended here and the resulting cmake.exe still supports the "MSYS Makefiles" generator.

所以是的,有 - 你可能已经评论过了,很可能是pacman build错误。

So yes, there is - as you have commented - most probably something wrong with the pacman build.

这篇关于cmake MSYS Makefiles生成器丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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