Amani
Amani

Reputation: 18123

How do I scaffold a new C++ project using CMake?

Is there a way to quickly scaffold a basic C++ CMake project using CMake itself? For examples in an empty directory calling cmake new then CMake asks a few questions e.g. project name, lisence and generator. Then CMake generates all the required files and directories, e.g. CMakeLists.txt file, src directory and probably initialize it as Git repository.

Upvotes: 3

Views: 860

Answers (2)

Q Q
Q Q

Reputation: 273

You may write a CMake function to create an empty project with a specific layout. file command helps you to create files and directories.

Upvotes: 0

Remigijus Pankevičius
Remigijus Pankevičius

Reputation: 1132

I don't know of such features and I don't see a point to add scaffolding into CMake itself. There are free and popular tools specifically for scaffolding purpose, so I suggest you to go to yeoman or slush generators search pages and search for cmake.

Upvotes: 1

Related Questions