OpenEuler下运行cmake项目

  完成了在树莓派上安装OpenEuler并且成功安装了GCC环境,因为习惯想使用cmake来进行项目管理。首先安装cmake:

dnf install cmake

ps:若安装失败则多次执行,直到成功
  显示下图代表成功:
在这里插入图片描述
  然后开开心心写一个一个cmake的模板代码做测试,但是却在cmake阶段报错,报错信息如下:

[root@openEuler build]# cmake ..
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.22)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/gcc++/build/CMakeFiles/CMakeOutput.log".

  这个是因为虽然cmake装完了,但是有些关键字还是没有设置,需要再安装一下make,执行

dnf install make

  如下安装成功:
在这里插入图片描述
  然后再使用cmake就不会报错了:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/gls_nuaa/article/details/129131978