通过make运行时未找到CMake [英] CMake is not found when running through make
问题描述
我正在尝试构建 https://github.com/AlbertWerner/cryptonotecoinwallet 并面对一个问题.
I'm trying to build https://github.com/AlbertWerner/cryptonotecoinwallet and facing an issue.
根据仓库的自述文件,我可以运行cmake
命令,它可以完成而没有任何错误.但是然后,当我运行make
时,它给了我下面的错误.
According to the README of the repo, I can run cmake
command and it completes without any errors. But then, when I run make
, it gives me the below error.
$ make
make: /usr/bin/cmake: Command not found
make: *** [Makefile:5138: cmake_check_build_system] Error 127
我正在Windows上使用MSYS,下面是相应的详细信息.
I'm using MSYS on Windows and here are the corresponding details.
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/mingw32/bin
$ which cmake
/mingw32/bin/cmake
似乎在错误的路径中寻找cmake
.
Seems like it's looking for cmake
in the wrong path.
Makefile
cmake_check_build_system:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system # <== Line 5139
我不确定这是怎么回事.请帮帮我.
I'm not sure what's wrong. Please help me out.
谢谢.
推荐答案
请确保使用MSYS2安装顶层的mingw32.exe
可执行文件启动MSYS2,并在首次运行cmake
和构建项目的命令应类似于以下内容:
Make sure that you launch MSYS2 using the mingw32.exe
executable at the top level of your MSYS2 installation, and that you use that environment when you first run cmake
. If you ran CMake in a different environment, remove all the files it created. The commands for running cmake
and building the project should be something like this, assuming the developers have set it up in a reasonable way:
mkdir build
cd build
cmake .. -G"MSYS Makefiles"
make
我没有亲自尝试此操作,因为我对从互联网上运行随机代码保持谨慎,但是我在CMakefile中发现了此注释,指示开发人员不支持MSYS2:
I didn't try this myself because I am wary of running random code from the internet, but I found this note in the CMakefile indicating that the developers do not support MSYS2:
if (WIN32)
if (NOT MSVC)
message(FATAL_ERROR "Only MSVC is supported on this platform")
endif ()
...
因此,如果您确实想执行此操作,则必须花费一些精力将此程序中Windows特定于Windows的代码移植到GCC.
So you will have to spend some effort on porting the Windows-specific code in this program to GCC if you really want to do this.
这篇关于通过make运行时未找到CMake的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!