init command creates a new ReXGlue project with the required directory structure, build files, and configuration templates.
Usage
Required Flags
Project name (snake_case, PascalCase, or kebab-case)This name is used throughout the generated project files. ReXGlue normalizes it to:
snake_casefor file names and CMake targetsPascalCasefor C++ class namesUPPER_CASEfor CMake variables
Project root directory pathThe directory will be created if it doesn’t exist. Must be empty unless
--force is used.Optional Flags
Project description (optional)
Project author name (optional)
Create as SDK example project (omits vcpkg.json)
Overwrite existing files in non-empty directory
Generated Project Structure
Examples
Basic Project Initialization
Initialize with Metadata
Create SDK Example
Generated Files
CMakeLists.txt
The generatedCMakeLists.txt is SDK-managed and will be overwritten by rexglue migrate. It includes:
- CMake 3.25+ configuration with C++23 standard
- ReXGlue SDK integration (via
REXSDK_DIRorfind_package) - Source file configuration with generated code inclusion
- Platform-specific settings via
rexglue_configure_target() - Custom codegen target:
cmake --build . --target <project>_codegen
src/main.cpp
The generatedsrc/main.cpp is SDK-managed and includes:
- Application class derived from
rex::ReXApp - Generated configuration headers (
<project>_config.h,<project>_init.h) REX_DEFINE_APPmacro registration
main.cpp.
Configuration File
The<project>_config.toml file configures code generation:
CMakePresets.json
Provides build presets for different platforms and configurations:win-amd64-debug/win-amd64-release(Windows with clang)linux-amd64-debug/linux-amd64-release(Linux with clang-20)*-relwithdebinfovariants for optimized debugging
Next Steps
After initializing your project:- Add your XEX file to
assets/default.xex(or update the path in the config) - Configure the build:
- Run code generation:
- Build the project:
Common Errors
Directory Not Empty
--force flag or use an empty directory.
Invalid App Name
--app-name.
Missing Required Flag
--app-root.