Krita/30Winbuild

From KDE Community Wiki

Building Krita 3.0 on Windows without emerge

Prerequisites:

  • Visual Studio 2015 community edition
  • Git
  • CMake

Build tree layout:

  • c:\dev\i : install direcetory
  • c:\dev\b : build directory for dependencies
  • c:\dev\p : build directory for krita
  • c:\dev\s : location of the build scripts
  • c:\dev\d : location where dependencies are downloaded to

Create a file called env.bat with the following contents: set DOWNLOAD_DIR=/dev/d set INSTALL_DIR=/dev/i set Path=%PATH%;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\CMake\bin;C:\Program Files (x86)\Vim\vim73;\dev\i\bin;\dev\i\lib

Steps:

  • run env.bat

in c:\dev\s, run this git command

git clone git://anongit.kde.org/scratch/rempt/kritadeposx.git

in c:\dev\b, run this cmake command:

cmake ..\s\kritadeposx -DBOOST_LIBRARYDIR=/dev/i/lib -DEXTERNALS_DOWNLOAD_DIR=/dev/d -DINSTALL_ROOT=/dev/i -DWIN64_BUILD=TRUE -G "Visual Studio 14 Win64" -DCMAKE_BUILD_TYPE=Release

(Use debug when doing a debug build)

Get:

http://www.valdyas.org/~boud/kritadeps/gettext-tools-0.18.1.1_1-bin.tar.bz2 http://www.valdyas.org/~boud/kritadeps/png2ico-win-2002-12-08.zip

And unpack in c:\i (make sure png2ico.exe is in c:\i\bin

In c:\dev\b, run:

cmake --build . --config Release --target ext_zlib

Then copy zlib.lib to zdll.lib (otherwise Qt cannot find it).

Then try to build all the depdencies:

cmake --build . --config Release --target ext_kwindowsystem

This will likely fail a couple of times and you need to intelligently hack around problems. When all the dependencies are built, fix up the result:

  • rename the boost libraries from boost_system-vc-mt-1_55.* to boost_system-vc140-mt-1_55.*
  • edit C:\dev2\i\lib\cmake\KF5I18n\KF5I18NMacros.cmake to remove the REQUIRED string in the line where the python interpreter is looked for

Then go to c:\dev2\p and clone krita:

git clone git://anongit.kde.org/krita.git

Then go to c:\dev2\p\build and run the following cmake command:

cmake ..\krita -G"Visual Studio 14 Win64" -DBoost_DEBUG=OFF -DBOOST_INCLUDEDIR=c:\dev2\i\include -DBOOST_DEBUG=ON -DBOOST_ROOT=c:\dev2\i -DBOOST_LIBRARYDIR=c:\dev2\i\lib -DCMAKE_INSTALL_PREFIX=c:\dev2\i -DCMAKE_PREFIX_PATH=c:\dev2\i -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DHAVE_MEMORY_LEAK_TRACKER=OFF -DPACKAGERS_BUILD=ON -Wno-dev

And on success build Krita with cmake --build . --target INSTALL --config Release