{"id":13678617,"url":"https://github.com/Hopson97/cpp-project-generator","last_synced_at":"2025-04-29T15:32:14.333Z","repository":{"id":37030560,"uuid":"194391925","full_name":"Hopson97/cpp-project-generator","owner":"Hopson97","description":"For personal use, easily creates new C++ project files with Cmake etc","archived":false,"fork":false,"pushed_at":"2023-04-23T20:24:35.000Z","size":2410,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-02T13:23:57.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hopson97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-29T10:13:48.000Z","updated_at":"2023-07-02T12:11:09.000Z","dependencies_parsed_at":"2024-08-02T13:17:04.096Z","dependency_job_id":"085913d9-3881-4aff-9ac0-cf5c2e8f4356","html_url":"https://github.com/Hopson97/cpp-project-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2Fcpp-project-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2Fcpp-project-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2Fcpp-project-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2Fcpp-project-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hopson97","download_url":"https://codeload.github.com/Hopson97/cpp-project-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224178966,"owners_count":17268981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:00:56.149Z","updated_at":"2024-11-11T21:30:53.869Z","avatar_url":"https://github.com/Hopson97.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# C++ Project Generator\n\nThis is primarily for personal use, though feel free to use it youself as well.\n\nOften when creating new C++ projects, I would end up copy and pasting CMakeLists.txt files and build scripts, manually having to change project names and other mundane activies. To mitigate this issue, I created this project, which would create these project files for me.\n\n## Building\n\nOn linux\n\n```bash\nsh build.sh release\n```\n\n## Configuartion\n\n### Setting up\n\nThe project makes some assumptions about your C++ workspace structure:\n\nFor example, on my system, I have this:\n\n```sh\n├── cpp\n    └── cpp-project-generator\n```\n\nMy C++ projects are in the `cpp` directory, and the project generator is in the `cpp/cpp-project-generator` directory.\n\nTo create the generator, `cd` into `cpp-project-generator` and run:\n\n```bash\nsh install.sh\n```\n\nAfter building, your cpp-projects folder will have the following structure:\n\n```sh\n└── cpp-projects\n    ├── new.py\n    ├── cpp-project-generator\n    └── templates\n        ├── _common\n        ├── _deps\n        ├── opengl\n        ├── sfml\n        └── terminal\n\n```\n\nThis created added the `new.py` script, which can be used to create projects.\n\nIt also created a `templates` directory. This is where scripts for your new projects will be copied from, as well as where the project template layouts are stored. For example, SFML projects use the layout from the templates/sfml folder, and then copy the scripts into a scripts folder. More info in text section.\n\nThe scripts:\n\n* `build.sh` - Used to build your projects. Use `build.sh release` to build in release mode.\n* `run.sh` - Used to run your projects. Use `run.sh release` to run in release mode.\n* `debug.sh` - Used to run GDB to debug your project.\n\n### Using\n\nTo use, `cd` to your `cpp` folder and then:\n\n`python3 new.py \u003cProject type\u003e \u003cProject name\u003e`\n\n* Project type: The project template to use, eg terminal or sfml. This can be any directory in the projects/ folder\n* Project name: The name of the project to create, eg my-app\n\nEG\n\n`python3 new.py terminal my-app`\n\n#### Adding new templates\n\nTo add a template, simply create a folder in the cpp-project-generator/templates/ directory, inside including all the files you need for that template.\n\nYou must provide a CMakeLists file, where the project name is \u003cPNAME\u003e, which this program will auto replace with the name chosen on project create.\n\nRerun `sh install.sh` to update the templates folder in the `cpp` directory.\n\n#### Example usage\n\n```bash\npython3 new.py terminal my-app\n```\n\nThis will create a project folder `cpp/my-app/` with the structure\n\n```sh\n└── my-app\n    ├── CMakeLists.txt\n    ├── scripts\n    │   ├── build.sh\n    │   ├── debug.sh\n    │   └── run.sh\n    └── src\n        └── main.cpp\n```\n\nAfter doing `cd` to the directory, it can then be built and ran:\n\n```bash\n./scripts/build.sh\n./scripts/run.sh\n```\n\nAfter the build stage, it creates the following structure:\n\n```\n└── my-app\n    ├── bin\n    │   ├── debug\n    │   │   ├── CMakeCache.txt\n    │   │   ├── CMakeFiles\n    │   │   ├── cmake_install.cmake\n    │   │   ├── Makefile\n    │   │   └── new\n    │   └── release\n    ├── CMakeLists.txt\n    ├── scripts\n    │   ├── build.sh\n    │   ├── debug.sh\n    │   └── run.sh\n    └── src\n        └── main.cpp\n```\n\nWhere the target was built in the `bin/debug/` directory.\n\nTo build and run in release mode, use the `release` argument:\n\n```bash\n./scripts/build.sh release\n./scripts/run.sh release\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHopson97%2Fcpp-project-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHopson97%2Fcpp-project-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHopson97%2Fcpp-project-generator/lists"}