migrate command updates SDK-managed files in an existing ReXGlue project to match the current SDK templates. This ensures projects stay compatible with SDK updates.
Usage
Required Flags
Path to existing ReXGlue project root directoryMust contain a valid ReXGlue project with
src/main.cpp and a *_config.toml file.Optional Flags
Skip confirmation prompt and overwrite files immediatelyBy default, migrate shows which files will be changed and asks for confirmation.
SDK-Managed Files
The following files are overwritten during migration:CMakeLists.txt- Build configuration and SDK integrationsrc/main.cpp- Application entry point and ReXApp setup
User-Managed Files
The following files are never modified by migrate:*_config.toml- Your codegen configurationCMakePresets.json- Build presets- Custom source files in
src/ - Generated code in
generated/ - Any other files you’ve added
Examples
Basic Migration
Force Migration Without Prompt
No Changes Needed
Migration Workflow
- Detects project name from
*_config.tomlin the project root - Checks existing files against current SDK templates
- Lists modified files and prompts for confirmation (unless
--force) - Overwrites SDK-managed files with current templates
- Preserves customizations in non-managed files
After Migration
After successful migration, you must reconfigure your CMake build:CMakeLists.txt.
When to Migrate
Runrexglue migrate when:
- Updating the SDK to a new version
- Build errors occur after SDK updates
- New SDK features require template changes (e.g., new CMake functions)
- Prompted by SDK documentation for breaking changes
Preserving Customizations
Do NOT Customize SDK-Managed Files
Files marked as “SDK-managed” in their header comments will be overwritten:Where to Add Custom Code
CMakeLists.txt (this line won’t be removed by migrate if you add it once):
Common Errors
Project Directory Not Found
Not a ReXGlue Project
rexglue init.
No Configuration File
my_game_config.toml) in the root directory.
Missing app_root Flag
--app-root.
Migration Checklist
Before migrating:- Commit your changes to version control
- Review SDK changelog for breaking changes
- Backup custom modifications if you edited SDK-managed files
- Reconfigure CMake with your preset
- Rebuild the project to verify everything compiles
- Test your application to ensure functionality is preserved
- Commit migration changes to version control
Version Compatibility
Migration always updates to the current SDK version bundled with therexglue binary. There is no way to migrate to a specific older version.
If you need to maintain multiple SDK versions:
- Use separate
rexgluebinary installations - Pin your SDK version in your build system
- Document the required SDK version in your project README