For creating the file "webodf.js" out of the sources CMake and Java needs to be installed.
Another optional, but recommended requirement are the Qt5 libs, which are used to create and run tests.
Further requirements, like the [Closure Compiler][], will be conveniently downloaded automatically during the build, as usually the latest version will be used, which might not yet be available as a package. So during (first) build also a connection to the internet will be needed. Downloaded requirements will be cached in the build directory. [Closure Compiler]: https://developers.google.com/closure/compiler/
With the requirements installed, either download the zip file from https://github.com/kogmbh/WebODF/archive/master.zip and unzip it
wget https://github.com/kogmbh/WebODF/archive/master.zip
unzip master.zip
mv WebODF-master webodf
or get the complete repo with git:
git clone https://github.com/kogmbh/WebODF.git webodf
For building now in the same directory where either of above commands were done the following commands should be entered:
mkdir build
cd build
cmake ../webodf
make webodf.js-target
A successful run will yield the file "webodf.js" in the subfolder "build/webodf/" (among other things), from where you can then copy it and use for your website.
The following steps have been tested with the Microsoft C\C++ compilers that are installed with Visual Studio 2010. It may be possible to use MinGW but it has not been verified.
- Visual Studio 2010 (or Visual Studio 2010 Express works as well)
- Visual Studio 2010 Service Pack 1
- Qt 5.2.1 x86 installer for Visual Studio 2010
- CMake 2.8.12.2 x86
- Java Runtime 1.7 (or more recent)
- Git for Windows
We only need the C\C++ compilers but it is easier to get this by installing Visual Studio 2010. It can also be obtained from the Windows 7 SDK but I would recommend the above. To avoid issues with CMake, Visual Studio 2010 Service Pack 1 also needs to be downloaded and installed.
Git itself isn't strictly necessary, but some Unix programs like cat are used during the build. As you will generally need git to download the source, this is easiest way to get the msys utilities.
Add the following directories to the PATH variable
- CMake path e.g
C:\Program Files (x86)\CMake 2.8\bin
- QMake path e.g
C:\QtSDK\bin
- Unix tools path e.g
C:\Program Files (x86)\Git\bin
(Git installer will add this automatically if you select the add Unix tools to PATH option during install)
These commands should be entered from the Visual Studio 2010 command prompt so that msbuild will be added to the PATH
git clone https://github.com/kogmbh/WebODF.git webodf
md build
cd build
cmake -G "Visual Studio 10" ..\webodf
msbuild WebODF.sln
Qt5 can be installed via homebrew, but will not be linked by default. CMake must be instructed where to find this package by specifying the Qt5 location in CMAKE_PATH_PREFIX environment variable:
cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.2.1 ../webodf