重命名`CMakeLists.txt` [英] Renaming `CMakeLists.txt`

查看:139
本文介绍了重命名`CMakeLists.txt`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以将各种 CMakeLists.txt 重命名为更有意义的东西?

Is there any way to rename the various CMakeLists.txt into something more meaningful?

可以在处理包含多个CMake项目的较大项目时,要同时打开其中的许多文件很让人分心。

It can be quite distracting to have a bunch of them open at the same time when working on a bigger project that contains several CMake projects.

推荐答案

不,不可能。名称是有意义的,您会习惯的。

No, it's not possible. The name is meaningful, you will get used to it.

声明:CMake必须找到文件,常见的选择是相关文件具有通用名称,CMake会看起来在每个文件夹中。 Make(Makefile)和Autotools(例如Makefile.am)选择相似。

Rationale: CMake must find the files, the common choice is the related files have a common name and CMake will look for it in every folder. Make (Makefile) and Autotools (e.g. Makefile.am) chose similar.

另一种方法是在整个项目范围内配置文件名(您的问题仍然存在)或指示父目录中文件中的文件名(容易出错)。

Alternative approaches would be to configure the file name project wide (your problem would remain) or indicating the file names in the file in the parent directory (error prone).

这篇关于重命名`CMakeLists.txt`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