Renaming `CMakeLists.txt`

Viewed 3208

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

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.

2 Answers

There's no reasonable excuse that CMake doesn't use a specified file extension like every other tool in the toolkit. You can do this by putting a dummy CMakeLists.txt, which contains:

cmake_minimum_required(VERSION 3.8)
INCLUDE("meaningfulFilename.cmake")

Then put your actual cmake code in the .cmake file.

Related