{"id":17002051,"url":"https://github.com/sagiegurari/cmake-modules","last_synced_at":"2026-03-18T23:06:09.844Z","repository":{"id":139264091,"uuid":"289300885","full_name":"sagiegurari/cmake-modules","owner":"sagiegurari","description":"Reusable cmake utilities for C projects.","archived":false,"fork":false,"pushed_at":"2023-09-21T15:48:16.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T09:11:27.292Z","etag":null,"topics":["cmake","cmake-modules"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagiegurari.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2020-08-21T15:18:41.000Z","updated_at":"2023-05-16T12:00:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"b223b12b-e14e-4b24-bcb6-bdff8aca4c64","html_url":"https://github.com/sagiegurari/cmake-modules","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fcmake-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fcmake-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fcmake-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fcmake-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagiegurari","download_url":"https://codeload.github.com/sagiegurari/cmake-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931630,"owners_count":20534012,"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":["cmake","cmake-modules"],"created_at":"2024-10-14T04:26:57.275Z","updated_at":"2026-01-04T15:45:10.636Z","avatar_url":"https://github.com/sagiegurari.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmake-modules\n\n[![Release](https://img.shields.io/github/v/release/sagiegurari/cmake-modules)](https://github.com/sagiegurari/cmake-modules/releases)\n[![license](https://img.shields.io/github/license/sagiegurari/cmake-modules)](https://github.com/sagiegurari/cmake-modules/blob/master/LICENSE)\n\n\u003e Reusable cmake utilities for C projects.\n\n* [Overview](#overview)\n* [Usage](#usage)\n* [Contributing](.github/CONTRIBUTING.md)\n* [Release History](CHANGELOG.md)\n* [License](#license)\n\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\n## Overview\nThe cmake-modules contains basic reusable building blocks for cmake C projects.\u003cbr\u003e\nThose include:\n\n* Downloading git repository\n* Downloading github repository\n* Setting variables for sources, headers, etc... for downloaded repositories\n* Add test targets easily\n* Run ccpcheck\n* Run uncrustify\n* Create and increment build file\n* Run xxd on resource files\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n\nInclude the cmake modules in the module path\n\n```cmake\nlist(APPEND CMAKE_MODULE_PATH \"cmake-modules/src\")\n```\n\nLoad the cmake module\n\n```cmake\ninclude(utils)\n```\n\nAnother way is to automatically download it if missing, for example:\n\n```cmake\nif(NOT EXISTS \"target/cmake-modules/src/utils.cmake\")\n  execute_process(COMMAND git clone https://github.com/sagiegurari/cmake-modules.git)\nendif()\ninclude(\"target/cmake-modules/src/utils.cmake\")\n```\n\nUse the different capabilities in your CMakeLists.txt for example:\n\n```cmake\nutils_add_external_github_lib(\n  REPO_USERNAME sagiegurari\n  REPO_NAME c_scriptexec\n  TAG_NAME \"0.1.3\"\n  LIBRARY_NAME scriptexec\n  LIBRARY_PARENT_DIRECTORY target\n)\n\nutils_setup_c_test(\n  NAME\n    stability\n    long_run\n    valid_input\n    invalid_input\n  ADDITIONAL_SOURCES \"test/core.c;test/core.h\"\n  COMPILATION_FLAGS \"-Werror -Wall -Wextra -Wcast-align -Wunused -Wshadow -Wpedantic\"\n  BINARY_DIRECTORY \"target/bin\"\n)\n\nutils_setup_c_all_tests(\n  ADDITIONAL_SOURCES \"test/core.c;test/core.h\"\n  COMPILATION_FLAGS \"-Werror -Wall -Wextra -Wcast-align -Wunused -Wshadow -Wpedantic\"\n  BINARY_DIRECTORY \"target/bin\"\n)\n```\n\n## Contributing\nSee [contributing guide](.github/CONTRIBUTING.md)\n\n\u003ca name=\"history\"\u003e\u003c/a\u003e\n## Release History\n\nSee [Changelog](CHANGELOG.md)\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\nDeveloped by Sagie Gur-Ari and licensed under the Apache 2 open source license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fcmake-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagiegurari%2Fcmake-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fcmake-modules/lists"}