CMakeRC is a resource compiler provided in a single CMake script that can easily be included in another project.
For the purpose of this project, a resource compiler is a tool that will compile arbitrary data into a program. The program can then read this data from without needing to store that data on disk external to the program.
Examples use cases:
- Storing a web page tree for serving over HTTP to clients. Compiling the web page into the executable means that the program is all that is required to run the HTTP server, without keeping the site files on disk separately.
- Storing embedded scripts and/or shaders that support the program, rather than writing them in the code as string literals.
- Storing images and graphics for GUIs.
These things are all about aiding in the ease of portability and distribution of the program, as it is no longer required to ship a plethora of support files with a binary to your users.
CMakeRC is implemented as a single CMake module, CMakeRC.cmake
. No additional
libraries or headers are required.
This project was initially written as a "literate programming" experiment. The process for the pre-2.0 version can be read about here.
2.0.0+ is slightly different from what was written in the post, but a lot of it still applies.
Installing CMakeRC is designed to be as simple as possible. The only thing
required is the CMakeRC.cmake
script. You can copy it into your project
directory (recommended) or install it as a package and get all the features you
need.
For vcpkg users there is a cmakerc
port that can be installed via vcpkg install cmakerc
or by adding it to dependencies
section of your vcpkg.json
file.
-
<