Why isn#39;t the command quot;cmake .quot; generating a makefile?(为什么不是命令“cmake.生成makefile?)
问题描述
我在终端中运行 cmake .
并说它生成了一些东西,然后我运行 make
并说
I run cmake .
in terminal and it says it generated something, then I run make
and it says
make: *** No targets specified and no makefile found. Stop.
我想我错过了一些我需要做的事情,但我不知道是什么.它应该创建了一个 make 文件,然后我可以构建并安装该文件.
I'm guessing I've missed something else that I need to do but I can't figure out what. It should have created a make file that I can then build and then install.
如果我说的太含糊了,请告诉我我还能对这个问题补充什么.
If I'm being too vague please let me know what more I can add to this question.
* 编辑 *
$ cmake .
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
freeglut
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /Users/nicholasl/Downloads/freeglut-3.0.0
**** 构建目录内容 ****
**** contents of build directory ****
$ ls
AUTHORS android
Build android_toolchain.cmake
CMakeCache.txt blackberry.toolchain.cmake
CMakeFiles cmake_install.cmake
CMakeLists.txt config.h
CMakeScripts config.h.in
COPYING doc
ChangeLog freeglut.pc
README freeglut.pc.in
README.android freeglut.rc.in
README.blackberry freeglut.xcodeproj
README.cmake include
README.cygwin_mingw mingw_cross_toolchain.cmake
README.mingw_cross progs
README.win32 src
推荐答案
似乎 CMake 默认在 Mac 上生成 XCode 项目.CMake 生成 freeglut.xcodeproj
以及所有支持文件.
It seems CMake defaults to generating an XCode project on Mac. CMake generated freeglut.xcodeproj
along with all supporting files.
你最好从一个空目录运行 cmake
,这样你就可以看到它在运行时实际做了什么.
You are better off running cmake
from an empty directory, so you can see what it actually does when it is run.
要生成 makefile(并创建构建目录),请执行
To generate a makefile (and create a build directory), do
mkdir -p cmake-build && cd cmake-build
cmake .. -G"Unix Makefiles"
然后它应该生成一个Makefile
.
这篇关于为什么不是命令“cmake".生成makefile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么不是命令“cmake".生成makefile?
基础教程推荐
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07