CMake project manager compilation issues with MinGW and Windows XP compatibility

Cordylus Interneter cordylus at zoho.com
Tue Nov 15 12:14:27 UTC 2016


 ---- On Tue, 15 Nov 2016 10:52:24 +0200 Kevin Funk <kfunk at kde.org> wrote ---- 
 > On Sunday, 13 November 2016 23:42:42 CET Cordylus Interneter wrote: 
 > > Hello, I've built KDevelop on Windows XP using MinGW (natively, without 
 > > MSYS). Should I post step-by-step guide on how it was done - where did i 
 > > download suitable precompiled and source dependencies, how and in what 
 > > order everything was compiled?  
 >  
 > By the way, I wouldn't mind if you could still send your detailed instructions  
 > if you have them. 
 >  
 > I'm especially interested in: 
 > - Did you compile Qt yourself? 
 >   - If yes, how did you compile OpenSSL & ICU? 
 > /me is just re-building his Qt/KF5 + deps from scratch, targeting WinXP 64  
 > bit. 
 >  
 > Cheers, 
 > Kevin 
 >  
 > > I still have some troubles setting up 
 > > environment, but the exe works fine, so you should definitely switch your 
 > > Platform Toolset to XP-compatible one. As for dependencies compatibility, 
 > > the only problem I had with Frameworks was the support for 
 > > CreateSymbolicLinkW in KIO, but that can be easily commented out and 
 > > recompiled separately. 
 > >  
 > > KDevelop itself compiled without issues, except for CMake project manager. 
 > > Here are the fixes that had to be done in it, I expect them to be taken 
 > > upstream: 
 > >  
 > > 1. in projectmanagers/cmake/parser/cmListFileLexer.c and 
 > > cmListFileLexer.in.l - #ifdef WIN32 
 > > + #ifdef _WIN32 
 > > + #include <io.h> 
 > > why: as for the missing underscore, I'm not sure how it slipped in and 
 > > compiled at all, and the include is needed for isatty function declaration. 
 > >  
 > > 2. in projectmanagers/cmake/parser/EncodingC.c 
 > > - //#include "kwsysPrivate.h" 
 > > + /* #include "kwsysPrivate.h" */ 
 > > - //#include KWSYS_HEADER(Encoding.h) 
 > > + /* #include KWSYS_HEADER(Encoding.h) */ 
 > > why: since C sources are compiled in std mode, C++ comments do not work. 
 >  
 >  
 > --  
 > Kevin Funk | kfunk at kde.org | http://kfunk.org

No, I did not compile Qt, I used the installer qt-opensource-windows-x86-mingw492-5.5.1.exe, so I don't need to build Qt and QtWebKit. But then there is the bug in Qt with kioslave console window that you are aware of, as I see in the archives.

Why do you target 64 bit? It's rarely used, most XP users are 32-bit.

Here are all the build instructions:

Directory structure: extracting all sources to one directory, building in the KF5 subdirectory, where also goes everything from the precompiled dependencies.

Non-CMake dependencies:

precompiled gettext (for i18n):
https://mlocati.github.io/articles/gettext-iconv-windows.html
copy bin/ to KF5/bin/, use the static version or delete libstdc++-6.dll after copying dynamic version, else you'll get conflicts later

precompiled libintl (for i18n):
http://gnuwin32.sourceforge.net/downlinks/libintl-bin-zip.php
copy bin/
http://gnuwin32.sourceforge.net/downlinks/libintl-dep-zip.php
copy bin/
http://gnuwin32.sourceforge.net/downlinks/libintl-lib-zip.php
copy include/ and lib/

sources of libxml2 (for kdoctools):
http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz
cd libxml2-2.9.4\win32 && cscript.exe configure.js compiler=mingw prefix=..\..\KF5 ftp=no http=no iconv=no && mingw32-make install-libs && cd ..\.. && move KF5\include\libxml2\libxml KF5\include

sources of libxslt (for kdoctools):
http://xmlsoft.org/sources/libxslt-1.1.29.tar.gz
requires fix (bug reported): add quotes in win32\Makefile.mingw to install-libs target around the commands after cmd.exe /C (see win32\Makefile.mingw in libxml2 for correct example)
cd libxslt-1.1.29\win32 && cscript.exe configure.js compiler=mingw prefix=..\..\KF5 && mingw32-make install-libs && cd ..\.. && move KF5\lib\libexslt.dll KF5\bin && move KF5\lib\libxslt.dll KF5\bin

extract docbook-xml (for kdoctools)
http://docbook.org/xml/4.5/docbook-xml-4.5.zip
extract to: bin/data/xml/docbook/4.5

extract docbook-xsl (for kdoctools)
https://sourceforge.net/projects/docbook/files/docbook-xsl/1.79.1/docbook-xsl-1.79.1.zip/download
extract to: bin/data/xml/docbook/xsl-stylesheets

binary flex and bison (for kdoctools)
http://downloads.sourceforge.net/project/winflexbison/win_flex_bison-2.5.6.zip
win_flex.exe to bin/flex.exe
win_bison.exe to bin/bison.exe
data/ to bin/data/

