{"id":16774732,"url":"https://github.com/iohannrabeson/rescom","last_synced_at":"2025-04-10T20:07:32.901Z","repository":{"id":47643800,"uuid":"367474487","full_name":"IohannRabeson/rescom","owner":"IohannRabeson","description":"C++ resource compiler to embed files into executables","archived":false,"fork":false,"pushed_at":"2023-03-07T04:33:42.000Z","size":131,"stargazers_count":7,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T17:52:41.657Z","etag":null,"topics":["c-plus-plus","c-plus-plus-17","cmake","cpp","cpp17","embedded-files","linux","osx","resource-compiler","resources","tool","tooling","tools","windows"],"latest_commit_sha":null,"homepage":"","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/IohannRabeson.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":"2021-05-14T20:38:21.000Z","updated_at":"2024-01-26T00:08:58.000Z","dependencies_parsed_at":"2025-02-18T00:30:51.807Z","dependency_job_id":"05657d94-a9f5-40ed-aa7c-16c0f1c12304","html_url":"https://github.com/IohannRabeson/rescom","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/IohannRabeson%2Frescom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IohannRabeson%2Frescom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IohannRabeson%2Frescom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IohannRabeson%2Frescom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IohannRabeson","download_url":"https://codeload.github.com/IohannRabeson/rescom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288346,"owners_count":21078903,"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":["c-plus-plus","c-plus-plus-17","cmake","cpp","cpp17","embedded-files","linux","osx","resource-compiler","resources","tool","tooling","tools","windows"],"created_at":"2024-10-13T06:49:56.658Z","updated_at":"2025-04-10T20:07:32.894Z","avatar_url":"https://github.com/IohannRabeson.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rescom \n[![CMake](https://github.com/IohannRabeson/rescom/actions/workflows/linux.yml/badge.svg)](https://github.com/IohannRabeson/rescom/actions/workflows/linux.yml)\n[![CMake](https://github.com/IohannRabeson/rescom/actions/workflows/macos.yml/badge.svg)](https://github.com/IohannRabeson/rescom/actions/workflows/macos.yml)\n[![CMake](https://github.com/IohannRabeson/rescom/actions/workflows/windows.yml/badge.svg)](https://github.com/IohannRabeson/rescom/actions/workflows/windows.yml)\n\nC++ resource compiler using CMake to embed files into executables\n\n - Tested on Windows, Linux and OSX\n - Generated code does not produce warnings\n - Easy to use and to integrate with CMake\n\n## Requirements\n - C++ compiler with C++17 support\n - CMake 3.9 or later\n - A project generator such as GNU Make, Ninja\n\n## Tutorial\n\n 1 - Add this repository as submodule and use `add_subdirectory` in your CMakeLists.txt:\n ```cmake\n    add_subdirectory(rescom)\n```\n 2 - Create a folder for the resources in your project, add it few files and list them in a text file (called the rescom file).  \nThe file `rescom.list` contains the files to embed, one file per line, path must be relative to\nthe directory of the rescom file:  \n ```shell\nmkdir resources \u0026\u0026 echo \"content.txt\" \u003e resources/rescom.list \u0026\u0026 cat \"Hello world!\" \u003e content.txt\n```\n 3 - In the CMakeLists.txt of your project, enable rescom:\n ```cmake\n    add_executable(your_project main.cpp)\n    # This line enable rescom, all the files listed in rescom.list will\n    # be embedded into the executable.\n    rescom_compile(your_project resources/rescom.list)\n```\n 4 - You can now load the text file:\n ```c++\n// `rescom.hpp` is generated by rescom driven by CMake.\n#include \u003crescom.hpp\u003e  \n\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n\nint main() {\n    std::cout \u003c\u003c rescom::getText(\"content.txt\") \u003c\u003c \"\\n\";\n    return 0;\n}\n ```\n\nThe structure `rescom::Resource` contains the following fields: \n```c++\n// The unique key, it's the path of the file relative to the resources file list\nchar const* const key;\n// Data of the resource. This address will never change during runtime.\nchar const* const bytes;\n// Count of bytes\nunsigned int const size;\n```\n\nYou can see complete examples in the `tests` directory.\n\n## How to build tests\nYou must set the CMake variable `RESCOM_TEST` to `ON`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiohannrabeson%2Frescom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiohannrabeson%2Frescom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiohannrabeson%2Frescom/lists"}