1 *** This article still not correct from auto-translated by GOOGLE-TRANSLATE.
2 *** If you can tranlate Japanese to any languages, please
3 *** Translate this, publish and pull request to my GITHUB.
5 Common Source Code Project for Qt: How to Build
7 <Whatisthis.sowhat_at_gmail.com>
10 Common Source Code Project the (CSP) in terms of porting to Qt, the build.
11 There is a voice that does not know well when using the method - especially MinGW to or
12 so it was, we wrote a little.
15 • The Windows of the person, MinGW is required ... is, open-source version of Qt
16 The installer [1] (in the case of Qt5.5.1 GCC4.9.2, you can use later versions)
17 MinGW comes with, but, half-hearted.
18 · GCC (may not be good Qt and compatibility that it LLVM CLANG)
19 · Qt5.1 or more, of course also the development files such as header.
20 · OpenGL 2.1 or more to build and to work. With the software renderer in
21 Windows for Qt You've had.
22 · CMake [2] 2.8 or more
24 ・if possible, it can be slightly faster and use the CCACHE [4]
25 · Git [5] is, child download the source code from the repository [6] you bet you can.
26 · emufm7 part of the code of the source code in the gawk to generate some C++ source code from text file.
27 However, the .cpp file after generation to the source tree from that text, it contains.
29 [1] Windows for in http://www.qt.io/download-open-source/ of (32 / 64bit)
30 Please try using the installer
32 [3] http://libsdl.org/
33 [4] https://ccache.samba.org/
34 [5] https://git-scm.com/
35 [6] https://github.com/Artanejp/common_source_project-fm7
36 https://www.pikacode.com/Artanejp/common_source_project-fm7/
38 These things, GNU / Linux if such and MinGW, package management software
39 In will be put in the majority.
43 The source tree allowed to expand to ${SRCDIR},
44 $ cd ${SRCDIR}/source/build-cmake/{VM name}/
51 [7] In fact, it is convenient setting is better to use the ccmake of CursesGUI version of CMake.
54 It is basically the same, and use the windeployqt.exe of Qt, the necessary Qt La
55 For us to copy the library.
56 However, DLL of libstdc associated with libSDL2 and OpenGL relationship is to manually copy
58 Since there is no CMake is the official MinGW, please download from [8].
61 mingw32-gcc and mingw32-g ++ and mingw32-binutils,
62 mingw-developer-toolkit and mingw32-pthreds-w32
63 Please install the sure.
65 To register the shortcut of b.MSYS Bash, for example, on your desktop and menu
66 Let's place. If the default installation location,
67 Is C:\MinGW\msys\1.0\msys.bat.
69 c. Install the Qt to C:\Qt.
70 Start the installer you downloaded from [1], the mingw toolchain
71 Install in, including form.
74 Whether to include the CMake the path? Come ask the installer and
77 e. If Necessary, install the Git.
79 f. To edit the C:.\MinGW\msys\1.0\home\{username}\.profile.
80 At this time, since performed in Notepad problem comes out, use the vim.
83 Please to add the following line.
84 export PATH =/c/MinGw/bin:$PATH:/c/Qt/Qt5.5.1/5.5/mingw492_32/bin
85 When you are finished, in the [ESC] → ZZ command, it writes.
87 g.Install SDL2. (Reference: [9])
88 Download SDL2 have been "Windows Development MinGW" tarball of
89 The expand and install.
90 $ tar xf SDL2-devel-2.0.4-mingw.tar.gz
92 $ mingw32-make install-package arch=i686-w64-mingw32 prefix=/c/mingw
94 h. When you come up to this point, to start the MSYS BASH again.
95 And, of release page in the source and github that have been taken in the git clone
96 Expand the source code. Here, describing the full path to the ${SRCDIR} to do.
100 $ cd source/build-cmake/${VM name}
103 $ cmake .. -G "MinGW Makefiles" ※[10]
106 ※ Notes: Windwos on (the native) in MinGW, rather than make, mingw32-make
107 Use and the like. I have a Windows side is make, yet this is the unix format
108 Since it is a villainy specification that not me seriously interpret the Makefile ...
110 j. cormorant or Ku be or prayer a call that came in buildings de
112 k. When you build, the directory to the emu${VM name}.exe for moving
115 l. on which has moved to copy the previous directory I,
116 $ windeployqt.exe --release emu${VM name}.exe
117 If you, copy the necessary Qt libraries in release mode Shiteku
118 Are you, but the copy manually, such as libSDL2 and libpthread and libgcc_s
119 If that does not, can not be started from the Windows Explorer (;´Д`)
120 In addition, it specifies the Debug and Relwithdebinfo to build the type of CMake
122 $ windeployqt.exe --debug emu${VM name}.exe
124 Then, the following file C:\Qt\Qt5.5.1\mingw492_32\bin (such as)
125 Or, or from C:\MinGW\bin, and copy it to the directory where you placed the exe.
132 On top of that, SDL2.dll (C: should located in the \MinGW\bin) is also, in this directory
135 [8] http://cmake.org/download/
136 [9] https://gist.github.com/Hamayama/155b5557db31334ce492
137 [10] In fact, once after you move the CMake, a fine setting to start the cmake-gui better to is better.
139 3-3. Cross build (do the build for Windows in such as GNU / Linux)
140 Here, in the GNU / Linux host, how to cross build the CSP for Windows
141 You have a brief description.
142 Become an aid for the ARM build and other OS Builds for Android, etc. for
145 a. installation of cross compiler
146 In most cases, because there is a cross-GCC Toolchain for MinGW, it install.
148 b. Installation of Wine
149 Because such as moc there is a need to use for Windows, install the Wine want it.
150 On top of that, so that you can start a file of exe extension via Wine
151 there to support scripts such as binfmt-support, set in the update-binfmts. [11]
152 $ sudo update-binfmts --install Win32Exec /usr/bin/wine --magic "MZ"
153 I think that it was good at (I'm sorry in faint memory)
155 [11] http://d.hatena.ne.jp/kakurasan/20110909/p1 such as the reference.
158 Installation of From the URL of the [1], download the installer for Windows.
160 $ sudo wine ./qt-opensource-foo.exe will do.
161 Then because Qt installer screen comes out, please specify to the installation.
162 Z:\usr\local\i586-mingw-msvc
164 $sudo chmod ugo+x /usr/local/i586-mingw-msvc/5.5/mingw492_32/bin/*.exe
165 As such, let's be able to start the tool for Windows Qt directly attached.
168 libSDL2 also, and you should install the ones for Windows.
169 From [3], download for Windows SDL2 (for Development),
170 /usr/local/i586-mingw-msvc/
171 Let's expand to around.
174 Although we use the ToolChain function of CMake, so many things setting is confusing,
175 Already Yes available are those described.
176 $ {SRCDIR}/source/build-cmake/cmake/toolchain_mingw_cross_linux.cmake
177 Messing with description of this file,
178 $ cd ${SRCDIR}/source/build-cmake/{VM name}/
181 $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain_mingw_cross_linux.cmake
183 In it you should be okay.
185 3-3. Trying to easier way
186 In the description up to this point, we have to build the manual in a virtual machine basis.
187 However, although the once could under preparation, is every time awkward every time.
188 Therefore, a batch file (Bash script) are available.
189 · ${SRCDIR}/source/build-cmake/config_build.sh
191 · ${SRCDIR}/source/build-cmake/config_build_cross_win32.sh
192 : To build a file for MinGW32 (Windows) on GNU / Linux script
193 · ${SRCDIR}/source/build-cmake/config_build_mingw.sh
194 : Script to build a file for MinGW with MinGW on Windows
196 config_build.sh will continue to write the settings to a file called buildvars.dat.
197 config_build_mingw.sh is, the settings to a file called buildvars_mingw.dat
198 I will continue to write.
201 $ ./${Script name} ${VM name 1} ${VM name 2} ... ${VM name n}
203 This script works in full automatic :
204 Generate the Makefiles from CMake → make → install → make clean
205 For make results, ${VM name}/build/make.log (MinGW for cross build
206 has been recorded in the {VM name}/build-win32/build.log).
208 For Windows-friendly build, ${SRCDIR}/source/build-cmake/bin-win32/
209 copy the resulting binary in, and clean the build working directory.
211 For batch build, and use the Midnight Commander (mc) to easier to works.
212 For more information, the https://www.midnight-commander.org/.
213 Windows of unofficial build, https: to //sourceforge.net/projects/mcwin32/
214 Equipped therefore, let's install using the installer.