Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming `CMakeLists.txt`

Tags:

cmake

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.

like image 835
mattmilten Avatar asked Jul 25 '17 17:07

mattmilten


1 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.

like image 69
Roderick Avatar answered Nov 15 '22 09:11

Roderick