{"id":17453259,"url":"https://github.com/cjdb/new_cxx_project","last_synced_at":"2025-04-14T15:43:01.480Z","repository":{"id":250980182,"uuid":"836038534","full_name":"cjdb/new_cxx_project","owner":"cjdb","description":"A tool that generates a new C++ project structure so you can start writing your project immediately","archived":false,"fork":false,"pushed_at":"2024-08-24T19:44:30.000Z","size":350,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T10:06:56.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cjdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-07-31T03:27:53.000Z","updated_at":"2024-10-31T15:39:34.000Z","dependencies_parsed_at":"2024-08-24T20:52:13.624Z","dependency_job_id":null,"html_url":"https://github.com/cjdb/new_cxx_project","commit_stats":null,"previous_names":["cjdb/new_cxx_project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjdb%2Fnew_cxx_project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjdb%2Fnew_cxx_project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjdb%2Fnew_cxx_project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjdb%2Fnew_cxx_project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjdb","download_url":"https://codeload.github.com/cjdb/new_cxx_project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245972095,"owners_count":20702706,"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-10-18T00:22:26.369Z","updated_at":"2025-03-28T04:34:57.215Z","avatar_url":"https://github.com/cjdb.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n  Copyright (c) 2024 Christopher Di Bella\n  Licensed under Creative Commons Attribution-ShareAlike 4.0 International\n  See /LICENCE for licence information.\n  SPDX-License-Identifier: CC BY-SA 4.0\n--\u003e\n# new_cxx_project\n\nWelcome to new_cxx_project! This is a project template generator for C++ projects. Its primary\npurpose is to reduce the amount of boilerplate that you need to interact with in order to get started\nwith your project.\n\nYou can read a better version of the docs at https://new-cxx-project.readthedocs.io.\n\n```{toctree}\n:maxdepth: 1\n\nLICENCE\nCODE_OF_CONDUCT\nsource/generated_files/cmake\nsource/generated_files/vcpkg\n```\n\n## Generated files\n\nnew_cxx_project currently generates a project with support for the following tools:\n\n* Git\n* GitHub (optional)\n* [Sphinx](https://https://www.sphinx-doc.org) (a documentation tool)\n* CMake\n* [vcpkg](https://vcpkg.io) (a C++ package manager, optional)\n\n### Git\n\nBy default, the project will start with a single commit, containing all of the generated files.\n\n### GitHub\n\nIf the project's remote either starts with `https://github.com/` or `git@github.com:`, then the\nproject will contain files for opening pull requests, bug reports, feature requests, and a GitHub\nAction for [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration).\n\n### Sphinx\n\nSphinx is a documentation tool. We generate a `docs` directory that is built alongside your project.\nSphinx supports both [Markdown](https://mystmd.org) and [reStructured Text](https://docutils.sourceforge.io/rst.html).\nThe readme, licence, and code of conduct files are all drafted in Markdown, but your other files can\nbe written in reStructured Text.\n\n### CMake\n\nnew_cxx_project largely exists to generate CMake files that you need to write (but probably don't)\nwant to. The CMake library that's generated is intended to simplify your development process, so that\nyou spend less time writing CMake, and more time working on your project.\n\n:::{seealso}\n\u003cproject:source/generated_files/cmake.rst\u003e\n:::\n\n### vcpkg\n\nnew_cxx_project can optionally support for vcpkg. This includes adding it as a submodule, adjusting\nthe CMake components to support vcpkg, and the documentation.\n\n:::{seealso}\n\u003cproject:source/generated_files/vcpkg.rst\u003e\n:::\n\n## Getting started\n\n### Prerequisites\n\nnew_cxx_project has a few dependencies in order to be run. The best way to install these is to run\n`install_prerequisites.py`, found in the top-level directory of this repo. The only prerequisite to\nrun that is Python 3.\n\nYou'll also need either a full LLVM toolchain or a full GNU toolchain, if you plan to use the toolchain\nfiles that ship with the project by default.\n\n### Generating a project\n\n1. This project is fairly straightforward to use. Most projects can probably get away with running the\nfollowing:\n  ```sh\n  $ ${HOME}/.config/new_cxx_project/bin/python new_cxx_project.py /tmp/hello_world --author='Your name'\n  ```\n  This generates a project called `hello_world` in `/tmp/hello_world`.\n2. Create a file called `/tmp/hello_world/source/hello.cpp`:\n  ```cpp\n  #include \u003cprint\u003e\n\n  int main()\n  {\n    std::println(\"Hello, world!\");\n  }\n  ```\n3. Edit `/tmp/hello_world/source/CMakeLists.txt`:\n  ```cmake\n  cxx_executable(\n    TARGET hello\n    SOURCES hello.cpp\n  )\n  ```\n4. Run `cd /tmp/hello_world`.\n5. Run `export PATH=\"${HOME}/.config/new_cxx_project/bin:${PATH}\"`.\n6. Run **one** of the following:\n  ```sh\n  # If you have the LLVM toolchain installed (Clang, libc++, and friends)\n  $ cmake -GNinja -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=\"$PWD/config/cmake/toolchains/x86_64-linux-unknown-llvm.cmake\"\n  ```\n  ```sh\n  # If you have the GNU toolchain installed (GCC and friends)\n  $ cmake -GNinja -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=\"$PWD/config/cmake/toolchains/x86_64-linux-unknown-gnu.cmake\"\n  ```\n7. Now run `ninja -C build`.\n8. Finally, run `build/source/hello`. You should see `Hello, world!` output to screen.\n9. Congrats! That's your first project done :)\n\n## Options\n\n* `--remote=\u003cvalue\u003e` sets the Git remote. If the tool detects a valid GitHub remote, then it will\n  also generate files for tracking issues, pull requests, and GitHub actions.\n* `--package-manager=\u003cvalue\u003e` sets the project's package manager. Valid values are `none` and `vcpkg`.\n  Defaults to `none`.\n* `--package-manager-remote=\u003cvalue\u003e` sets the remote to download the package manager from. Remotes\n  that are on-disk should be prefixed with `file://`. The default remotes are\n    * **vcpkg**: https://github.com/Microsoft/vcpkg.git\n\n## Can you also support \u0026lt;feature\u0026gt;?\n\nContributions to the project are welcome! Supporting other toolchains, CMake features, build systems,\npackage managers, and remotes are certainly things that I'd like to see added. Please open a [feature\nrequest](https://github.com/cjdb/new_cxx_project/issues/new?assignees=\u0026labels=enhancement\u0026projects=\u0026template=feature_request.yml\u0026title=%3CAdd+a+descriptive+title+here%3E)\nto discuss your needs.\n\nIn particular, help with supporting MSVC and delivering updates to previously-generated projects\nwould be appreciated.\n\n## Can I change the licence for the files I generate?\n\nSorry, no. This project has multiple contributors, and to relicencing would require getting permission\nfrom each contributor, for each licence. Also, in order to simplify the process for developers working\non different projects generated by `new_cxx_project.py` with different owners, we intend to keep the\nlicencing story very simple.\n\nThe generated source code and generated documentation have different (but still really permissive) licences.\nSource code is licenced under [Apache Licence, Version 2.0 with LLVM Exceptions](https://llvm.org/LICENSE.txt).\nThe documentation is licenced under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1)\n(CC BY-SA 4.0).\n\n## Can I edit the generated files?\n\nYes! You can and should edit them as you see fit. Any changes that you make are owned by you.\n\n## Indices and tables\n\n* {ref}`genindex`\n* {ref}`search`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjdb%2Fnew_cxx_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjdb%2Fnew_cxx_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjdb%2Fnew_cxx_project/lists"}