Welcome to MDE4CPP project
Further information can be found on project site
- Install following software:
- Java Development Kit (JDK) version 1.8
- Eclipse Modeling Tool
- add plugin Acceleo 3.7 for Eclipse Oxygen (use Acceleo 3.6 for older Eclipse versions)
- MinGW:
- CMake
-
Checkout the MDE4CPP respository
-
Configure environment
- Copy the prepared environment settings file and remove the extension
default- for Windows systems:
setenv.bat.default - for Unix systems:
setenv.default
- for Windows systems:
- Open this file and configure the variables:
MDE4CPP_HOME... path to MDE4CPP home folder- variables for compiler and Gradle tasks configuration
- tool path configuration
- Note for Unix users; you must call the bash like this:
. ./setenvto allow the script change the variables inside your shell.
- If you want to use Prebuild libraries, packages are downloadable on github. Package with all libraries and header files are available at MDE4CPP repository. All C++ libraries are avaiable in
- debug version (compiler flag -ggdb)
- release version (mostly with compiler flag O3, no debug messages).
Unpack downloaded packages into
${MDE4CPP_HOME}/application.
- If you want to build by yourself, be familar with gradle. Some basics are described below. Basic gradle tasks:
gradlew tasks... list of available tasks is available.gradlew projects... package overview is availablegradlew help... gradle helpgradlew <task name>... run task Note for Unix users; first you have to give execution permission to the script gradlew with:chmod +x application/tools/gradlew
- List of top level tasks (group MDE4CPP):
buildAll... create executables of all generators and build all base models- use
gradlew tasksto find all top level commands underMDE4CPP tasks - generator tasks:
createAllGenerators... create executables of all generatorscreate<Generator project name>... creates executable of corresponding generator, e.g. createUML4CPP
- examples can be found in example or after cloning the repositories in src/examples. Collection of examples can be build with task buildAllExamples (most projects are includes).
generateModel -PModel=<path to model file>... universal task to generate C++ projects for ecore or UML models Note:- The model file should be located in
<project folder>/model - C++ project will be generated in
<project folder>/src_gen - ecore4CPP will be used for .ecore models.
- fUML4CPP will be used for .uml models
- To use UML4CPP (no fUML specific executions, only the structural part),
-PStructureOnlyor-PSOhas to be added to the command.
- The model file should be located in
-
There are various dependencies between tasks as well as projects and models. For instance, a generator has to be compiled before source code of a model can be generated or the meta model has to be compiled before model can be compiled. All dependencies of a task are specified. It is not necessary to start or perform all dependencies manually. Gradle is able to performed this tasks automatically. Thus, it is sufficient to perform a desired task. For instance, to compile the example project
ecoreExample, just callgradlew compileEcoreExampleon command line and all dependencies like delivering basing interfaces, generating and compiling ecore model and creating generator file are performed by gradle. -
Model tasks are names using following schema:
<command><modelName> <buildMode>
- commands:
build... execute commands generate and compilegenerate... generate C++ code using our generator (independent of build mode)compile... compile generated files
modelName... name of the model, starting with capital letterbuildMode- not specified ... build debug and release version
-PDEBUGor-PD... debug version -> compiler flags -g -ggdb is used-PRELEASEor-PR... release version -> mostly with compiler flag O3, debug messages are disabled- The build mode can be preconfigured in environment settings files by configuring
- ORG_GRADLE_PROJECT_DEBUG=1 ... build debug version
- ORG_GRADLE_PROJECT_RELEASE=1 ... build release version
- This build mode is always used when compiling.
- A build mode can be disabled by setting the variable to
0. For instance, the debug version is not built ifORG_GRADLE_PROJECT_RELEASE=0is defined in environment settings files or-PDEBUG=0is defined in a gradle command. - Further information for configuration and execution of compile tasks can be found on MDE4CPPCompile-Plugin.
- examples:
- no preconfigured build mode inside gradle.properies:
buildEcore- generate and compile ecore.ecore in debug and releasegenerateEcore- generate C++ code for ecore.ecorecompileEcore -PRELEASE- compile generated code of ecore.ecore in release version
- environment settings files defines ORG_GRADLE_PROJECT_DEBUG=1
buildEcore- generate and compile ecore.ecore in debuggenerateEcore- generate C++ code for ecore.ecorecompileEcore -PRELEASE- compile generated code of ecore.ecore in release and debug versioncompileEcore -PRELEASE -PDEBUG=0- compile generated code of ecore.ecore in release version (debug is disabled)
- no preconfigured build mode inside gradle.properies:
All binaries and header files are delivered to ${MDE4CPP_HOME}/application using the tasks.
The projects is generally subjected to the MIT license.
Excluded from this license are the following folders, which are subjected to Eclipse Public License - v 1.0:
- src/common/ecoreReflection/model
- src/common/primitivetypesReflection/model
- src/common/umlReflection/model
- src/ecore/ecore/model
- src/ecore/types/model
- src/ecore/fuml/model
- src/ecore/uml/model