我正在努力追随这些说明使用 MinGW-w64 编译器在 MSYS2 上编译安装 BASIS(CMake 构建系统和软件实现标准)。但是,那ccmake ..
步骤失败:
-bash:ccmake:找不到命令
我尝试通过以下方式搜索 MSYS2 软件包pacman -Ss ccmake
没有结果。所以我想我必须使用命令行cmake
反而:
cmake -DCMAKE_INSTALL_PREFIX:PATH=~/local -DBUILD_APPLICATIONS:BOOL=ON -DBUILD_EXAMPLE:BOOL=ON ..
失败原因:
CMake Error at src/cmake/modules/ProjectTools.cmake:876 (message):
CMAKE_INSTALL_PREFIX must be an absolute path!
Call Stack (most recent call first):
src/cmake/modules/ProjectTools.cmake:2525 (basis_installtree_asserts)
src/cmake/modules/ProjectTools.cmake:2751 (basis_project_begin)
CMakeLists.txt:69 (basis_project_impl)
作为解决方法,我改变了~/local
to /home/<userName>/local
这似乎正在发挥作用。但是,我不知道 MakeFile 在哪里,因为运行时make .
我收到错误:
mingw32-make: *** 未指定目标且未找到 makefile。停止。
鉴于我有alias make='mingw32-make
in the ~/.bashrc
文件。如果您能帮助我了解问题所在以及如何解决它,我将不胜感激。我有 MSYS2-MinGW-w64 包mingw64/mingw-w64-x86_64-cmake
安装。我的Windows版本是1909,
MSYS_NT-10.0-18363 是我的环境。
P.S.1.查看 CMake 的输出,我现在看到实际上有一个警告:
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
这对于这个项目来说有点讽刺,但我不确定这是否是编译失败的原因。
P.S.2.我有mingw64/mingw-w64-x86_64-cmake
安装的软件包,其中没有ccmake
工具。但是msys/cmake
做。所以:
pacman -R mingw-w64-x86_64-cmake
pacman -S msys/cmake
now ccmake
可用。