Contents |
This page gives instructions on how to build a KDE based application on Windows. It is mostly targeted at developers / power users of KDE applications which are not regularly included in the KDE on Windows installer. This typically applies to third-party applications, but may be of interest to developers of applications inside the KDE software collection / repository as well.
Note however that in many cases using emerge may be a better alternative, esp. if you want to compile your application against the most recent development version of KDE.
Well give the procedure in the form of a .bat file, below. Run this from your source folder.
REM modify these lines to match according to your installation:
SET KDEPREFIX=C:\KDE
SET MINGWPREFIX=C:\mingw
SET PERLPREFIX=C:\Perl
REM you may want to add some cmake flags: SET ADD_CMAKE_FLAGS=-DCMAKE_BUILD_TYPE=Release REM this addition appears to be needed for KDE 4.4.x with MinGW 4.5.x: SET ADD_CMAKE_FLAGS=%ADD_CMAKE_FLAGS% -DCMAKE_EXE_LINKER_FLAGS="--static-libc++ --static-libcc"
REM -------------------------------------------- REM everything below should not need customizing REM --------------------------------------------
REM add required entries to the search path. REM NOTE: some entries may already be present, but this will do no harm. SET PATH=%MINGWPREFIX%\bin;%KDEPREFIX%\bin;%KDEPREFIX%\lib;%PERLPREFIX%\bin;%PATH%
REM we build in a subdirectory "build" of the sources. SET SOURCE_DIR=%~dp0 cd %~dp0 mkdir build cd build
cmake %SOURCE_DIR% -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=%KDEPREFIX% %ADD_CMAKE_FLAGS% mingw32-make install
REM to install to a different path (e.g. for packaging) use REM mingw32-make install DESTDIR=Some\Other\Folder
So you got it to work? Great! Then probably your next concern is how to distribute the binaries you just compiled. See Projects/KDE_on_Windows/Packaging for that.