{"id":15017920,"url":"https://github.com/garcia6l20/cpppm","last_synced_at":"2025-04-12T12:34:04.513Z","repository":{"id":62565145,"uuid":"240409783","full_name":"Garcia6l20/cpppm","owner":"Garcia6l20","description":"C++ Project manager","archived":false,"fork":false,"pushed_at":"2020-12-20T17:04:49.000Z","size":236,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T07:11:27.830Z","etag":null,"topics":["build-management","build-tool","cmake","conan","cpp","package-manager","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Garcia6l20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-14T02:12:24.000Z","updated_at":"2021-01-22T22:01:15.000Z","dependencies_parsed_at":"2022-11-03T16:15:23.703Z","dependency_job_id":null,"html_url":"https://github.com/Garcia6l20/cpppm","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Garcia6l20%2Fcpppm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Garcia6l20%2Fcpppm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Garcia6l20%2Fcpppm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Garcia6l20%2Fcpppm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Garcia6l20","download_url":"https://codeload.github.com/Garcia6l20/cpppm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248566865,"owners_count":21125738,"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":["build-management","build-tool","cmake","conan","cpp","package-manager","python"],"created_at":"2024-09-24T19:51:10.559Z","updated_at":"2025-04-12T12:34:04.494Z","avatar_url":"https://github.com/Garcia6l20.png","language":"Python","readme":"# cpppm\n\u003e CPP Project Manager\n\n![master](https://github.com/Garcia6l20/cpppm/workflows/build-examples/badge.svg?branch=master) (master)  \n![devel](https://github.com/Garcia6l20/cpppm/workflows/build-examples/badge.svg?branch=devel) (devel)\n\n`cpppm` is a C/C++ build-system/package manager (through `conan`) that focus on flexibility.\n\nWhile (most of) other build systems are jailing you into a re-invented scripting\nlanguage, `cpppm` is nothing else but a python module that provides you some\nfacilities to build your software.\nThus, you can do everything you are able to do with python.\n\nThe `cpppm` API semantics is close to `CMake` (eg.: *link_libraries*, *compile_options*, etc...).\n\n### A basic example\n\nConsider following code:\n- *main.cpp*:\n```cpp\n#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n#include \u003cdoctest/doctest.h\u003e\n#include \u003cfmt/format.h\u003e\n\nTEST_CASE(\"cpppm loves conan\") {\n    CHECK(fmt::format(\"{1} loves {0} !!!\", \"conan\", \"cpppm\") == \"cpppm loves conan !!!\");\n}\n```\n- *project.py*:\n```python\n#!/usr/bin/env python3\nfrom cpppm import Project, main\n\nproject = Project('conan_requires')\nproject.requires = 'fmt/6.1.2', 'doctest/2.3.6'\nexe = project.main_executable()\nexe.sources = 'src/main.cpp'\nexe.link_libraries = 'fmt', 'doctest'\n\nif __name__ == '__main__':\n    main()\n```\nAt this point you'll be able to run:\n```bash\n$ ./project.py run conan_requires\n\n# Build output ommitted...\n\n[doctest] doctest version is \"2.3.6\"\n[doctest] run with \"--help\" for options\n===============================================================================\n[doctest] test cases:      1 |      1 passed |      0 failed |      0 skipped\n[doctest] assertions:      1 |      1 passed |      0 failed |\n[doctest] Status: SUCCESS!\n```\n\nCheck out the examples folder for more use cases.\n\n### Installation\n\n- By cloning this repository:\n```bash\ngit clone https://github.com/Garcia6l20/cpppm.git\ncd cpppm\npython setup.py install --user\n```\n- Available on [PyPi](https://pypi.org/project/cpppm/):\n```bash\npip install --user cpppm\n```\n\n### Commands\n\nDefault commands can be listed with a regular help request:\n```bash\n$ ./project.py -h\nUsage: project.py [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -v, --verbose             Let me talk about me.\n  -o, --out-directory TEXT  Build directory, generated files should go there.\n  -d, --debug               Print extra debug information.\n  -c, --clean               Remove all stuff before processing the following\n                            command.\n\n  -C, --config TEXT         Config name to use.\n  -h, --help                Show this message and exit.\n\nCommands:\n  build        Builds the project.\n  config       Project configuration command group.\n  install      Installs targets to destination.\n  interactive  Interactive python console with loaded project.\n  run          Runs the given TARGET with given ARGS.\n  shell        Interactive shell (cli commands in shell mode).\n  sync         Synchronize conan package recipe (conanfile.py).\n  test         Runs the unit tests.\n  toolchain    Toolchain command group.\n```\n\n### Conan biding\n\n`cpppm` is tidally coupled to `conan` and can be used as is to create\npackages.\n\nWhen you add requirements to your project a `conanfile.py` appears side by side\nwith you `project.py`.\nIt is used to install your dependencies or to allow conan to interact with your project.\n\nThe generated `conanfile.py` might not be edited or it should be automatically re-generated.\n\nSo, regular `conan` process applies directly to your project.\n\n```bash\ncd examples\nconan create .\nconan upload cpppm-examples -r my_repo\n```\n\nUser of your generated package should be able to use it with all build-systems\nhandled by conan and obviously with `cpppm` (see [test_package](./test_package)).\n\n### Shell\n\nAn interactive shell mode is provided with `click-shell`.\nTo enable interactive shell, install `cpppm` interactive mode:\n```bash\n$ python -m pip install cpppm[interactive]\n```\n\nThen enter interactive shell:\n```bash\n$ ./project.py shell\nEntering cpppm-examples shell...\ncpppm-examples $ help\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nbuild   install               interactive  shell  test     \nconfig  install-requirements  run          sync   toolchain\n\nUndocumented commands:\n======================\nexit  help  quit\n\ncpppm-examples $ build\n[... some output omitted ...]\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):building Executable[events]\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):compiling main.o (Executable[events])\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):linking events\ncpppm-examples $ run hello-cpppm\nSource directory: /home/sylvain/projects/cpppm/examples\nBuild directory: /home/sylvain/projects/cpppm/examples/build/gcc-11-x86_64-Release\nProject: cpppm-examples\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):using ccache\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):building Executable[hello-cpppm]\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):object /home/sylvain/projects/cpppm/examples/build/gcc-11-x86_64-Release/hello_cpppm/main.o is up-to-date\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):using ccache\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):building Executable[hello-cpppm]\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):object /home/sylvain/projects/cpppm/examples/build/gcc-11-x86_64-Release/hello_cpppm/main.o is up-to-date\nHello cpppm\ncpppm-examples $ quit\n```\n\n### Interactive console\n\nAn interactive console mode is provided with `IPython`, but not installed automatically.\nTo enable interactive console, install `cpppm` interactive mode:\n```bash\n$ python -m pip install cpppm[interactive]\n```\n\nThen enter interactive console:\n```bash\n$ ./project.py interactive\nPython 3.8.5 (default, Jul 28 2020, 12:59:40) \nType 'copyright', 'credits' or 'license' for more information\nIPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.\n\nIn [1]: await project.get_target('hello-cpppm').run('world')\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):using ccache\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):building Executable[hello-cpppm]\nINFO:cpppm.UnixCompiler(gcc-11-x86_64):object /home/sylvain/projects/cpppm/examples/build/gcc-11-x86_64-Release/hello_cpppm/main.o is up-to-date\nHello world\nOut[1]: (0, None, b'')\n\nIn [2]:\n```\n\n### Features\n\n- [ ] ~~CMakeLists.txt generation~~ (no more using CMake)\n- [x] Project compilation\n- [x] ~~Build events~~ (useless), generators (will probably be moved into generic Targets)\n- [x] Conan package dependencies management\n- [x] Executables invocation (automatically added to cli interface) \n- [x] Customizable (you can do anything you can do with python)\n- [x] Cli customization (cou can add any `@cpppm.cli.command` that you want to add, see [click](https://click.palletsprojects.com/))\n- [x] Unit testing (basic support)\n- [x] Conan package generation\n\n## Contributing\n\nWould be appreciated, no contribution guide, just [PEP-8 codding style](https://www.python.org/dev/peps/pep-0008/) and smart codding, fork/PR.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarcia6l20%2Fcpppm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarcia6l20%2Fcpppm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarcia6l20%2Fcpppm/lists"}