This document gives some hints on how to compile Workrave on Windows
using Microsoft Visual Studio (2008 Express Edition).
Please use autoconf to build Workrave on Unix systems.

The minimal requirement is gtkmm, Directx SDK and cmake.

Only networking is currently not easy to build on Windows.


Install Gtkmm (required)
========================

- Download and install gtkmm:

  File: ftp://ftp.gnome.org/pub/GNOME/binaries/win32/gtkmm/2.22/gtkmm-win32-devel-2.22.0-2.exe

  More recent versions of gtkmm are currently not supported.
  
Install DirectX SDK (required)
==============================

- Download and install DirectX 9 SDK:

  Site: http://msdn.microsoft.com/en-us/directx/default.aspx
  -or-
  Site: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812

Install CMake 2.8 (required)
============================

- Download and install cmake:

  Website: http://www.cmake.org
  
  File: http://www.cmake.org/files/v2.8/cmake-2.8.5-win32-x86.exe
  
Install Intltool (recommended, needed for exercises)
====================================================

- Download and Install Strawberry Perl
  ActiveState may also work (untested)

  Website: http://strawberryperl.com/
  
  File: http://strawberry-perl.googlecode.com/files/strawberry-perl-5.12.3.0.msi
  
- Download and extract intltool

  File: http://ftp.gnome.org/pub/gnome/binaries/win32/intltool/0.40/intltool_0.40.4-1_win32.zip

  Extract to <PATH-TO-DEPEDENCIES>.

  
Install Gettext (recommended, needed for localization and exercises)
====================================================================

- Download and extract Gettext

  File: http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/gettext-tools-dev_0.18.1.1-2_win32.zip
  File: http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
  File: http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/gettext-runtime-dev_0.18.1.1-2_win32.zip
  
  Note: You may run into problems (access denied and such) if you
  extract the files with unzip from cygwin; use Windows built-in zip
  support.

  
Install Python/Cheetah (optional/experimental, needed for dbus)
===============================================================

- Download and Install Python 2.6.x or 2.7

  Website: http://www.python.org/download/

  File: http://www.python.org/ftp/python/2.7.2/python-2.7.2.msi
  File: http://www.python.org/ftp/python/2.7.2/python-2.7.2.amd64.msi
  You may need to append Python to your PATH environment variable manually, eg C:\Python27
  
- Download and install setuptools

  Website: http://pypi.python.org/pypi/setuptools
  File:  http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
  
  - Extract setuptools-0.6c11.tar.gz to directory outside the Windows Python installation directory
  - Open Command Prompt windows and go to the directory where you extracted setuptools.
  - Make sure C:\Python27 [replace with python installation directory] is in your PATH
  - Run 'python setup.py install' 
  
- Install Cheetah

  - Open a Command Prompt (Use Run as Administrator on Vista+)
  - cd C:\Python27\Scripts [replace python installation directory]
  - Run 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat'
    [use vcvars64.bat if 64 bit Python is installed]
  - Run 'easy_install-2.7-script.py Cheetah'

Install DBus (optional/experimental, needed for dbus)
=====================================================

- Download, compile and install DBUS:

  - git clone git://anongit.freedesktop.org/git/dbus/dbus
  - mkdir dbus-build
  - cd dbus-build
  - Run cmake
  
    cmake -G "Visual Studio 10" ../dbus/cmake/ -DCMAKE_PREFIX_PATH="<PATH-TO-DEPEDENCIES>;<PATH-TO-GTKMM>"
          -DCMAKE_INSTALL_PREFIX=<PATH-TO-DEPEDENCIES>  -DDBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=autolaunch:scope=install-path 

    e.g.
    
    cmake -G "Visual Studio 10" ../dbus/cmake/ -DCMAKE_PREFIX_PATH="c:/mystuff/devel;C:/Program Files (x86)/gtkmm"
          -DCMAKE_INSTALL_PREFIX=c:/mystuff/devel -DDBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=autolaunch:scope=install-path 

  - Open dbus solution in visual studio (located in dbus-build directory)
  - Select Release configuration
  - From Build menu, choose rebuild solution
  - Right click on INSTALL project, choose build
  - Select Debug configuration
  - From Build menu, choose rebuild solution
  - Right click on INSTALL project, choose build
  
Compiling Workrave
==================

 - Download workrave
 
 - mkdir workrave-build
 - cd workrave-build

 - cmake -G "Visual Studio 10" <PATH-TO-WORKRAVE-SOURCES>/build/cmake/
                 -DDEVELOPMENT_MODE=ON 
                 -DCMAKE_PREFIX_PATH="PATH-TO-DEPEDENCIES/bin" -DCMAKE_INSTALL_PREFIX="<INSTALL-DIRECTORY>

    Note: PATH-TO-DEPEDENCIES should contains all dependencies: gettext, dbus, intltool etc.

    eg. cmake -G "Visual Studio 10" ../workrave/build/cmake/ -DDEVELOPMENT_MODE=ON
              -DCMAKE_PREFIX_PATH=c:/mystuff/devel/bin -DCMAKE_INSTALL_PREFIX=c:/mystuff/programs/workrave

  - Open Workrave solution in visual studio (location in workrave-build directory)
  - Build [1]

  [1] If this is your first time adding the dependencies listed in this file you may not be able to achieve 
  a successful build without first rebooting.
  
