UNTRANSLATED

Différences

Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.

Lien vers cette vue

en:code:buildsystem [2012/06/16 00:34]
Christian A. Reiter [Creating translations] enhancement lrelease/qm files
en:code:buildsystem [2013/05/04 00:20] (Version actuelle)
Eric Maeker, MD [Building the additional plugins]
Ligne 6: Ligne 6:
 <note doc>**This documentation describes how to build FreeMedForms applications.**</note> <note doc>**This documentation describes how to build FreeMedForms applications.**</note>
  
-The FreeMedForms project is C++/[[http://qt.nokia.com/products|Qt]] code. In order to build applications, you will need to install and configure the Qt libs (please refer to the Qt docs).+The FreeMedForms project is written in C++/[[http://qt.nokia.com/products|Qt]]. In order to build one of the applications, you will need to install and configure the Qt libraries (please refer to the Qt documentation).
  
-FreeMedForms project applications consist on a very small executable, libs and plugins. When application starts, the executable is loaded, some libs too. If the application starts correctly the plugin manager loads all needed plugins and execute them.+FreeMedForms project applications consist of a very small executable, libs and plugins. When the application starts, the executable is loaded, some libs too The plugin manager then loads all needed plugins and executes them.
  
  
-===== Build dependencies =====+===== Getting the source =====
  
 +We use [[http://git-scm.com/|Git]] as versioning control system, and [[http://code.google.com/|Google Code]] for code hosting.
 +You can go [[http://code.google.com/p/freemedforms/source/checkout|here]] and follow the instructions there to fetch a copy of the FreeMedForms source code.
 +
 +===== Build dependencies =====
 ==== All systems ===== ==== All systems =====
  
-  * FreeMedForms before SVN revision number 3219 needs at least **Qt 4.6.2** or higher. +  * Be sure to install the correct version of Qt, otherwise you will not be able to compile FreeMedForms
-  FreeMedForms since SVN revision number 3219 needs **Qt 4.7.0** or higher+    * FreeMedForms since git revision [[http://code.google.com/p/freemedforms/source/detail?r=eb5da592065d44d5ee25b0b649fa1cfb15178521 |eb5da592065d]] needs **Qt 4.8.0** or higher. 
-  * Be sure to install the correct version of Qt otherwise uou will not be able to compile FreeMedForms.+    before that revision at least **Qt 4.6.2** is needed
  
 ==== Linux needed packages for compilation ==== ==== Linux needed packages for compilation ====
  
-  * For Linux users, you needbefore trying anything with the sources, to install these packages:+  * For Linux users, you need to install the following packages before trying anything with the sources:
     * build-essential     * build-essential
-    * all qt4 libs and binaries+    * all qt4 libs and binaries (libqt4-dev)
     * libxext-dev and libxext6     * libxext-dev and libxext6
 +  * We recommend to use the QtCreator IDE
 <code> <code>
 #in debian/ubuntu #in debian/ubuntu
Ligne 37: Ligne 43:
 ==== Windows needed applications for compilation ==== ==== Windows needed applications for compilation ====
  
-  * Download and install Qt libs+  * Download and install Qt SDK 
 +  * For the Webcam plugin:  
 +    * Download [[http://opencv.org/|OpenCV lib]] 
 +    * Install OpenCV libs in the //contrib// sub-dir
   * We recommend to use the QtCreator IDE   * We recommend to use the QtCreator IDE
 +
 +==== The Quazip case ====
 +
 +  * By default all the FreeMedForms apps are built with the quazip 0.4.4 library. This lib is included in the source package.
 +  * Some linux distros do provide specific package of precompiled libquazip.
 +  * You can get rid of the bundled QuaZip source by adding <code>CONFIG+=dontbuildquazip</code> to the qmake command line. 
 +  * Using the **dontbuildquazip** config tag will force the compiler to link FreeMedForms code to the system QuaZip library.
 +
 +==== Building the additional plugins ====
 +
 +  * To build the optional plugins you can use two methods:
 +  * 1) add to the qmake commande line:
 +      *  CONFIG+=with-plugin
 +      * where 'plugin' is the config name of the plugin
 +  * 2) Use buildspecs/optionalplugins.pri file
 +      * Uncomment required plugins
 +
 +=== Using the buildspecs/optionalplugins.pri ===
 +
 +  * Uncomment need lines
 +
 +=== Using the command line ===
 +
 +  * See the following instructions
 +
 +=== Accountancy plugin ===
 +
 +  * v0.8.4 or upper
 +  * Manages accountancy
 +  * By default, the Account plugin is not built. If you want to build it, you need to add
 +    * **with-account** tag to the config qmake command to build the new account plugin.<code>qmake ... "CONFIG+=with-account" ...</code>
 +    * **with-old-account** tag to the config qmake command to build the //old// account plugin.<code>qmake ... "CONFIG+=with-old-account" ...</code>
 +  * It is not useful to build both plugins.
 +
 +=== Agenda plugin ===
 +
 +  * Since v0.8.4, the agenda plugin is now an optional plugin
 +  * Manages multi-user agenda
 +  * By default, the Agenda plugin is not built. If you want to build it, you need to add 
 +    * **with-agenda** tag to the config qmake command.<code>qmake ... "CONFIG+=with-agenda" ...</code>
 +
 +=== Alert plugin ===
 +
 +  * v0.7.6 or upper
 +  * Manages alerts for user, patient and application
 +  * By default, the Alert plugin is not built. If you want to build it, you need to add 
 +    * **with-alerts** tag to the config qmake command.<code>qmake ... "CONFIG+=with-alerts" ...</code>
 +
 +=== Feedback plugin ===
 +
 +  * v0.8.4 or upper
 +  * Manages user feedback to the dev team
 +  * By default, the Feedback plugin is not built. If you want to build it, you need 
 +    * to add **with-feedback** tag to the config qmake command.<code>qmake ... "CONFIG+=with-feedback" ...</code>
 +
 +=== PMHx plugin ===
 +
 +  * v0.8.4 or upper
 +  * Manages patient personal & family PMHx
 +  * By default, the PMHx plugin is not built. If you want to build it, you need 
 +    * to add **with-pmh** tag to the config qmake command.<code>qmake ... "CONFIG+=with-pmh" ...</code>
 +
 +=== WebCam plugin ===
 +
 +  * v0.8.0 or upper
 +  * Manages webcam access (patient identity photo for eg)
 +  * By default, the WebCam plugin is not built. If you want to build it, you need 
 +    * to install the ** [[http://opencv.org/|libopencv-dev]] ** on your computer
 +    * to add **with-webcam** tag to the config qmake command.<code>qmake ... "CONFIG+=with-webcam" ...</code>
 +
 +==== Building optional features ====
 +
  
 ==== Building the Qt MySQL plugin ==== ==== Building the Qt MySQL plugin ====
  
 +  * **For MacOs**: there is a specific MacOs script in the //scripts// dir. You need to install MySQL bin and includes.
 +  * **For Windows**: read this [[http://qtfr.org/viewtopic.php?id=8237|useful post]]
 +  * **For Linux**: No compilation is required, just install the plugins with //sudo apt-get install libqt4-sql-mysql//.
  
 ===== Known issues ===== ===== Known issues =====
  
-It seems like with Fedora Linux you need to set the Qt4 path, before trying to build the sources. This issue needs further developments and seems linked to Fedora itself.+  * It seems like with Fedora Linux you need to set the Qt4 path, before trying to build the sources. This issue needs further developments and seems linked to Fedora itself.
 <code> <code>
 export PATH=$PATH:/usr/lib64/qt4/bin/ export PATH=$PATH:/usr/lib64/qt4/bin/
Ligne 53: Ligne 137:
  
   * You can build applications in two modes:   * You can build applications in two modes:
-    * **debug** to test, participate to the code, without the need of installing the applications+    * **debug** to test, two type of compilation are available here: 
 +      * "non-install": allow you to debug the application without the need of installing it 
 +      * "install-exclusive": allow you to debug the application after its installation 
 +      * the CONFIG flag **debug_without_install** can be used in the qmake command line to switch to the non-install debugging mode
     * **release** to use the applications. In this case, you must install it.     * **release** to use the applications. In this case, you must install it.
  
-==== Using the automated script for a Linux debug build ====+==== Using the automated script for unices builds ====
  
   * A generic script is provided to ease the building process under Linux.   * A generic script is provided to ease the building process under Linux.
-  * It builds FreeMedForms applications in **debug mode only**.+  * Please read the help page of the script.
   * Command:<code bash># get help   * Command:<code bash># get help
 ./build.sh -h ./build.sh -h
-# compile FreeMedForms EMR with translations+# compile the debug without install FreeMedForms EMR && translations
 ./build.sh -t -b freemedforms ./build.sh -t -b freemedforms
 +# idem + webcam plugin
 +./build.sh -tw -b freemedforms
 +
 +# On Linux, you can use the GUI (you need to have zenity installed on your system)
 +./build.sh
 </code> </code>
- 
  
 ==== Creating translations ==== ==== Creating translations ====
  
-Translations are provided as sources. You must compile them with the //lrelease// Qt appThis step must be done before the //make install// processThe script //updatetranslations.sh// in the root directory automates this process for youCalling this script extracts all translatable strings from the *.cpp source files and creates/updates corresponding *.ts files in the //global_resources/translations// directory, one for each language (FR,DE,ES). You can then use the Qt tool //QtLinguist// to open them and provide a translation for each stringAfter that you have to call the //lrelease_all.sh// script (or directly call //lrelease *.ts// in the translations dir) to get the .qm files produced that can be bundled with the app.+  * Translations are provided as sources. We provide some scripts to help you in that process. 
 +  * Translations must be compiled before starting the //make install// step. 
 +  * If you want to: 
 +    * **update the translations source file** use our **./updatetranslations.sh** without any commandline paramsThis step parses all the source files and extracts all translatable strings into *.ts files in //global_resources/translations// 
 +    * **translate** use the **Qt Linguist** to *.ts files, and start translating. 
 +    * **compile translations** use the Qt tool **lrelease**.<code>cd global_resources/translations 
 +lrelease *.ts</code> or use our **lrelease_all.sh** script.
 ==== The qmake && make processes ==== ==== The qmake && make processes ====
  
   * //qmake// is a small application from Qt which will translate the Qt project files into //Makefile// for your preferred compiler. This step requires some attention according to the selected build mode. These requirements are detailed below.   * //qmake// is a small application from Qt which will translate the Qt project files into //Makefile// for your preferred compiler. This step requires some attention according to the selected build mode. These requirements are detailed below.
   * You can specify your own spec file to qmake.   * You can specify your own spec file to qmake.
-  * The **LOWERED_APPNAME** define is required for the debug and release compilation. It is used to create the //bin// directory and for the management of the rpath settings in unices os. 
- 
   * **You can use make in multiple thread** (make -j X).   * **You can use make in multiple thread** (make -j X).
-  * <code>make -j 4</code>+  * <code>make -j4</code>
  
  
 ==== Debug build ==== ==== Debug build ====
  
-The debug mode is suitable for **testing purpose**.  It includes all functionnalities, even those which are not stable or very buggy. All logged messages and errors are transmitted to the console.  **When you build in the debug mode, the application can __NOT__ be moved or installed**.+  * The debug mode is suitable for **testing purpose**.  It includes all functionnalities, even those which are not stable or very buggy. All logged messages and errors are printed to the console.  
 +  * There are two debug mode: a "non-install" and an "install" debug mode. See upper. 
 +  In the debug mode, all processed binaries are postfixed with "_d" on Win32 platforms or "_debug" on unices platforms. You can inhibit this behavior with the CONFIG flag **dont_postfixe_binaries** on the qmake command line.
  
-  *Here are some paths descriptions : +  * Here are some paths descriptions : 
-    * binaries are located in svn/trunk/bin///LOWERED_APPNAME// (eg: for FreeMedForms --> svn/trunk/bin/freemedforms/) +    * binaries are located in /bin///LOWERED_APPNAME// (eg: for FreeMedForms --> /bin/freemedforms/) 
-    * plugins and libs are located in svn/trunk/bin///LOWERED_APPNAME///plugins (eg: for FreeMedForms --> svn/trunk/bin/freemedforms/plugins) +    * plugins and libs are located in /bin///LOWERED_APPNAME///plugins (eg: for FreeMedForms --> /bin/freemedforms/plugins) 
-    * applications resources are located in svn/trunk/global_resources+    * applications resources (pixmaps, sql files etc.) are located in /global_resources
     * users resources are located in your home path (you can modify this behavior using the command line of each FreeMedForms and derivatives : --config="../../path/to/your/config.ini").     * users resources are located in your home path (you can modify this behavior using the command line of each FreeMedForms and derivatives : --config="../../path/to/your/config.ini").
  
 <code> <code>
-cd svn-freemedforms +cd freemedforms 
-qmake-qt4 freemedforms.pro -r -config debug LOWERED_APPNAME=freemedforms+qmake-qt4 freemedforms.pro -r "CONFIG+=debug debug_without_install"
 make make
 cd bin/freemedforms cd bin/freemedforms
  
 # for Linux # for Linux
-freemedforms_debug --config=../../global_resources/config.ini+./freemedforms_debug --config=../../global_resources/config.ini
  
 # for Mac # for Mac
Ligne 108: Ligne 205:
 ==== Building in release mode ==== ==== Building in release mode ====
  
-When you build in release mode, all instable functions are inhibited and there is no logging to the console. **You __MUST__ install the application (using the //make install// command)**, otherwise application will not work.  To facilitate the installation process several parameters can be passed through the command line.+  * When you build in release mode, all instable functions are inhibited and there is no logging to the console.  
 +  * **You __MUST__ install the application (using the //make install// command)**, otherwise application will not work.   
 +  * To facilitate the installation process several parameters can be passed through the command line.
  
 === Linux OS integration === === Linux OS integration ===
Ligne 114: Ligne 213:
   * The "CONFIG+=LINUX_INTEGRATED" can be set for a better integration into the operating system. When set, the built application will then use the Qt libraries installed in your OS. The libs are installed in // /usr/lib/BuiltApplication// and can not be moved. The binary is installed in /usr/bin. The application resources are installed in // /usr/share/BuiltApplication//. Of course, this is only available for Linux.   * The "CONFIG+=LINUX_INTEGRATED" can be set for a better integration into the operating system. When set, the built application will then use the Qt libraries installed in your OS. The libs are installed in // /usr/lib/BuiltApplication// and can not be moved. The binary is installed in /usr/bin. The application resources are installed in // /usr/share/BuiltApplication//. Of course, this is only available for Linux.
  
-  * The "INSTALL_ROOT_PATH=/home/me/test/" used to tell the installation process where to install the application, libs and resources. If you do not specify a path the application is installed in //svn/trunk/packages/YourOs/AppName//. You can combine Linux integration and root path when building a debian package or a rpm package. Actually only valid for Linux.+  * The "INSTALL_ROOT_PATH=/home/me/test/" used to tell the installation process where to install the application, libs and resources. If you do not specify a path the application is installed in //packages/YourOs/AppName//. You can combine Linux integration and root path when building a debian package or a rpm package. Actually only valid for Linux.
  
   * The "LIBRARY_BASENAME=lib64" is used to tell the installation process where to install plugins and libs. This is only valid in the LINUX_INTEGRATED configuration. The lib path will be: // /usr/LIBRARY_BASENAME/FreeMedForms // .   * The "LIBRARY_BASENAME=lib64" is used to tell the installation process where to install plugins and libs. This is only valid in the LINUX_INTEGRATED configuration. The lib path will be: // /usr/LIBRARY_BASENAME/FreeMedForms // .
Ligne 121: Ligne 220:
 # FreeMedForms Sample # FreeMedForms Sample
 # 1. Building a Linux package into a fake root system # 1. Building a Linux package into a fake root system
-cd svn-freemedforms +cd freemedforms 
-qmake freemedforms.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=%build__path/usr/" "LOWERED_APPNAME=freemedforms"+qmake freemedforms.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=%build__path/usr/"
 make make
 make install make install
  
 # 2. Fresh compilation and install without aiming to create a package # 2. Fresh compilation and install without aiming to create a package
-cd svn-freemedforms +cd freemedforms 
-qmake freemedforms.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=/usr/" "LOWERED_APPNAME=freemedforms"+qmake freemedforms.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=/usr/"
 make make
 make install make install
Ligne 135: Ligne 234:
 # FreeDiams Sample # FreeDiams Sample
 # 1. Building a Linux package into a fake root system # 1. Building a Linux package into a fake root system
-cd svn-freediams +cd freediams 
-qmake freediams.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=%build__path/usr/" "LOWERED_APPNAME=freediams"+qmake freediams.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=%build__path/usr/"
 make make
 make install make install
  
 # 2. Fresh compilation and install without aiming to create a package # 2. Fresh compilation and install without aiming to create a package
-cd svn-freediams +cd freediams 
-qmake freediams.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=/usr/" "LOWERED_APPNAME=freediams"+qmake freediams.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=/usr/"
 make make
 make install make install
Ligne 150: Ligne 249:
 === Mac OS integration === === Mac OS integration ===
  
-For MacOs, you need to: +  * For MacOs, you need to: 
-  * compile the application +    * compile the application 
-  * link to Qt franmework +    * link to Qt franmework 
-  * create a DMG package +    * create a DMG package 
- +  * A script is available for the whole process **scripts/mac/mac_release.sh**. It needs only one arg **-b AppToBuild**.
-A script was written to facilitate the process **svn/trunk/scripts/mac_release.sh**. It needs only one arg **-b AppToBuild**. +
 <code> <code>
-cd svn/trunk/scripts/+cd scripts
  
 # Building FreeDiams in release mode and create the DMG package in one step: # Building FreeDiams in release mode and create the DMG package in one step:
Ligne 177: Ligne 274:
  
 </code> </code>
 +
 ===== Building sources packages ===== ===== Building sources packages =====
  
-A specific script is available for the source package creation: **svn/trunk/scripts/source.sh**.+  * A specific script is available for the source package creation: **scripts/source.sh**.
  
 ==== Source building requirements ==== ==== Source building requirements ====
Ligne 191: Ligne 289:
 ==== Creating the source package ==== ==== Creating the source package ====
  
-The source packager script needs only one argument on the command linethe lowered appname.+  * The source packager script will prepare a complete source archive: 
 +    * Version numbers are defined in pluginspec, libs version, win32 scripts and others 
 +    * It is a mandatory passage for any source release.
  
 <code> <code>
-cd svn/trunk/scripts+cd scripts 
 +./source.sh
  
-for FreeDiams +find output 
-./source.sh freediams+cd .. 
 +ls freemedformsfullsources.*.tgz 
 +</code>
  
-# for FreeMedForms +===== Contributing =====
-./source.sh freemedforms+
  
-[...]+==== Git ==== 
 +We use Git as our VCSIf you want to make yourself familiar with it, look at the many, many tutorials and help pages available in the internet 
 + 
 +Git is available for Mac OSX, Linux, BSD and Windows (and probably for other OS). 
 +As starting point look [[http://git-scm.com/documentation|here]]. 
 + 
 +=== Configuring Git === 
 + 
 +First tell git who you are - you are advised to use your real name and a valid email addresse, no nicknames please. 
 +<code> 
 +git config --global user.name "James T. Kirk" 
 +git config --global user.email "kirk@enterprise.com"
 </code> </code>
 +
 +Now checkout the code as described at the Google Code page (link above).
 +
 +=== Installing git-hooks ===
 +We recommend to install our pre-defined git-hooks to simplify your work when pushing to our server. They run some code quality tests at each commit and automatically correct small issues (remove whitespace at the end of lines etc.):
 +<code>
 +cd /home/kirk/freemedforms./git/hooks
 +ln -s ../../githooks/*
 +</code>
 +
 +==== Server access ====
 +Per default anyone has read-only access to the FMF source code. If you want to write some code and contribute it to the project, please first read [[en:participate|Participate]] and present yourself at the mailing list.
 +We will then give you writing rights on the server, so you can push your changes upwards.
  
en/code/buildsystem.1339799670.txt.gz · Dernière modification: 2012/06/16 00:34 par Christian A. Reiter
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki FreeMedForms © Eric Maeker, MD