alternative flex and bison:
http://repo.msys2.org/msys/i686/flex-2.6.1-1-i686.pkg.tar.xz
usr/bin/ to bin/
http://repo.msys2.org/msys/i686/bison-3.0.4-1-i686.pkg.tar.xz
usr/bin/ to bin/
usr/share/bison to bin/data/bison

precompiled boost (for kdevplatform)
http://repo.msys2.org/mingw/i686/mingw-w64-i686-boost-1.62.0-1-any.pkg.tar.xz

binary zip (for kdevplatform)
https://sourceforge.net/projects/gnuwin32/files/zip/3.0/zip-3.0-bin.zip/download
bin/zip.exe
https://sourceforge.net/projects/gnuwin32/files/zip/3.0/zip-3.0-dep.zip/download
bin/bzip2.dll

precompiled shared-mime-info (for kdevelop)
http://download.kde.org/stable/4.10.2/win32/shared-mime-info-x86-mingw4-0.71-bin.tar.bz2
bin/, share/
copy KF5\bin\libintl-8.dll KF5\bin\libintl.dll

unofficial LLVM build with llvm-config (for kdevelop)
https://sourceforge.net/projects/clangonwin/files/MingwBuild/3.6/LLVM-3.6.0svn-r218657-win32.exe/download
add it to PATH

binary png2ico (for kdevelop)
http://www.winterdrache.de/freeware/png2ico/data/png2ico-win-2002-12-08.zip
png2ico/png2ico.exe to bin/

CMake-able dependencies:

http://zlib.net/zlib-1.2.8.tar.xz
http://download.kde.org/stable/frameworks/5.27/extra-cmake-modules-5.27.0.tar.xz
http://download.kde.org/stable/phonon/4.9.0/phonon-4.9.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/attica-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kitemmodels-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kitemviews-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/threadweaver-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kcodecs-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kguiaddons-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kwidgetsaddons-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/sonnet-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kconfig-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kwindowsystem-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/solid-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kglobalaccel-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/karchive-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kdbusaddons-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kcoreaddons-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kauth-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kcrash-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kjobwidgets-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kcompletion-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/ki18n-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kdoctools-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kconfigwidgets-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kservice-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kiconthemes-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/knotifications-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/ktextwidgets-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kxmlgui-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kbookmarks-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kio-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/knewstuff-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kparts-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kpackage-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kdeclarative-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/kcmutils-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/knotifyconfig-5.27.0.tar.xz
http://download.kde.org/stable/frameworks/5.27/ktexteditor-5.27.0.tar.xz
http://download.kde.org/stable/applications/16.08.2/src/libkomparediff2-16.08.2.tar.xz
https://github.com/steveire/grantlee/archive/v5.1.0.tar.gz
http://download.kde.org/stable/kdevelop/5.0.2/src/kdevplatform-5.0.2.tar.xz
http://download.kde.org/stable/kdevelop/5.0.2/src/kdevelop-5.0.2.tar.xz

They were compiled in the listed order using the following pattern:
cd zlib-1.2.8 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd ..

Special CMake keys for some packages were:
-DPHONON_BUILD_PHONON4QT5=ON for phonon-4.9.0
-DCMAKE_CXX_FLAGS="-DLIBXML_STATIC=1" for kdoctools-5.27.0 (had undefined reference to `_imp__xmlFree' otherwise)
-DBUILD_TESTING=0 for kservice-5.27.0 (it failed to compile some test)

I also had to add KF5\bin to PATH, since some packages required binaries from previous packages during build.

So here's the full command to build everything CMake-able (after extracting all the downloaded archives):

set PATH=%PATH%;%CD%\KF5\bin
cd zlib-1.2.8 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd extra-cmake-modules-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd phonon-4.9.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . -DPHONON_BUILD_PHONON4QT5=ON && mingw32-make && mingw32-make install && cd .. && ^
cd attica-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kitemmodels-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kitemviews-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd threadweaver-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kcodecs-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kguiaddons-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kwidgetsaddons-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd sonnet-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kconfig-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kwindowsystem-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd solid-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kglobalaccel-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd karchive-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kdbusaddons-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kcoreaddons-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kauth-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kcrash-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kjobwidgets-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kcompletion-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd ki18n-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kdoctools-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . -DCMAKE_CXX_FLAGS="-DLIBXML_STATIC=1" && mingw32-make && mingw32-make install && cd .. && ^
cd kconfigwidgets-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kservice-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . -DBUILD_TESTING=0 && mingw32-make && mingw32-make install && cd .. && ^
cd kiconthemes-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd knotifications-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd ktextwidgets-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kxmlgui-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kbookmarks-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kio-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd knewstuff-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kparts-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kpackage-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kdeclarative-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kcmutils-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd knotifyconfig-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd ktexteditor-5.27.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd libkomparediff2-16.08.2 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd grantlee-5.1.0 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kdevplatform-5.0.2 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
cd kdevelop-5.0.2 && cmake -DCMAKE_INSTALL_PREFIX=..\KF5 -DCMAKE_PREFIX_PATH=..\KF5 -G "MinGW Makefiles" . && mingw32-make && mingw32-make install && cd .. && ^
echo "fin"



More information about the KDevelop-devel mailing list