问题描述
正如 make clean
删除makefile生成的所有文件,我想对CMake做同样的事情。我经常发现自己手动通过目录删除文件,如 cmake_install.cmake
和 CMakeCache.txt
code> CMakeFiles 文件夹。
Just as make clean
deletes all the files that a makefile has produced, I would like to do the same with CMake. All too often I find myself manually going through directories removing files like cmake_install.cmake
and CMakeCache.txt
, and the CMakeFiles
folders.
有一个命令 cmake clean
自动删除所有这些文件?理想情况下,应遵循当前目录的 CMakeLists.txt
文件中定义的递归结构。
Is there a command like cmake clean
to remove all these files automatically? Ideally this should follow the recursive structure defined within the current directory's CMakeLists.txt
file.
推荐答案
没有 cmake clean
。
我通常在一个文件夹中创建项目,建立。所以如果我想 make clean
,我可以只是 rm -rf build
。
I usually build the project in a single folder like "build". So if I want to make clean
, I can just rm -rf build
.
与根CMakeLists.txt在同一目录中的build文件夹通常是一个不错的选择。要构建项目,只需将cmakeLists.txt的位置作为参数指定给cmake。例如: cd< location-of-cmakelists> / build&& cmake ..
。 (From @ComicSansMS)
The "build" folder in the same directory as the root "CMakeLists.txt" is usually a good choice. To build your project, you simply give cmake the location of the CMakeLists.txt as an argument. For example: cd <location-of-cmakelists>/build && cmake ..
. (From @ComicSansMS)
这篇关于查找“cmake clean”命令以清除cmake输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!