https://community.kde.org/api.php?action=feedcontributions&user=Stuartmd&feedformat=atomKDE Community Wiki - User contributions [en]2024-03-28T23:20:02ZUser contributionsMediaWiki 1.40.2https://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=26134Calligra/Building Calligra on Windows2012-11-05T16:36:54Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for the Windows operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
Note: the 4.7 branch of emerge is no longer usable. Use the 4.8 or master branch. Those branches need Python 3.x. You also need 7za.exe instead of 7z.exe in the path.<br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 3.2 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.8 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.8 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.8<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Set KDECOMPILER=msvc2010<br />
* Update WINDOWSSDKDIR to point to your installation of the Windows SDK<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge coreutils<br />
emerge grep<br />
<br />
There are some additional optional libraries that can be used by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular (only needed to build a calligra plugin for okular)<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
Depending on your requirements, there are some additional libraries that may be useful<br />
emerge libwpd // Wordperfect document support <br />
emerge libwpg // Wordperfect graphics support<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -G "NMake Makefiles JOM" -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull --rebase<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--><br />
<br />
<br />
The sources for the WIX-based installer for Calligra on Windows are at<br />
<br />
https://gitorious.org/calligra-installer-for-windows</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=22673Calligra/Building Calligra on Windows2012-07-10T09:27:35Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for the Windows operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
Note: the 4.7 branch of emerge is no longer usable. Use the 4.8 or master branch. Those branches need Python 3.x. You also need 7za.exe instead of 7z.exe in the path.<br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Set KDECOMPILER=msvc2010<br />
* Update WINDOWSSDKDIR to point to your installation of the Windows SDK<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge coreutils<br />
emerge grep<br />
<br />
There are some additional optional libraries that can be used by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular (only needed to build a calligra plugin for okular)<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
Depending on your requirements, there are some additional libraries that may be useful<br />
emerge libwpd // Wordperfect document support <br />
emerge libwpg // Wordperfect graphics support<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull --rebase<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--><br />
<br />
<br />
The sources for the WIX-based installer for Calligra on Windows are at<br />
<br />
https://gitorious.org/calligra-installer-for-windows</div>Stuartmdhttps://community.kde.org/index.php?title=Akademy/2012/QtQuick&diff=22275Akademy/2012/QtQuick2012-06-27T23:34:17Z<p>Stuartmd: </p>
<hr />
<div>'''Qt Quick 2 Training on Monday, 2 July 2012'''<br />
<br />
Qt 5 is coming, and one of its most outstanding features will be Qt Quick 2. <br />
During Akademy, a training will be held covering the basic concepts of Qt Quick 2, how to make your own GUI with a specific emphasis on user interaction, animations and transitions between states. Last but not least, will be presented how to use the Qt C++ API to extend the Qt Quick 2 runtime.<br />
<br />
KDAB will be conducting this training, which is sponsored by Nokia in addition to their Platinum sponsorship. Nokia and KDAB are committed to Qt and KDE, and are offering this training to support that commitment. <br />
<br />
Coaches: Volker Krause and Kévin Ottens<br />
<br />
Preliminary schedule:<br />
<br />
09:30 - 11:00 Concepts and composing user interfaces<br />
<br />
11:00 - 11:15 Break<br />
<br />
11:15 - 12:45 User interaction<br />
<br />
12:45 - 13:45 Lunch Break<br />
<br />
13:45 - 15:15 Animations, states and transitions<br />
<br />
15:15 - 15:30 Break<br />
<br />
15:30 - 17:00 C++ Integration<br />
<br />
<br />
----<br />
<br />
'''Registration is required.'''<br />
<br />
The workshop is suitable for beginners and advanced developers. Please add your name and information below if you want to attend.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Number<br />
! Name/IRC nick/email<br />
! Level of Qt expertise<br />
|-<br />
| width="10%" | 1<br />
| width="35%" | Ima Hotshot<br />
| width="55%" | I can do cute with one hand behind my back.<br />
|-<br />
| 2<br />
| Helio Chissini de Castro<br />
| Some Qt but need learn new tricks<br />
|-<br />
| 3<br />
| Lauri Võsandi<br />
| Always ready to learn new stuff!<br />
|-<br />
| 4<br />
| Sune Vuorela<br />
| c++ champion, haven't yet succeeded hello world in qtquick<br />
|-<br />
| 5<br />
| Luciano Montanaro<br />
| Good Qt knowledge, some Qt Quick 1<br />
|-<br />
| 6<br />
| Sinny Kumari (ksinny)<br />
| Intermediate Qt and QtQuick 1<br />
|-<br />
| 7<br />
| Shantanu Tushar (shaan7)<br />
| Advanced Qt and QtQuick 1<br />
|-<br />
| 8<br />
| Christoph Cullmann (cullmann)<br />
| Qt ok, Qt Quick never tried<br />
|-<br />
| 9<br />
| Dominik Haumann (dhaumann)<br />
| Qt, Qt Quick never tried<br />
|-<br />
| 10<br />
| Pradeepto Bhattacharya (pradeepto) <br />
| Qt <br />
|-<br />
| 11<br />
| Martin Gräßlin (mgraesslin)<br />
| Good Qt knowledge, knows the annoying parts of transiting ot QtQuick 1<br />
|-<br />
| 12<br />
| José Millán Soto (fid_jose)<br />
| Experience with Qt, but I've never tried QtQuick<br />
|-<br />
| 13<br />
| Maximilian Löffler<br />
| Just started with Qt, never worked with Qt Quick<br />
|-<br />
| 14<br />
| John Layt (jlayt)<br />
| Qt Maintainer, doesn't mean I know what I'm doing :-)<br />
|-<br />
| 15<br />
| Park Shinjo (peremen)<br />
| Some Qt, no Qt Quick yet<br />
|-<br />
| 16<br />
| Sven Petai (hadara)<br />
| very little QT experience, no Qt Quick experience<br />
|-<br />
| 17<br />
| Alejandro Castaño<br />
| Good Qt/Qt Quick<br />
|-<br />
| 18<br />
| Adrian Lopez<br />
| very little Qt and Qt Quick experience<br />
|-<br />
| 19<br />
| Joseph Wenninger<br />
| Qt widget based: quite good, Qt Quick: no expeience<br />
|-<br />
| 20<br />
| Dan Vratil<br />
| Good Qt knowledge, Qt Quick basics<br />
|-<br />
| 21<br />
| Niels Slot<br />
| Decent Qt knowledge, almost no Qt Quick experience<br />
|-<br />
| 22<br />
| Mirko Boehm<br />
| I code Qt while sleepwalking after three Mai Tais. But not QML.<br />
|-<br />
| 23<br />
| Jure Repinc<br />
| Good Qt, only tried Qt Quick 1 a little<br />
|-<br />
| 24<br />
| Lindsay Roberts<br />
| Medium Qt, low Quick.<br />
|-<br />
| 25<br />
| Antonio Larrosa<br />
| Good Qt, no Qt Quick<br />
|-<br />
| 26<br />
| Yash shah<br />
| Qt, no experience with Qt Quick<br />
|-<br />
| 27<br />
| Daniele E. Domenichelli (drdanz)<br />
| Good Qt, almost no Qt Quick experience<br />
|-<br />
| 28<br />
| Christian Reiner<br />
| Did some c++/Qt, no Qt Quick<br />
|-<br />
| 29<br />
| Sivan Greenberg<br />
| Done quite some QML by now, wants more insight of the C++ side.<br />
|-<br />
| 30<br />
| Benjamin Port<br />
| A bit experience with Qt, but never really use QtQuick (only some test)<br />
|-<br />
| 31<br />
| Felix Rohrbach (fxrh)<br />
| Medium Qt, no QtQuick<br />
|-<br />
| 32<br />
| Shreya Pandit(shreya)<br />
| Intermediate Qt and beginner Qt Quick<br />
|-<br />
| 33<br />
| Rohan Garg (shadeslayer)<br />
| Intermediate Qt, very basic knowledge of Qt Quick<br />
|-<br />
| 34<br />
| Margus Ernits<br />
| beginner QT<br />
|-<br />
| 35<br />
| Richard Dale<br />
| Good Qt, wrote a commercial Symbian app with Qt Quick<br />
|-<br />
| 36<br />
| Heinz Wiesinger<br />
| Very little Qt, some QtQuick<br />
|-<br />
| 37<br />
| Daniel E. Moctezuma (dmoctezuma)<br />
| Good Qt knowledge, very basics of QtQuick<br />
|-<br />
| 38<br />
| Smit Mehta (smit.meh@gmail.com)<br />
| Qt - Basics<br />
|-<br />
| 39<br />
| Kåre Särs<br />
| Good Qt knowledge, doing a Qt Quick project at work<br />
|-<br />
| 40<br />
| Christian Mollekopf<br />
| Decent Qt knowledge, barely touched QML<br />
|-<br />
| 41<br />
| Dani Gutiérrez (danitxu)<br />
| Medium-Good at Qt, no QML practical knowledge<br />
|-<br />
| 42<br />
| Matis Palm<br />
| Qt - Basics<br />
|-<br />
| 43<br />
| Jonas Vejlin<br />
| Decent c++, ultra low QT<br />
|-<br />
| 44<br />
| Ingo Klöcker (mahoutsukai)<br />
| Good Qt, no QtQuick<br />
|-<br />
| 45<br />
| Leho Kraav (macmaN)<br />
| Qt very basics only<br />
|-<br />
| 46<br />
| Allan Vein<br />
| Qt basics!<br />
|-<br />
| 47<br />
| Alexander Dymo<br />
| Good Qt, no QtQuick<br />
|-<br />
| 48<br />
| Olena Dymo<br />
| Qt beginner<br />
|-<br />
| 49<br />
| Saul Ibarra<br />
| Intermediate level, no Qt Quick<br />
|-<br />
| 50<br />
| Martin Klapetek / mck182<br />
| Good Qt knowledge, minimal QtQuick<br />
|-<br />
| 51<br />
|<br />
|<br />
|-<br />
| 52<br />
| <br />
| <br />
|-<br />
| 53<br />
| <br />
| <br />
|-<br />
| 54<br />
| <br />
| <br />
|-<br />
| 55<br />
| <br />
| <br />
|-<br />
| 56<br />
| <br />
| <br />
|-<br />
| 57<br />
| <br />
| <br />
|-<br />
| 58<br />
| <br />
| <br />
|-<br />
| 59<br />
| <br />
| <br />
|-<br />
| 60<br />
| <br />
| <br />
|}</div>Stuartmdhttps://community.kde.org/index.php?title=Akademy/2012/QtQuick&diff=22274Akademy/2012/QtQuick2012-06-27T23:33:04Z<p>Stuartmd: </p>
<hr />
<div>'''Qt Quick 2 Training on Monday, 2 July 2012'''<br />
<br />
Qt 5 is coming, and one of its most outstanding features will be Qt Quick 2. <br />
During Akademy, a training will be held covering the basic concepts of Qt Quick 2, how to make your own GUI with a specific emphasis on user interaction, animations and transitions between states. Last but not least, will be presented how to use the Qt C++ API to extend the Qt Quick 2 runtime.<br />
<br />
KDAB will be conducting this training, which is sponsored by Nokia in addition to their Platinum sponsorship. Nokia and KDAB are committed to Qt and KDE, and are offering this training to support that commitment. <br />
<br />
Coaches: Volker Krause and Kévin Ottens<br />
<br />
Preliminary schedule:<br />
<br />
09:30 - 11:00 Concepts and composing user interfaces<br />
<br />
11:00 - 11:15 Break<br />
<br />
11:15 - 12:45 User interaction<br />
<br />
12:45 - 13:45 Lunch Break<br />
<br />
13:45 - 15:15 Animations, states and transitions<br />
<br />
15:15 - 15:30 Break<br />
<br />
15:30 - 17:00 C++ Integration<br />
<br />
<br />
----<br />
<br />
'''Registration is required.'''<br />
<br />
The workshop is suitable for beginners and advanced developers. Please add your name and information below if you want to attend.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Number<br />
! Name/IRC nick/email<br />
! Level of Qt expertise<br />
|-<br />
| width="10%" | 1<br />
| width="35%" | Ima Hotshot<br />
| width="55%" | I can do cute with one hand behind my back.<br />
|-<br />
| 2<br />
| Helio Chissini de Castro<br />
| Some Qt but need learn new tricks<br />
|-<br />
| 3<br />
| Lauri Võsandi<br />
| Always ready to learn new stuff!<br />
|-<br />
| 4<br />
| Sune Vuorela<br />
| c++ champion, haven't yet succeeded hello world in qtquick<br />
|-<br />
| 5<br />
| Luciano Montanaro<br />
| Good Qt knowledge, some Qt Quick 1<br />
|-<br />
| 6<br />
| Sinny Kumari (ksinny)<br />
| Intermediate Qt and QtQuick 1<br />
|-<br />
| 7<br />
| Shantanu Tushar (shaan7)<br />
| Advanced Qt and QtQuick 1<br />
|-<br />
| 8<br />
| Christoph Cullmann (cullmann)<br />
| Qt ok, Qt Quick never tried<br />
|-<br />
| 9<br />
| Dominik Haumann (dhaumann)<br />
| Qt, Qt Quick never tried<br />
|-<br />
| 10<br />
| Pradeepto Bhattacharya (pradeepto) <br />
| Qt <br />
|-<br />
| 11<br />
| Martin Gräßlin (mgraesslin)<br />
| Good Qt knowledge, knows the annoying parts of transiting ot QtQuick 1<br />
|-<br />
| 12<br />
| José Millán Soto (fid_jose)<br />
| Experience with Qt, but I've never tried QtQuick<br />
|-<br />
| 13<br />
| Maximilian Löffler<br />
| Just started with Qt, never worked with Qt Quick<br />
|-<br />
| 14<br />
| John Layt (jlayt)<br />
| Qt Maintainer, doesn't mean I know what I'm doing :-)<br />
|-<br />
| 15<br />
| Park Shinjo (peremen)<br />
| Some Qt, no Qt Quick yet<br />
|-<br />
| 16<br />
| Sven Petai (hadara)<br />
| very little QT experience, no Qt Quick experience<br />
|-<br />
| 17<br />
| Alejandro Castaño<br />
| Good Qt/Qt Quick<br />
|-<br />
| 18<br />
| Adrian Lopez<br />
| very little Qt and Qt Quick experience<br />
|-<br />
| 19<br />
| Joseph Wenninger<br />
| Qt widget based: quite good, Qt Quick: no expeience<br />
|-<br />
| 20<br />
| Dan Vratil<br />
| Good Qt knowledge, Qt Quick basics<br />
|-<br />
| 21<br />
| Niels Slot<br />
| Decent Qt knowledge, almost no Qt Quick experience<br />
|-<br />
| 22<br />
| Mirko Boehm<br />
| I code Qt while sleepwalking after three Mai Tais. But not QML.<br />
|-<br />
| 23<br />
| Jure Repinc<br />
| Good Qt, only tried Qt Quick 1 a little<br />
|-<br />
| 24<br />
| Lindsay Roberts<br />
| Medium Qt, low Quick.<br />
|-<br />
| 25<br />
| Antonio Larrosa<br />
| Good Qt, no Qt Quick<br />
|-<br />
| 26<br />
| Yash shah<br />
| Qt, no experience with Qt Quick<br />
|-<br />
| 27<br />
| Daniele E. Domenichelli (drdanz)<br />
| Good Qt, almost no Qt Quick experience<br />
|-<br />
| 28<br />
| Christian Reiner<br />
| Did some c++/Qt, no Qt Quick<br />
|-<br />
| 29<br />
| Sivan Greenberg<br />
| Done quite some QML by now, wants more insight of the C++ side.<br />
|-<br />
| 30<br />
| Benjamin Port<br />
| A bit experience with Qt, but never really use QtQuick (only some test)<br />
|-<br />
| 31<br />
| Felix Rohrbach (fxrh)<br />
| Medium Qt, no QtQuick<br />
|-<br />
| 32<br />
| Shreya Pandit(shreya)<br />
| Intermediate Qt and beginner Qt Quick<br />
|-<br />
| 33<br />
| Rohan Garg (shadeslayer)<br />
| Intermediate Qt, very basic knowledge of Qt Quick<br />
|-<br />
| 34<br />
| Margus Ernits<br />
| beginner QT<br />
|-<br />
| 35<br />
| Richard Dale<br />
| Good Qt, wrote a commercial Symbian app with Qt Quick<br />
|-<br />
| 36<br />
| Heinz Wiesinger<br />
| Very little Qt, some QtQuick<br />
|-<br />
| 37<br />
| Daniel E. Moctezuma (dmoctezuma)<br />
| Good Qt knowledge, very basics of QtQuick<br />
|-<br />
| 38<br />
| Smit Mehta (smit.meh@gmail.com)<br />
| Qt - Basics<br />
|-<br />
| 39<br />
| Kåre Särs<br />
| Good Qt knowledge, doing a Qt Quick project at work<br />
|-<br />
| 40<br />
| Christian Mollekopf<br />
| Decent Qt knowledge, barely touched QML<br />
|-<br />
| 41<br />
| Dani Gutiérrez (danitxu)<br />
| Medium-Good at Qt, no QML practical knowledge<br />
|-<br />
| 42<br />
| Matis Palm<br />
| Qt - Basics<br />
|-<br />
| 43<br />
| Jonas Vejlin<br />
| Decent c++, ultra low QT<br />
|-<br />
| 44<br />
| Ingo Klöcker (mahoutsukai)<br />
| Good Qt, no QtQuick<br />
|-<br />
| 45<br />
| Leho Kraav (macmaN)<br />
| Qt very basics only<br />
|-<br />
| 46<br />
| Allan Vein<br />
| Qt basics!<br />
|-<br />
| 47<br />
| Alexander Dymo<br />
| Good Qt, no QtQuick<br />
|-<br />
| 48<br />
| Olena Dymo<br />
| Qt beginner<br />
|-<br />
| 49<br />
| Saul Ibarra<br />
| Intermediate level, no Qt Quick<br />
|-<br />
| 50<br />
| Martin Klapetek / mck182<br />
| Good Qt knowledge, minimal QtQuick<br />
|-<br />
| 51<br />
| Stuart Dickson / stuartmd<br />
| Qt beginner<br />
|-<br />
| 52<br />
| <br />
| <br />
|-<br />
| 53<br />
| <br />
| <br />
|-<br />
| 54<br />
| <br />
| <br />
|-<br />
| 55<br />
| <br />
| <br />
|-<br />
| 56<br />
| <br />
| <br />
|-<br />
| 57<br />
| <br />
| <br />
|-<br />
| 58<br />
| <br />
| <br />
|-<br />
| 59<br />
| <br />
| <br />
|-<br />
| 60<br />
| <br />
| <br />
|}</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=22239Calligra/Building Calligra on Windows2012-06-27T10:01:52Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for the Windows operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
Note: the 4.7 branch of emerge is no longer usable. Use the 4.8 or master branch. Those branches need Python 3.x. You also need 7za.exe instead of 7z.exe in the path.<br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.8 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.8<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Set KDECOMPILER=msvc2010<br />
* Update WINDOWSSDKDIR to point to your installation of the Windows SDK<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge coreutils<br />
emerge grep<br />
<br />
There are some additional optional libraries that can be used by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular (only needed to build a calligra plugin for okular)<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
Depending on your requirements, there are some additional libraries that may be useful<br />
emerge libwpd // Wordperfect document support <br />
emerge libwpg // Wordperfect graphics support<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull --rebase<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--><br />
<br />
<br />
The sources for the WIX-based installer for Calligra on Windows are at<br />
<br />
https://gitorious.org/calligra-installer-for-windows</div>Stuartmdhttps://community.kde.org/index.php?title=Akademy/2012/Attendees&diff=22226Akademy/2012/Attendees2012-06-26T12:10:18Z<p>Stuartmd: /* Departures */</p>
<hr />
<div>== Arrivals ==<br />
<br />
Please add in order of <u>'''''arrival date'''''<br></u> <br />
<br />
{| cellspacing="0" cellpadding="5" border="1" class="sortable" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 831px; height: 131px;"<br />
|- style="background: none repeat scroll 0% 0% rgb(236, 236, 236); white-space: nowrap;"<br />
! Name <br />
! Country<br> <br />
! IRC <br />
! ''Arrival Date'' <br />
! Arrival Time <br />
! Arrival Details <br />
! Notes<br />
|-<br />
| Valorie Zimmerman<br />
| USA<br />
| valorie<br />
| 26th, Tue<br />
| 12:05<br />
| Finnair/Flybe #3923 HEL-TLL<br />
| Staying at Baltic Apartments until Fri.<br />
|-<br />
| Kenny Duffus <br />
| Scotland <br />
| seaLne <br />
| 27th, Wed <br />
| 13:00 <br />
| KL1470 GLA to AMS then Estonian Air OV174 AMS to TLL<br />
| <br><br />
|-<br />
| Marijn & Alex Kruisselbrink - Spehr<br />
| USA<br />
| Mek & blauzahl<br />
| 28th, Thu<br />
| 10:00<br />
| Ferry from Stockholm<br />
|<br />
|-<br />
| Jure Repinc & his sister<br />
| Slovenia<br />
| JLP & SmrtSkoso<br />
| 28th, Thu<br />
| 20:45<br />
| Flight AY3931 from Helsinki<br />
|<br />
|-<br />
| Anne Wilson<br />
| England<br />
| annew<br />
| 29th, Fri.<br />
| 13:15<br />
| SAS540 MAN to CPH, SAS8408 CPH to TLL<br />
|<br />
|-<br />
| Jaroslaw Staniek<br />
| Poland<br />
| jstaniek<br />
| 29th, Fri<br />
| 13:55<br />
| LO 785 WAW to TLL<br />
|<br />
|-<br />
| Trever Fischer<br />
| Ohio, USA<br />
| tdfischer<br />
| 29th, Fri<br />
| 13:55<br />
| LO 785 WAW to TLL<br />
|<br />
|-<br />
| Stuart Dickson<br />
| UK<br />
| stuartmd<br />
| 29th, Fri<br />
| 17:20<br />
| U2 3055 STN to TLL<br />
|<br />
|-<br />
| Akarsh Simha<br />
| Texas, USA / Bangalore, India<br />
| kstar<br />
| 29th, Fri<br />
| 17:25<br />
| LH 882 FRA to TLL<br />
|<br />
|-<br />
| Rishab Arora<br />
| Delhi, India<br />
| spacetime<br />
| 29th, Fri<br />
| 17:30<br />
| AY-22 DEL to HEL, AY-3929 HEL to TLL<br />
|<br />
|-<br />
| Park Shinjo<br />
| South Korea<br />
| peremen<br />
| 29th, Fri<br />
| 20:45<br />
| AY 42 ICN to HEL, AY 3931 HEL to TLL<br />
|<br />
|-<br />
| Myriam Schweingruber & Mark Kretschmann<br />
| Germany<br />
| Mamarok<br />
| 29th, Fri<br />
| 23:10<br />
| LH 2434 MUC to TLL<br />
|<br />
|-<br />
|}<br />
<br />
<u><br></u><br />
<br />
== Departures ==<br />
<br />
Please add in order of ''<u>'''departure date'''</u>''<u>''<br>''</u> <br />
<br />
{| cellspacing="0" cellpadding="5" border="1" class="sortable" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 831px; height: 131px;"<br />
|- style="background: none repeat scroll 0% 0% rgb(236, 236, 236); white-space: nowrap;"<br />
! Name <br />
! Country<br> <br />
! IRC <br />
! ''Departure Date'' <br />
! Departure Time <br />
! Departure Details <br />
! Notes<br />
|-<br />
| Alex Spehr<br />
| USA<br />
| blauzahl<br />
| 3rd, Tue<br />
| 7:55<br />
| OV121 to ARN then SK635 to FRA<br />
|<br />
|-<br />
| Anne Wilson<br />
| England<br />
| annew<br />
| 4th, Wed<br />
| 13:50<br />
| SAS8419 to ARN then SAS2549 to MAN<br />
| <br />
|-<br />
| Jaroslaw Staniek<br />
| Poland<br />
| jstaniek<br />
| 4th, Wed<br />
| 14:40<br />
| LO 786 TLL to WAW<br />
|<br />
|-<br />
| Marijn Kruisselbrink<br />
| USA<br />
| Mek<br />
| 4th, Wed<br />
| 18:10<br />
| OV145 to CPH then SK549 to AMS<br />
|<br />
|-<br />
| Myriam Schweingruber & Mark Kretschmann<br />
| Germany<br />
| Mamarok<br />
| 5th, Thu<br />
| 13:10<br />
| LH 2437 to MUC<br />
| <br />
|-<br />
| Jure Repinc & his sister<br />
| Slovenia<br />
| JLP & SmrtSkoso<br />
| 6th, Fri<br />
| 06:05<br />
| Flight AY3940 to Helsinki<br />
|<br />
|-<br />
| Stuart Dickson<br />
| UK<br />
| stuartmd<br />
| 6th, Fri<br />
| 17:20<br />
| U2 TLL to STN<br />
|<br />
|-<br />
| Valorie Zimmerman<br />
| Washington, USA<br />
| valorie<br />
| 7th, Sat<br />
| 12:35<br />
| Finnair/Flybe 3924 TLL to HEL<br />
|<br />
|-<br />
| Trever Fischer<br />
| Ohio, USA<br />
| tdfischer<br />
| 7th, Sat<br />
| 14:40<br />
| LO 786 TLL to WAW<br />
| <br />
|-<br />
| Rishab Arora<br />
| India<br />
| spacetime<br />
| 7th, Sat<br />
| 18:00<br />
| AY-3930 TLL to HEL, AY-21 HEL to DEL<br />
|<br />
|-<br />
| Kenny Duffus<br />
| Scotland<br />
| seaLne<br />
| 10th, Tue<br />
| 07:35<br />
| Estonian Air OV173 -> AMS then KL1475 to GLA<br />
| <br />
|}</div>Stuartmdhttps://community.kde.org/index.php?title=Akademy/2012/Attendees&diff=22225Akademy/2012/Attendees2012-06-26T12:08:41Z<p>Stuartmd: /* Arrivals */</p>
<hr />
<div>== Arrivals ==<br />
<br />
Please add in order of <u>'''''arrival date'''''<br></u> <br />
<br />
{| cellspacing="0" cellpadding="5" border="1" class="sortable" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 831px; height: 131px;"<br />
|- style="background: none repeat scroll 0% 0% rgb(236, 236, 236); white-space: nowrap;"<br />
! Name <br />
! Country<br> <br />
! IRC <br />
! ''Arrival Date'' <br />
! Arrival Time <br />
! Arrival Details <br />
! Notes<br />
|-<br />
| Valorie Zimmerman<br />
| USA<br />
| valorie<br />
| 26th, Tue<br />
| 12:05<br />
| Finnair/Flybe #3923 HEL-TLL<br />
| Staying at Baltic Apartments until Fri.<br />
|-<br />
| Kenny Duffus <br />
| Scotland <br />
| seaLne <br />
| 27th, Wed <br />
| 13:00 <br />
| KL1470 GLA to AMS then Estonian Air OV174 AMS to TLL<br />
| <br><br />
|-<br />
| Marijn & Alex Kruisselbrink - Spehr<br />
| USA<br />
| Mek & blauzahl<br />
| 28th, Thu<br />
| 10:00<br />
| Ferry from Stockholm<br />
|<br />
|-<br />
| Jure Repinc & his sister<br />
| Slovenia<br />
| JLP & SmrtSkoso<br />
| 28th, Thu<br />
| 20:45<br />
| Flight AY3931 from Helsinki<br />
|<br />
|-<br />
| Anne Wilson<br />
| England<br />
| annew<br />
| 29th, Fri.<br />
| 13:15<br />
| SAS540 MAN to CPH, SAS8408 CPH to TLL<br />
|<br />
|-<br />
| Jaroslaw Staniek<br />
| Poland<br />
| jstaniek<br />
| 29th, Fri<br />
| 13:55<br />
| LO 785 WAW to TLL<br />
|<br />
|-<br />
| Trever Fischer<br />
| Ohio, USA<br />
| tdfischer<br />
| 29th, Fri<br />
| 13:55<br />
| LO 785 WAW to TLL<br />
|<br />
|-<br />
| Stuart Dickson<br />
| UK<br />
| stuartmd<br />
| 29th, Fri<br />
| 17:20<br />
| U2 3055 STN to TLL<br />
|<br />
|-<br />
| Akarsh Simha<br />
| Texas, USA / Bangalore, India<br />
| kstar<br />
| 29th, Fri<br />
| 17:25<br />
| LH 882 FRA to TLL<br />
|<br />
|-<br />
| Rishab Arora<br />
| Delhi, India<br />
| spacetime<br />
| 29th, Fri<br />
| 17:30<br />
| AY-22 DEL to HEL, AY-3929 HEL to TLL<br />
|<br />
|-<br />
| Park Shinjo<br />
| South Korea<br />
| peremen<br />
| 29th, Fri<br />
| 20:45<br />
| AY 42 ICN to HEL, AY 3931 HEL to TLL<br />
|<br />
|-<br />
| Myriam Schweingruber & Mark Kretschmann<br />
| Germany<br />
| Mamarok<br />
| 29th, Fri<br />
| 23:10<br />
| LH 2434 MUC to TLL<br />
|<br />
|-<br />
|}<br />
<br />
<u><br></u><br />
<br />
== Departures ==<br />
<br />
Please add in order of ''<u>'''departure date'''</u>''<u>''<br>''</u> <br />
<br />
{| cellspacing="0" cellpadding="5" border="1" class="sortable" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 831px; height: 131px;"<br />
|- style="background: none repeat scroll 0% 0% rgb(236, 236, 236); white-space: nowrap;"<br />
! Name <br />
! Country<br> <br />
! IRC <br />
! ''Departure Date'' <br />
! Departure Time <br />
! Departure Details <br />
! Notes<br />
|-<br />
| Alex Spehr<br />
| USA<br />
| blauzahl<br />
| 3rd, Tue<br />
| 7:55<br />
| OV121 to ARN then SK635 to FRA<br />
|<br />
|-<br />
| Anne Wilson<br />
| England<br />
| annew<br />
| 4th, Wed<br />
| 13:50<br />
| SAS8419 to ARN then SAS2549 to MAN<br />
| <br />
|-<br />
| Jaroslaw Staniek<br />
| Poland<br />
| jstaniek<br />
| 4th, Wed<br />
| 14:40<br />
| LO 786 TLL to WAW<br />
|<br />
|-<br />
| Marijn Kruisselbrink<br />
| USA<br />
| Mek<br />
| 4th, Wed<br />
| 18:10<br />
| OV145 to CPH then SK549 to AMS<br />
|<br />
|-<br />
| Myriam Schweingruber & Mark Kretschmann<br />
| Germany<br />
| Mamarok<br />
| 5th, Thu<br />
| 13:10<br />
| LH 2437 to MUC<br />
| <br />
|-<br />
| Jure Repinc & his sister<br />
| Slovenia<br />
| JLP & SmrtSkoso<br />
| 6th, Fri<br />
| 06:05<br />
| Flight AY3940 to Helsinki<br />
|<br />
|-<br />
| Valorie Zimmerman<br />
| Washington, USA<br />
| valorie<br />
| 7th, Sat<br />
| 12:35<br />
| Finnair/Flybe 3924 TLL to HEL<br />
|<br />
|-<br />
| Trever Fischer<br />
| Ohio, USA<br />
| tdfischer<br />
| 7th, Sat<br />
| 14:40<br />
| LO 786 TLL to WAW<br />
| <br />
|-<br />
| Rishab Arora<br />
| India<br />
| spacetime<br />
| 7th, Sat<br />
| 18:00<br />
| AY-3930 TLL to HEL, AY-21 HEL to DEL<br />
|<br />
|-<br />
| Kenny Duffus<br />
| Scotland<br />
| seaLne<br />
| 10th, Tue<br />
| 07:35<br />
| Estonian Air OV173 -> AMS then KL1475 to GLA<br />
| <br />
|}</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=19092Calligra/Building Calligra on Windows2012-03-26T09:26:04Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Set KDECOMPILER=msvc2010<br />
* Update WINDOWSSDKDIR to point to your installation of the Windows SDK<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
Depending on your requirements, there are some additional libraries that may be useful<br />
emerge libwpd // Wordperfect document support <br />
emerge libwpg // Wordperfect graphics support<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=18919Calligra/Building Calligra on Windows2012-03-18T10:41:39Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Set KDECOMPILER=msvc2010<br />
* Update WINDOWSSDKDIR to point to your installation of the Windows SDK<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
Depending on your requirements, there are some additional libraries that may be useful<br />
emerge libwpd // Wordperfect document support <br />
emerge libwpg // Wordperfect graphics support<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=18218Calligra/Building Calligra on Windows2012-02-22T16:01:06Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Set KDECOMPILER=msvc2010<br />
* Update WINDOWSSDKDIR to point to your installation of the Windows SDK<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=18217Calligra/Building Calligra on Windows2012-02-22T15:59:08Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Update KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
One you have done this, you should navigate to the emerge directory and call<br />
kdeenv<br />
<br />
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=18216Calligra/Building Calligra on Windows2012-02-22T15:48:39Z<p>Stuartmd: /* Build requirements */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Update KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=18215Calligra/Building Calligra on Windows2012-02-22T15:48:12Z<p>Stuartmd: /* Hard dependencies */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Update KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=18208Calligra/Building Calligra on Windows2012-02-22T15:20:43Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Update KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
emerge librdf-src<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17950Calligra/Building Calligra on Windows2012-02-13T10:43:53Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
You will need to make the following changes to etc/kdesettings.bat:<br />
* Update KDEROOT<br />
* Update KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17947Calligra/Building Calligra on Windows2012-02-13T10:42:47Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
cd emerge<br />
git checkout kde-4.7<br />
mkdir ..\etc<br />
copy kdesettings-example.bat ..\etc\kdesettings.bat<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have run ''kdeenv'' from KDEROOT/emerge. <br />
<br />
Whilst testing, the main changes we made to kdesettings.bat (copy kdesettings-example.bat from ./emerge/ to ./etc/kdesettings.bat) were<br />
* Updated KDEROOT<br />
* Updated KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17945Calligra/Building Calligra on Windows2012-02-13T10:33:34Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Git<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool, kde-4.7 branch<br />
<br />
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.7 branch. <br />
git clone git://anongit.kde.org/emerge.git<br />
git checkout kde-4.7<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have run ''kdeenv'' from KDEROOT/emerge. <br />
<br />
Whilst testing, the main changes we made to kdesettings.bat (copy kdesettings-example.bat from ./emerge/ to ./etc/kdesettings.bat) were<br />
* Updated KDEROOT<br />
* Updated KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17937Calligra/Building Calligra on Windows2012-02-13T08:16:16Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have run ''kdeenv'' from KDEROOT/emerge. <br />
<br />
Whilst testing, the main changes we made to kdesettings.bat (copy kdesettings-example.bat from ./emerge/ to ./etc/kdesettings.bat) were<br />
* Updated KDEROOT<br />
* Updated KDECOMPILER (msvc2010)<br />
* Set EMERGE_USE_SHORT_PATH=1<br />
* Set PYTHONPATH (default assumes in Program Files)<br />
* Set EMERGE_SOURCEONLY=True<br />
<br />
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17671Calligra/Building Calligra on Windows2012-02-07T04:49:06Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17670Calligra/Building Calligra on Windows2012-02-07T04:47:05Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
emerge soprano<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=17669Calligra/Building Calligra on Windows2012-02-07T04:45:47Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms2<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16915Calligra/Building Calligra on Windows2011-12-23T08:23:04Z<p>Stuartmd: /* Executing unit tests */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16914Calligra/Building Calligra on Windows2011-12-23T08:21:28Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the [[Building/Building_Calligra_on_Windows#Running_Calligra_applications|Running Calligra Applications]] section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16913Calligra/Building Calligra on Windows2011-12-23T08:17:38Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
== Calligra apps don't start ==<br />
<br />
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the "Running Calligra" section earlier and make sure you've run update-mime-database and kbuildsycoca4.<br />
<br />
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs.<br />
This is available on [http://technet.microsoft.com/en-us/sysinternals/bb896647 Microsoft Technet]<br />
<br />
<!--<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.<br />
--></div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16725Calligra/Building Calligra on Windows2011-12-15T15:30:08Z<p>Stuartmd: /* CMake Build Options */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16724Calligra/Building Calligra on Windows2011-12-15T15:29:31Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
<br />
{{Note|You can selectively build applications by using the <nowiki>-DBUILD_application=off</nowiki> command to disable building of those you do not want. If you have a full cmake install, you can use the ''<nowiki>cmake-gui</nowiki>'' application to let you make changes to the configuration.}}<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
<!--<br />
= Build only selected applications from Calligra =<br />
<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
--><br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16670Calligra/Building Calligra on Windows2011-12-14T08:11:12Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16624Calligra/Building Calligra on Windows2011-12-09T03:11:05Z<p>Stuartmd: /* Running Calligra applications */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
set KDEDIRS=\path\to\install;%KDEDIRS%<br />
set PATH=\path\to\install\bin;%PATH%<br />
set KDEHOME=\path\to\a\config\dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS%<br />
set PATH=%USERPROFILE%\kde4\inst\bin;%PATH%<br />
set KDEHOME=%USERPROFILE%\kde4\.kde<br />
<br />
Here we are setting KDEHOME to be saved <br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=%USERPROFILE%\kde4\inst<br />
<br />
And then you need to execute:<br />
update-mime-database %KDEROOT%\share\mime<br />
kbuildsycoca4 --noincremental<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16623Calligra/Building Calligra on Windows2011-12-09T03:04:25Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off<br />
<br />
Here we are telling cmake that:<br />
* We want to install Calligra into ~/kde4/inst<br />
* The source files are located at ~/kde4/src/calligra<br />
* We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of ''EMERGE_BUILDTYPE''<br />
* We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.<br />
<br />
Then, to build Calligra, type:<br />
jom<br />
<br />
{{Note|''jom'' is a multi-core port of ''nmake''. By default it uses all of the cores on the machine, buy you can specify the number to use with the ''-j#'' parameter. e.g. ''jom -j2'' would force it to use 2 processes}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16622Calligra/Building Calligra on Windows2011-12-09T02:55:37Z<p>Stuartmd: /* Optional dependencies */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency. Use ''emerge'' to install these missing dependencies (not all may be available on the Windows platform).<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
{{Note|Here we are using the variable ''EMERGE_BUILDTYPE'' in order to ensure that we are using the same build as the KDE and supporting libraries we built earlier}}<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16621Calligra/Building Calligra on Windows2011-12-09T02:53:24Z<p>Stuartmd: /* Preparation */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
Before you begin, you will need to have a minimal set of software installed on your PC:<br />
* Python 2.7 (x86, not 64-bit)<br />
* Microsoft Visual Studio 2010 Express or Professional<br />
* Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)<br />
* KDE on Windows' ''emerge'' tool<br />
<br />
The following instructions assume that you have installed ''emerge'', have a valid kdesettings.bat file in KDEROOT/etc, and that you have ''kdeenv'' from KDEROOT/emerge. In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:<br />
emerge qt<br />
emerge kdelibs<br />
emerge kde-runtime<br />
<br />
Users familiar with development on Linux platforms may also wish to install another couple of libraries<br />
emerge corelibs<br />
emerge grep<br />
<br />
There are some additional libraries required by Calligra, again ''emerge'' is used to install them:<br />
emerge lcms<br />
emerge eigen2<br />
emerge boost<br />
emerge okular<br />
emerge exiv2<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
{{Note|Here we are using the variable ''EMERGE_BUILDTYPE'' in order to ensure that we are using the same build as the KDE and supporting libraries we built earlier}}<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16591Calligra/Building Calligra on Windows2011-12-07T11:47:34Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
{{Note|Here we are using the variable ''EMERGE_BUILDTYPE'' in order to ensure that we are using the same build as the KDE and supporting libraries we built earlier}}<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16555Calligra/Building Calligra on Windows2011-12-06T09:38:01Z<p>Stuartmd: /* Recommended setup */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
<br />
From your %USERPROFILE% directory (assuming you will be the only local user)<br />
;kde4\src\:source code<br />
;kde4\build\calligra:directory that Calligra will be built in<br />
;kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16554Calligra/Building Calligra on Windows2011-12-06T09:12:46Z<p>Stuartmd: /* Build Calligra */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16531Calligra/Building Calligra on Windows2011-12-05T10:00:11Z<p>Stuartmd: /* Executing unit tests */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run XXX <code>ccmake .</code> XXX in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
It is then recommended that before running the tests, you first execute<br />
<br />
jom install<br />
<br />
You can then run the test by executing:<br />
<br />
jom test<br />
<br />
or individually in the tests directories.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16530Calligra/Building Calligra on Windows2011-12-05T09:58:49Z<p>Stuartmd: /* Updating the already built software */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16529Calligra/Building Calligra on Windows2011-12-05T09:52:29Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
You can create this structure by opening a command prompt (cmd.exe) and typing:<br />
cd %USERPROFILE% <br />
mkdir kde4<br />
mkdir kde4\build<br />
mkdir kde4\build\calligra<br />
mkdir kde4\inst<br />
mkdir kde4\src<br />
<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
[core]<br />
autocrlf=false<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
From your home directory, type:<br />
cd kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out Subversion from trunk or a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16259Calligra/Building Calligra on Windows2011-11-25T09:11:25Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
<!-- include simplified distribution info --><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
cmake -DCMAKE_INSTALL_PREFIX=<nowiki>..\..\inst</nowiki> <nowiki>..\..\kde4\src\calligra</nowiki> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_flow=off -DBUILD_kexi=off -DWITH_Soprano=off<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
jom<br />
<br />
{{Note|''jom -j2'' or ''jom -j4'' can be used instead of ''jom'' to force the maximum number of processes to spawn}}<br />
<br />
This will take a while, once it has completed, type this command to install the software:<br />
jom install<br />
<br />
<!-- Including "build debug" info<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
--><br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out Subversion from trunk or a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd <nowiki>%USERPROFILE%\kde4\src\calligra</nowiki><br />
git pull<br />
cd <nowiki>%USERPROFILE%\kde4\build\calligra</nowiki><br />
jom<br />
jom install<br />
<br />
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}<br />
<br />
= Build only selected applications from Calligra =<br />
<!--<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
--><br />
You can edit the cmake command line, with "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16257Calligra/Building Calligra on Windows2011-11-25T09:02:34Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;<nowiki>C:\kderoot</nowiki>:KDE on Windows root directory<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
== Simplified installation of dependencies on various distributions ==<br />
{{Note|Most distribution don't ship calligra yet, so you may replace it by "koffice" or "koffice2" in those command lines}}<br />
*'''deb-based distributions (Debian, Ubuntu...):''' All the dependencies used for the packages can be installed by running<br />
apt-get build-dep {packagename}<br />
for instance on Ubuntu:<br />
sudo apt-get build-dep calligra<br />
<br />
*'''OpenSuSE:''' All the dependencies used for building Calligra can be installed by running:<br />
zypper si -d calligra<br />
<br />
*'''Fedora:''' All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
*'''ArchLinux:''' All the dependencies used for building Calligra can be installed by running:<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-libs docbook-xml docbook-xsl libgsf create-svn</pre><br />
<br />
*'''Chakra:''' All the dependencies used for building Calligra can be installed by running:(need to enable unstable repo)<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-common libgsf docbook-xml docbook-xsl create-svn</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
make<br />
<br />
Note that on dual-core machines compilation can be '''greatly speed up''' with the -j parameter of the ''make'' program, for example for dual-core:<br />
make -j4<br />
and for quad-core:<br />
make -j8<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out Subversion from trunk or a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
{{Note|''make -j4'' or ''make -j8'' can be used instead of ''make'' to speedup the build on multicore machines}}<br />
<br />
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}<br />
<br />
= Build only selected applications from Calligra =<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16256Calligra/Building Calligra on Windows2011-11-25T09:01:19Z<p>Stuartmd: /* Recommended setup */</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;C:\\kderoot<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated.<br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
== Simplified installation of dependencies on various distributions ==<br />
{{Note|Most distribution don't ship calligra yet, so you may replace it by "koffice" or "koffice2" in those command lines}}<br />
*'''deb-based distributions (Debian, Ubuntu...):''' All the dependencies used for the packages can be installed by running<br />
apt-get build-dep {packagename}<br />
for instance on Ubuntu:<br />
sudo apt-get build-dep calligra<br />
<br />
*'''OpenSuSE:''' All the dependencies used for building Calligra can be installed by running:<br />
zypper si -d calligra<br />
<br />
*'''Fedora:''' All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
*'''ArchLinux:''' All the dependencies used for building Calligra can be installed by running:<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-libs docbook-xml docbook-xsl libgsf create-svn</pre><br />
<br />
*'''Chakra:''' All the dependencies used for building Calligra can be installed by running:(need to enable unstable repo)<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-common libgsf docbook-xml docbook-xsl create-svn</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
make<br />
<br />
Note that on dual-core machines compilation can be '''greatly speed up''' with the -j parameter of the ''make'' program, for example for dual-core:<br />
make -j4<br />
and for quad-core:<br />
make -j8<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out Subversion from trunk or a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
{{Note|''make -j4'' or ''make -j8'' can be used instead of ''make'' to speedup the build on multicore machines}}<br />
<br />
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}<br />
<br />
= Build only selected applications from Calligra =<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16255Calligra/Building Calligra on Windows2011-11-25T09:01:03Z<p>Stuartmd: </p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*Nightly Builds <!-- [[/Nightly Builds/]] --><br />
*Developing With...<!--[[/Developing With QtCreator/]]--><br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
<!--* Scripts? [http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]--><br />
<br />
<!--<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
--><br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;C:\kderoot<br />
;%USERPROFILE%\kde4\src\:source code<br />
;%USERPROFILE%\kde4\build\calligra:directory that Calligra will be built in<br />
;%USERPROFILE%\kde4\inst\:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated. <br />
<br />
== Getting the source code ==<br />
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to %USERPROFILE%\.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
This will create a 'calligra' subdirectory with the complete source tree.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
== Simplified installation of dependencies on various distributions ==<br />
{{Note|Most distribution don't ship calligra yet, so you may replace it by "koffice" or "koffice2" in those command lines}}<br />
*'''deb-based distributions (Debian, Ubuntu...):''' All the dependencies used for the packages can be installed by running<br />
apt-get build-dep {packagename}<br />
for instance on Ubuntu:<br />
sudo apt-get build-dep calligra<br />
<br />
*'''OpenSuSE:''' All the dependencies used for building Calligra can be installed by running:<br />
zypper si -d calligra<br />
<br />
*'''Fedora:''' All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
*'''ArchLinux:''' All the dependencies used for building Calligra can be installed by running:<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-libs docbook-xml docbook-xsl libgsf create-svn</pre><br />
<br />
*'''Chakra:''' All the dependencies used for building Calligra can be installed by running:(need to enable unstable repo)<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-common libgsf docbook-xml docbook-xsl create-svn</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
make<br />
<br />
Note that on dual-core machines compilation can be '''greatly speed up''' with the -j parameter of the ''make'' program, for example for dual-core:<br />
make -j4<br />
and for quad-core:<br />
make -j8<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out Subversion from trunk or a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
{{Note|''make -j4'' or ''make -j8'' can be used instead of ''make'' to speedup the build on multicore machines}}<br />
<br />
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}<br />
<br />
= Build only selected applications from Calligra =<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Building_Calligra_on_Windows&diff=16254Calligra/Building Calligra on Windows2011-11-25T08:47:54Z<p>Stuartmd: Created page with "{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}} These instructions are for Unix..."</p>
<hr />
<div>{{Note|''These instructions are a work in progress, being based on the Linux Build instructions, there are some sections which need updating.''}}<br />
<br />
These instructions are for Unix and similar operating systems.<br />
<br />
See also:<br />
*[[/Nightly Builds/]]<br />
*[[/Developing With KDevelop/]]<br />
*[[/Developing With QtCreator/]]<br />
*[http://techbase.kde.org/Projects/KDE_on_Windows Pages about compiling KDE software for Windows]<br />
*[http://techbase.kde.org/Getting_Started/Build/KDE4/Mac_OS_X Pages about compiling KDE software for Mac OS X]<br />
*[https://wiki.kubuntu.org/CompilingKoffice2 Community HOWTO dedicated to building for Kubuntu]<br />
*[http://community.kde.org/Sysadmin/GitKdeOrgManual kde's git infrastructure manual]<br />
*[http://techbase.kde.org/Development/Tutorials/Git KDE and Git for developers]<br />
*[http://git.or.cz/course/svn.html git crash course]<br />
*[http://forum.kde.org/viewtopic.php?f=139&t=92880 script for building Calligra (build only krita by default, but easilly configurable)]<br />
<br />
<br />
Note: if you want to build FreOffice using the Nokia Qt SDK, please check out the [http://techbase.kde.org/index.php?title=User:Kumarafaque&oldid=54703 build instructions on techbase].<br />
<br />
<br />
= Preparation =<br />
<br />
<br />
== Recommended setup ==<br />
Here is recommendation of a directory structure:<br />
;$HOME/kde4/src/:source code<br />
;$HOME/kde4/build/calligra:directory that Calligra will be built in<br />
;$HOME/kde4/inst:directory that Calligra will be installed in<br />
<br />
The ''build'' directory is needed because you cannot (or should not) build Calligra inside the source directory; the source and build directory have to be separated. <br />
<br />
'''Advantages of this setup:'''<br />
*It is possible to have different builds (e.g. with different options out of the same source code)<br />
*[http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts David Faure's scripts] can be used to make development easier. With those scripts "make" can be typed in the source directory and building will happen in the right (build) directory automatically. <br />
<br />
Also, check the [http://techbase.kde.org/Getting_Started/Build/KDE4 Techbase instructions on setting up a build environment]. That contains some useful scripts and functions.<br />
<br />
== Getting the source code ==<br />
There are two options: to get the source code for the latest stable version or for the for the development version. The later option is needed to test, check and give feedback about features that is in development and have not been released yet. If unsure pick the stable version.<br />
<br />
=== Getting the source code for the latest stable version ===<br />
<br />
The latest stable Calligra version is '''{{Calligra/Stable}}'''.<br />
* Visit download.kde.org for the latest source code: [http://download.kde.org/download.php?url=stable/calligra-{{Calligra/Stable}}/calligra-{{Calligra/Stable}}.tar.bz2 calligra-{{Calligra/Stable}}.tar.bz2]<br />
* Check release notes on [http://www.calligra-suite.org/ calligra.org]<br />
<br />
<br />
=== Get the source code for the development version ===<br />
<br />
{{Warning|You cannot convert your KOffice SVN checkout to a Calligra git checkout. You will need to get the Calligra source code using git and manually apply your changes again.}}<br />
<br />
The latest development version of Calligra is '''{{Calligra/Unstable}}''' {{Calligra/Stage}}; developers always refer to it as to '''Master'''. Once tested and released, it will become the new current stable version {{Calligra/UnstableBranch}}.<br />
<br />
XXX: Here we should explain local branches, staging and always-release-ready Master, if we have that setup. XXX<br />
<br />
*'''Option 1: directly from git'''<br />
<br />
To retrieve the source code from Git you have to use the following setup:<br />
<br />
Add the following text to your ~/.gitconfig: <br />
<br />
<nowiki>[url "git://anongit.kde.org/"]</nowiki><br />
insteadOf = kde:<br />
[url "ssh://git@git.kde.org/"]<br />
pushInsteadOf = kde:<br />
<br />
Then execute<br />
<br />
$ git clone kde:calligra<br />
<br />
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.<br />
<br />
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).<br />
<br />
The $HOME/kde4/src/calligra directory will be created regardless of the way how the source code has been downloaded.<br />
<br />
*'''Option 2: download a repository tarball'''<br />
<br />
Go to https://projects.kde.org/projects/calligra/repository. Press the "Tarball" button. Copy the url text and paste it on your command line. It will look like:<br />
<br />
wget -c http://anongit.kde.org/calligra/calligra-latest.tar.gz<br />
<br />
Unpack and cd into directory, then run <br />
<br />
$ ./initrepo.sh<br />
<br />
From now on, you can run<br />
<br />
$ git pull<br />
<br />
to update, or<br />
<br />
$ git rebase origin/master<br />
<br />
if you have local changes<br />
<br />
<br />
*'''Option 3: if beta or rc version was released''', the source code for the latest beta can be found on KDE's ftp [ftp://ftp.kde.org/pub/kde/unstable/calligra-latest/ calligra-latest]. Uncompress the code so that $HOME/kde4/src/calligra is created.<br />
<br />
= Build requirements =<br />
This section provides information about '''hard''' (required) and '''optional''' software packages needed to build the Calligra software.<br />
<br />
== Hard dependencies ==<br />
<br />
{{Note|'''A note for developers:''' to add (or remove) a hard dependency, an explanation of the reason, and possibly a discussion must be posted in advance on calligra-devel@kde.org. The new dependency need to be packaged in the most widely used distributions (Debian, Fedora Core, OpenSuSE, (K)ubuntu). First try to make your new feature optional.}}<br />
<br />
Following are the general must-have dependencies for Calligra:<br />
* Qt 4.6.0 or newer<br />
*kdelibs and kdelibs development files<br />
**the minimal requirement is currently 4.3.0, any 4.3, 4.4 or 4.5 release packaged in your distribution is OK<br />
**On opensuse the development package is called libkde4-devel; on Ubuntu and Debian it is called kdelibs5-dev. (TODO: add info for other distributions)<br />
**Calligra should also build fine with either kdelibs from ''git'' repository (see [http://techbase.kde.org/Getting_Started/Build/KDE4 techbase] for an explanation on how to compile kdelibs from svn), needed for parts of Calligra build with the Mobile Frameworks Profile of the KDE platform (kword, kspread, kpresenter, krita)<br />
* kdebase/runtime 4.3 or newer<br />
* cmake 2.6.2 or newer<br />
* lcms 1.18 or newer<br />
* libpng development package (libpng14-devel on opensuse, libpng-dev on Ubuntu/Debian)<br />
** development packages for other libraries may be needed; on ubuntu/Debian these can be installed using 'apt-get build-dep kdelibs5'<br />
<br />
For Tables:<br />
* libeigen 2.0<br />
<br />
For Krita:<br />
* libeigen 2.0<br />
* libexiv2 >= 0.16<br />
* libqimageblitz<br />
<br />
For Stage:<br />
* boost<br />
<br />
For Kexi:<br />
* sqlite3 and sqlite3-devel packages (package names can differ on various distributions), version >= 3.6.16<br />
<br />
== Optional dependencies ==<br />
<br />
All optional dependencies are logged at the end of the cmake run, so it is easy to figure out what is missing. The buildsystem also reports what component will bot be built because given missing dependency.<br />
<br />
== Simplified installation of dependencies on various distributions ==<br />
{{Note|Most distribution don't ship calligra yet, so you may replace it by "koffice" or "koffice2" in those command lines}}<br />
*'''deb-based distributions (Debian, Ubuntu...):''' All the dependencies used for the packages can be installed by running<br />
apt-get build-dep {packagename}<br />
for instance on Ubuntu:<br />
sudo apt-get build-dep calligra<br />
<br />
*'''OpenSuSE:''' All the dependencies used for building Calligra can be installed by running:<br />
zypper si -d calligra<br />
<br />
*'''Fedora:''' All the dependencies used for building Calligra can be installed by running:<br />
yum-builddep calligra<br />
<br />
*'''ArchLinux:''' All the dependencies used for building Calligra can be installed by running:<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-libs docbook-xml docbook-xsl libgsf create-svn</pre><br />
<br />
*'''Chakra:''' All the dependencies used for building Calligra can be installed by running:(need to enable unstable repo)<br />
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word">sudo pacman -S kdelibs kdepimlibs qca lcms2 hicolor-icon-theme sqlite3 gsl glew qimageblitz poppler-qt shared-mime-info openexr libqtgtl libpqxx freetds fftw libspnav automoc4 boost cmake eigen git pkgconfig pstoedit libwpd libwpg kdegraphics-common libgsf docbook-xml docbook-xsl create-svn</pre><br />
<br />
= Build Calligra =<br />
{{Note|It is '''not''' possible to build Calligra in the source directory. Set up your directories as described in the [[#Recommended_setup|Recommended setup]] section above}}<br />
<br />
Type:<br />
mkdir -p $HOME/kde4/build/calligra<br />
mkdir -p $HOME/kde4/inst<br />
cd $HOME/kde4/build/calligra<br />
cmake -DCMAKE_INSTALL_PREFIX=$HOME/kde4/inst $HOME/kde4/src/calligra -DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
<br />
''cmakekde'' tool can be used as explained on [http://techbase.kde.org/Getting_Started/Build/KDE4 the build instructions for KDE4].<br />
<br />
Then type:<br />
make<br />
<br />
Note that on dual-core machines compilation can be '''greatly speed up''' with the -j parameter of the ''make'' program, for example for dual-core:<br />
make -j4<br />
and for quad-core:<br />
make -j8<br />
<br />
Then type this command to install the software:<br />
make install<br />
<br />
'''Debugging options.''' Instead of setting CMAKE_BUILD_TYPE to "RelWithDebInfo" for cmake which gives an optimized Calligra with debug information, useful for bug reporting, one can set CMAKE_BUILD_TYPE to "Debug" to get a slower Calligra but with even more interesting debuggong (backtrace) information. For this replace ''-DCMAKE_BUILD_TYPE=RelWithDebInfo'' in the above cmake command with ''-DCMAKE_BUILD_TYPE=Debug''.<br />
<br />
Please follow the [[Building/Building_Calligra#Running_Calligra_applications|Running Calligra Applications]] instructions before trying to run an application.<br />
<br />
= Updating the already built software =<br />
If the source code has been checked out Subversion from trunk or a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.<br />
<br />
Type:<br />
cd $HOME/kde4/src/calligra<br />
git pull<br />
cd $HOME/kde4/build/calligra<br />
make<br />
make install<br />
<br />
{{Note|''make -j4'' or ''make -j8'' can be used instead of ''make'' to speedup the build on multicore machines}}<br />
<br />
{{Note|The above recipe will not work if the source code has not been obtained from Subversion}}<br />
<br />
= Build only selected applications from Calligra =<br />
CMake comes with a command-line tool ''ccmake'' that lets you configure build options. You can use it after executing cmake and ''before'' executing make. To use it, go to the build directory and issue the following commands:<br />
cd $HOME/kde4/build/calligra<br />
ccmake .<br />
''ccmake'' is a text user interface application. Simple usage: move the selection using up/don arrow keys. Press Enter to set option ON/OFF (for text options, you enter the text). When you're done with setting the options, press c key to configure the source code to apply your changes. When done, press e key to exit. At any time you can press Ctrl+C to stop the application without saving your changes. Any change is saved to $HOME/kde4/build/calligra/CMakeCache.txt file. You can remove this file to get back to the default configuration (in this case you have to re-execute cmake first.<br />
<br />
For applications that you do '''not''' want to compile, set the corresponding BUILD_{application} variable to "off", replacing {application} by the app's name. For instance, setting ''BUILD_krita'' to ''off'' will prevent Krita from being built.<br />
<br />
Alternatively you can run "-DBUILD_{application}=off" from the cmake command line.<br />
<br />
= Running Calligra applications =<br />
There are two options to make the Calligra applications available for running.<br />
<br />
*'''Option 1: Being able to run Calligra applications from the command line.''' If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable: <br />
<br />
export KDEDIRS=/path/to/install:$KDEDIRS<br />
export PATH=/path/to/install/bin:$PATH<br />
export KDEHOME=/path/to/a/config/dir<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
For example for the recommended directory structure:<br />
export KDEDIRS=$HOME/kde4/inst:$KDEDIRS<br />
export PATH=$HOME/kde4/inst/bin:$PATH<br />
export KDEHOME=$HOME/kde4/.kde<br />
<br />
It is important to set KDEHOME to a directory different of $HOME/.kde, and if the directory does not exist, it will be created automatically.<br />
<br />
*'''Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons.''' Instead of using ''KDEDIRS'', you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:<br />
<br />
[Directories]<br />
prefixes=/path/to/install<br />
<br />
And then you need to execute:<br />
kbuildsycoca4<br />
<br />
The advantage of this is that KDE4 will always look for the services where Calligra is installed. <br />
For example for the recommended directory structure:<br />
<br />
[Directories]<br />
prefixes=$HOME/kde4/inst.<br />
<br />
= Executing unit tests =<br />
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:<br />
<br />
cd $HOME/kde4/build/calligra<br />
cmake -DKDE4_BUILD_TESTS=ON .<br />
<br />
Or you can run <code>ccmake .</code> in the buld directory and set KDE4_BUILD_TESTS to "on".<br />
<br />
You can then run the test by executing:<br />
<br />
make test<br />
<br />
or individually in the tests directories.<br />
<br />
It is recommended to execute<br />
<br />
make install<br />
<br />
before running tests.<br />
<br />
= CMake Build Options =<br />
When you enter your build directory, you can type "ccmake ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.<br />
<br />
Here is list for Krita related options:<br />
* HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.<br />
* HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.<br />
<br />
= Resources =<br />
*[[DeveloperInfo|Useful hints for who wants to hack on Calligra]]<br />
*[http://wiki.opengtl.org/libraries:developers-resources opengtl debugging, or turning it off]<br />
*[http://winkde.org/pub/kde/ports/win32/dashboard/ Status of Calligra build on Windows (msvc 2008, mingw)]<br />
<br />
= Possible issues =<br />
<br />
If you get errors when running an application like:<br />
<br />
krita(8565)/calligra (lib komain) KoPluginLoader::load: Loading plugin "Animation Tool" failed, <br />
"Cannot load library /home/michael/kde4/inst/lib/kde4/kpresentertoolanimation.so: <br />
(/home/michael/kde4/inst/lib/libkopageapp.so.7: undefined symbol:<br />
_ZN28KoShapeContainerDefaultModel3addEP7KoShape)" ( 1 ) <br />
<br />
or crashes when starting an application, then you very likely have a version of Calligra installed through your package manager. '''As emphasized earlier in this document, you can only have one version of Calligra, and you should uninstall your packaged Calligra'''.</div>Stuartmdhttps://community.kde.org/index.php?title=Calligra/Meetings/Fall_2011_meeting&diff=15839Calligra/Meetings/Fall 2011 meeting2011-11-07T16:33:05Z<p>Stuartmd: </p>
<hr />
<div>== Calligra Sprint Fall 2011 ==<br />
"Calligra 2.4 Sprint"<br />
<br />
=== When? ===<br />
*11th-13th November 2011<br />
*<strike>[http://www.doodle.com/r5tb9kqaq8be3gnt fill in doodle with available time]</strike><br />
<br />
=== Where? ===<br />
Helsinki, at Nokia.<br />
<br />
*Office:<br />
Nokia<br />
Ruoholahti<br />
Itamerenkatu 11-13<br />
00180 Helsinki, Helsinki, Finland<br />
<br />
When you come to the office please go to the reception and say that you are coming to the Calligra Sprint. There you will get your badge which you will need to wear while you are inside the Nokia office. I will pick you up. You can ask the receptionist to give me a call. Once the reception or the office is closed please give Thorsten or Suresh a call.<br />
<br />
Thorsten Phone +49 151 1483 1665<br />
Shuresh Phone +358 504 837 281<br />
<br />
*Hotel:<br />
Radisson Blu Seaside<br />
Ruoholahdenranta,3<br />
180 Helsinki, Finland<br />
<br />
http://www.radissonblu.com/seasidehotel-helsinki<br />
<br />
*How to get from airport: [http://www.reittiopas.fi/en/?from_in=Airport&from=stop*Helsinki%2FVR%2C+Helsinki*2552450*6673670&via_in=&via=&via_time=0&to_in=Ruoholahti+Chapel%2C+Helsinki&to=poi*Ruoholahti+Chapel%2C+Helsinki*2550944*6672723&hour=16&minute=00&timetype=departure&day=11&month=11&year=2011&cmargin=3&wspeed=70&method=1&stz=0&mc1=0&mc2=0&mc3=0&mc4=0&mc5=0&mc6=0&mc0=0&nroutes=3 link]<br />
<br />
*How to get from hotel to Office:<br />
The Office is only 5 minutes away from the hotel.<br />
http://g.co/maps/g89bp<br />
<br />
*Weather in Helsinki: [http://en.ilmatieteenlaitos.fi/local-weather]<br />
<br />
=== Attendees ===<br />
*See https://sprints.kde.org/sprint/43<br />
*Who needs a visum?<br />
<br />
<br />
Please try and add yourself in order of arrival (note the date)<br />
<br />
<br />
{| border="1"<br />
! Name || Arrives || Leaves<br />
|-<br />
|Thorsten|| Airport 10.11. 15:45 || Airport 13.11. 17:00<br />
|-<br />
|Boud|| Airport 11.11. 13:05 || Airport 13.11. 18:00 <br />
|-<br />
|Brijesh|| Airport 11.11. 14:50 || Airport 14.11. 20:00 <br />
|-<br />
|Smit|| Airport 11.11. 14:50 || Airport 14.11. 20:00<br />
|-<br />
|Leinir|| Airport 11.11. 16:20 (BA0794) || Airport 13.11. 17:10<br />
|-<br />
|Stuartmd|| Airport 11.11. 16:20 (BA0794) || Airport 13.11. 17:10<br />
|-<br />
|Boemann|| Airport 11.11. 17:40 (SK712) || Airport 13.11. 18:20<br />
|-<br />
|Pinaraf|| Airport 11.11. 19:20 (AF1098) || Airport 13.11. 16:05<br />
|-<br />
| || ||<br />
|}<br />
<br />
=== Links ===<br />
*[http://events.linkedin.com/Calligra-Sprint-2011-II/pub/817995 LinkedIn Event for the Sprint - click "Attending" button if you attend]<br />
*Programme: please fill the [[/Ideas|ideas page]].<br />
*Meeting [[/Minutes/]]</div>Stuartmd