A simple and lightweight C++ command-line tool designed to bootstrap new C++ projects. It guides you through a few prompts to automatically generate a tailored, valid CMakeLists.txt configuration file.
- Project Metadata: Sets the project name and executable target name.
- C++ Standard Selection: Allows configuration of C++ standards (e.g., 17, 20, 23).
- Multi-Library Support: Interactively adds multiple external dependencies (like
raylib,OpenCV, orfmt) using CMake'sfind_packageand links them efficiently undertarget_link_libraries. - Zero Dependencies: Built entirely using standard C++ features (
<iostream>,<fstream>,<vector>).
Compile the source file using any modern C++ compiler:
g++ generator.cpp -o cmakegenExecute the binary in the root directory of your new project:
mv cmakegen /usr/local/bin/
cmakegenEnter project name: MyGame
Enter C++ standard version (e.g., 17, 20): 17
Enter output executable name: game
--- External Libraries Configuration ---
Enter library names one by one (e.g., raylib, OpenCV, Threads).
Press Enter on a blank line when you are finished.
Enter library name (or leave blank to finish): raylib
Enter library name (or leave blank to finish): OpenCV
Enter library name (or leave blank to finish):
Success! CMakeLists.txt has been generated with 2 libraries.