Welcome to the MDE4CPP Project
Further information can be found on the project site.
(Find detailed instructions here)
- Java Development Kit (JDK) version 21
- Eclipse Modeling Tools
- Install Eclipse Modeling Tools 2025-06
- Add plugin Acceleo 3.7.15
- Add plugin Sirius 7.4
- Add plugin Papyrus 7.0.0
- MinGW-w64
- MinGW-w64 v13.0.0, select architecture =
x86_64during installation
- MinGW-w64 v13.0.0, select architecture =
- CMake
There are no recommendations for a specific software version. The specified versions were used for testing MDE4CPP.
Clone the MDE4CPP Git repository.
- Copy the prepared environment settings file and remove the
.defaultextension:- Windows:
setenv.bat.default - Unix:
setenv.default
- Windows:
- Open this file and configure the variables:
MDE4CPP_HOME… path to the MDE4CPP home folder- Compiler and Gradle task configuration variables
- Tool path configuration
- Note for Unix users:
You must call the script with. ./setenvso that the variables are applied to your shell.
MDE4CPP uses Gradle for builds. Some basic commands:
gradlew tasks… list available tasksgradlew projects… show package overviewgradlew help… Gradle helpgradlew <taskName>… run task<taskName>
Note for Unix users:
First, give the script execution permissions:
chmod +x application/tools/gradlewbuildAll… generate and compile all metamodels (Ecore, UML, fUML, …)- Use
gradlew tasksto see all top-level commands under MDE4CPP tasks - Generator tasks:
createAllGenerators… create executables of all generatorscreate<GeneratorProjectName>… create executable for the specified generator (e.g.createUML4CPP)
- Examples are located in
src/examples.- Navigate to this directory and explore existing examples and tests using
gradlew tasks. Start a specific task withgradlew <taskName> - Alternatively: Navigate to a specific example model directory and run the generate script.
- Navigate to this directory and explore existing examples and tests using
- Universal generation task:
Generates C++ projects for Ecore or UML models.
generateModel -PModel=<path-to-model-file>
Notes:
- The model file must be located in
<project-folder>/model. - Generated C++ projects are placed in
<project-folder>/src_gen. ecore4CPPis used for.ecoremodels.fUML4CPPis used for.umlmodels.- To use UML4CPP (structural part only, no fUML-specific executions), add
-PStructureOnlyor-PSO. - (experimental) To generate a REST API for the model, enable it in MDE4CPP_Generator.properties.
There are dependencies between tasks, projects, and models which are currently not built automatically:
In general:
- Generators must be compiled before model source code can be generated.
- Metamodels must be built before models can be built.
- Dependent models must be built before depending model can be built.
Schema:
<command><ModelName> <buildMode>
-
Commands:
build… generate and compilegenerate… generate C++ code using the generator (independent of build mode)compile… compile generated files
-
Model name: Starts with a capital letter.
-
Build modes:
- Not specified … build debug and release versions
-PDEBUGor-PD… debug version (compiler flags-g -ggdb)-PRELEASEor-PR… release version (compiler flag-O3, debug disabled)
Build modes can be preconfigured in environment settings:
ORG_GRADLE_PROJECT_DEBUG=1 # Build debug version
ORG_GRADLE_PROJECT_RELEASE=1 # Build release version
To disable a build mode, set the variable to 0, e.g.:
-PDEBUG=0
Examples:
-
No preconfigured build mode in
gradle.properties:buildEcore… generate and compileecore.ecorein debug and releasegenerateEcore… generate C++ code forecore.ecorecompileEcore -PRELEASE… compile in release mode
-
Preconfigured
ORG_GRADLE_PROJECT_DEBUG=1:buildEcore… generate and compile in debugcompileEcore -PRELEASE… compile in debug and releasecompileEcore -PRELEASE -PDEBUG=0… compile in release only
All binaries and header files are delivered to:
${MDE4CPP_HOME}/application
This project is generally licensed under the MIT License.
The following folders are excluded and are subject to the Eclipse Public License v1.0:
src/common/ecoreReflection/modelsrc/common/primitivetypesReflection/modelsrc/common/umlReflection/modelsrc/ecore/modelsrc/uml/types/modelsrc/uml/uml/model