简体   繁体   中英

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 eg project name, lisence and generator. Then CMake generates all the required files and directories, eg CMakeLists.txt file, src directory and probably initialize it as Git repository.

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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM