MakefileGeneration
From SOFAWiki
Contents |
qmake
SOFA relies on qmake to automate the generation of makefiles for the different supported platforms. Qmake is available under Linux OS with the qt package. For MacOS and Windows OS it is provided as a prebuilt binary along with qt in the dependency package.
Public branch configuration
Recommended settings for the public branch
- Edit your sofa-local.cfg
- Uncomment DEFINES *= SOFA_GUI_QGLVIEWER
- Uncomment DEFINES *= SOFA_CLASSIC_SCENE_GRAPH
- Regenerate the makefiles
- Rebuild SOFA, or if you use a unix shell use the c++touch script described in the tools section.
Editing the compilation options (public branch)
The default compilation options are desribed in the sofa-default.cfg file.
To edit the compilation options it is best to follow these steps.
- copy the sofa-default.cfg file to sofa-local.cfg
- edit the sofa-local.cfg to enable/disable some compilation options.
It is recommended to :
- Uncomment DEFINES *= SOFA_GUI_QGLVIEWER
- Uncomment DEFINES *= SOFA_CLASSIC_SCENE_GRAPH
Dev branch configuration
Configure the compilation flags
The default compilation options are desribed in the sofa-default.prf file.
To edit the compilation options it is best to follow these steps.
- copy the sofa-default.prf file to sofa-local.prf
- edit the sofa-local.prf to enable/disable some compilation options.
Activate a new plugin
To create a new plugin for SOFA, follow the steps described in this page.
In order to activate the compilation of your new plugin in the global Makefile :
- create a sofa-dependencies-local.prf file at the root of the SOFA source directory.
- edit this sofa-dependencies-local.prf and add the following
usePlugin(MyPlugin)
MyPlugin is the same parameter used in the defineAsPlugin method.
qmake shadow build (aka out of source build)
Not thoroughly tested qmake advanced usage
- set the QMAKEFEATURES environment variable value to $SOFA_SRC_DIR/features where $SOFA_SRC_DIR is the directory containing the code sources of SOFA
- create a target directory, which will contain the compiled binaries. It will be referred as $SOFA_TARGET_DIR.
- create and edit $SOFA_TARGET_DIR/sofa-local.prf for custom compilation options ( debug binaries, cuda ...)
- create and edit $SOFA_TARGET_DIR/sofa-dependencies-local.prf for custom plugin activation.
- in the $SOFA_TARGET_DIR run
qmake -recursive $SOFA_SRC_DIR/Sofa.pro
to generate the Makefiles with the appropriate configuration.
Generating the Makefiles
Linux
The Makefile generation is launched with the command
./Project\ Linux.sh
MacOS
The Makefile generation is launched with the command
./Project\ MacOS.sh
Windows
The project file generation is launched with the command
- Visual Studio 2005
Project VC8.bat
- Visual Studio 2008
Project VC9.bat
