You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BUILDING.txt 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. *******************************************************************************
  2. ** Building TigerVNC
  3. *******************************************************************************
  4. ================================
  5. Build Requirements (All Systems)
  6. ================================
  7. -- CMake (http://www.cmake.org) v2.8 or later
  8. -- If building TLS support:
  9. * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
  10. -- If building native language support (NLS):
  11. * Gnu gettext 0.14.4 or later
  12. * See "Building Native Language Support" below.
  13. -- libjpeg-turbo SDK
  14. * If your system does not include libjpeg-turbo, then you can download the
  15. SDK from http://sourceforge.net/projects/libjpeg-turbo/files/
  16. * See "Building High-Performance JPEG Support" below.
  17. =========================
  18. Build Requirements (Unix)
  19. =========================
  20. -- Non-Mac platforms:
  21. * X11 development kit
  22. -- If building Xvnc:
  23. * autoconf 2.57 or later
  24. * automake 1.7 or later
  25. * libtool 1.4 or later
  26. * OpenSSL v0.9.7 or later
  27. * Python v2.3 or later
  28. * zlib v1.2 or later
  29. * pkgconfig 0.20 or later
  30. If you are using an older RPM-based system which does not meet this
  31. minimum requirement (such as Red Hat Enterprise Linux 4), then you can
  32. build pkgconfig 0.20 from the Fedora 5 source RPM:
  33. http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/pkgconfig-0.20-2.2.1.src.rpm
  34. * gettext 0.14.4 or later
  35. If you are using an older RPM-based system which does not meet this
  36. minimum requirement (such as Red Hat Enterprise Linux 4), then you can
  37. build gettext 0.14.5 from the Fedora 5 source RPM:
  38. http://archive.fedoraproject.org/pub/archive/fedora/linux/core/5/source/SRPMS/gettext-0.14.5-3.src.rpm
  39. NOTE: gcj and libgcj are required when building the above source RPM.
  40. ============================
  41. Build Requirements (Windows)
  42. ============================
  43. -- MinGW or MinGW-w64
  44. -- Inno Setup (needed to build the TigerVNC installer)
  45. Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
  46. You also need the Inno Setup Preprocessor, which is available in the
  47. Inno Setup QuickStart Pack.
  48. Add the directory containing iscc.exe (for instance,
  49. C:\Program Files\Inno Setup 5) to the system or user PATH environment
  50. variable prior to building TigerVNC.
  51. =========================
  52. Build Requirements (Java)
  53. =========================
  54. -- Sun/Oracle JDK v5 or later or OpenJDK
  55. -- See "Building Java Support" below.
  56. ==================
  57. Out-of-Tree Builds
  58. ==================
  59. Binary objects, libraries, and executables are generated in the same directory
  60. from which cmake was executed (the "binary directory"), and this directory need
  61. not necessarily be the same as the TigerVNC source directory. You can create
  62. multiple independent binary directories, in which different versions of
  63. TigerVNC can be built from the same source tree using different compilers or
  64. settings. In the sections below, {build_directory} refers to the binary
  65. directory, whereas {source_directory} refers to the TigerVNC source directory.
  66. For in-tree builds, these directories are the same.
  67. =================
  68. Building TigerVNC
  69. =================
  70. Building the TigerVNC Viewer on Unix/Mac Systems
  71. ------------------------------------------------
  72. The following procedure will build the TigerVNC Viewer on Linux and Unix
  73. systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See
  74. "Build Recipes" for specific build instructions for building a 32-bit version
  75. of TigerVNC on 64-bit systems.
  76. cd {build_directory}
  77. cmake -G "Unix Makefiles" [additional CMake flags] {source_directory}
  78. make
  79. Building the TigerVNC Server on Modern Unix/Linux Systems
  80. ---------------------------------------------------------
  81. Building the TigerVNC Server (Xvnc) is a bit trickier. On newer systems
  82. containing Xorg 7.4 or later (such as Fedora), Xvnc is typically built to use
  83. the X11 shared libraries provided with the system. The procedure for this is
  84. system-specific, since it requires specifying such things as font directories,
  85. but the general outline is as follows (this procedure assumes that the viewer
  86. has already been built, per above.)
  87. > cd {build_directory}
  88. If performing an out-of-tree build:
  89. > mkdir unix
  90. > cp -R {source_directory}/unix/xserver unix/
  91. > cp -R {xorg_source}/* unix/xserver/
  92. (NOTE: {xorg_source} is the directory containing the Xorg source for the
  93. machine on which you are building TigerVNC. The most recent versions of
  94. Red Hat/CentOS/Fedora, for instance, provide an RPM called
  95. "xorg-x11-server-source", which installs the Xorg source under
  96. /usr/share/xorg-x11-server-source.)
  97. > cd unix/xserver/
  98. > patch -p1 < {source_directory}/unix/xserver{version}.patch
  99. (where {version} matches the X server version you are building, such as
  100. "17" for version 1.7.x.)
  101. > autoreconf -fiv
  102. > ./configure --with-pic --without-dtrace --disable-static --disable-dri \
  103. --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
  104. --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
  105. --disable-config-dbus --disable-config-hal --disable-config-udev \
  106. --disable-dri2 --enable-install-libxf86config --enable-glx \
  107. --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
  108. --with-fontdir=/usr/share/X11/fonts \
  109. --with-xkb-path=/usr/share/X11/xkb \
  110. --with-xkb-output=/var/lib/xkb \
  111. --with-xkb-bin-directory=/usr/bin \
  112. --with-serverconfig-path=/usr/lib[64]/xorg \
  113. --with-dri-driver-path=/usr/lib[64]/dri \
  114. {additional configure options}
  115. (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
  116. 6 and recent Fedora releases. You should customize it for your particular
  117. system. In particular, it will be necessary to customize the font, XKB,
  118. and DRI directories.)
  119. > make TIGERVNC_SRCDIR={source_directory}
  120. Building the TigerVNC Server on Legacy Unix/Linux Systems
  121. ---------------------------------------------------------
  122. Those using systems with older versions of Xorg must build a "legacy-friendly"
  123. version of the TigerVNC Server. This is accomplished by downloading and
  124. building the more recent Xorg modules in a local directory and then building
  125. Xvnc such that it links against the local build of these libraries, not the X11
  126. libraries installed on the system. The "build-xorg" script in the TigerVNC
  127. source distribution (located under unix/) automates this process.
  128. The following procedure will build both the TigerVNC Viewer and a
  129. "legacy-friendly" version of the TigerVNC Server:
  130. cd {build_directory}
  131. sh {source_directory}/unix/build-xorg init
  132. sh {source_directory}/unix/build-xorg build [additional CMake flags]
  133. build-xorg generates a version of Xvnc that has no external dependencies on the
  134. X11 shared libraries or any other distribution-specific shared libraries. This
  135. version of Xvnc should be transportable across multiple O/S distributions.
  136. build-xorg should work on Red Hat Enterprise 4, its contemporaries, and later
  137. systems. It probably will not work on older systems. It has not been tested
  138. on non-Linux systems (yet).
  139. build-xorg can also be used to rebuild just the TigerVNC Server and Viewer,
  140. once the X11 modules and other dependencies have been built for the first time.
  141. This is convenient for testing changes that just apply to the TigerVNC source
  142. code. To accomplish this, run:
  143. sh {source_directory}/unix/build-xorg rebuild [additional make flags]
  144. For instance,
  145. sh {source_directory}/unix/build-xorg rebuild clean
  146. will clean both the Xvnc and vncviewer builds without destroying any of the
  147. build configuration or module dependencies.
  148. Building the Windows TigerVNC Viewer with MinGW
  149. -----------------------------------------------
  150. If building the Windows version of TigerVNC on a Windows build system, use
  151. the following procedure.
  152. cd {build_directory}
  153. cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory}
  154. make
  155. If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section
  156. below.
  157. Debug Build
  158. -----------
  159. Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line.
  160. Self-Contained GCC Build
  161. ------------------------
  162. If TigerVNC is built using GCC (including MinGW), then it may depend on the
  163. libgcc or libstdc++ dynamic libraries. To eliminate this dependency, add
  164. -DBUILD_STATIC=1
  165. to the CMake command line.
  166. ======================================
  167. Building High-Performance JPEG Support
  168. ======================================
  169. In order to achieve its high levels of performance, TigerVNC relies on
  170. libjpeg-turbo (http://www.libjpeg-turbo.org), a derivative of libjpeg which
  171. uses SIMD instructions to accelerate baseline JPEG compression and
  172. decompression. If you are building TigerVNC on an operating system that
  173. includes libjpeg-turbo as a system library (for instance, Fedora 14 and later),
  174. then the TigerVNC build system should detect the system version of
  175. libjpeg-turbo automatically and link against it. However, this produces a
  176. version of TigerVNC that depends on the libjpeg-turbo dynamic libraries, and
  177. thus the TigerVNC binaries are not portable.
  178. To build a fully portable, cross-compatible version of TigerVNC with
  179. high-performance JPEG support, it is necessary to link against the
  180. libjpeg-turbo static library. This is also necessary when building the
  181. Windows or OS X versions of TigerVNC. To link against the libjpeg-turbo static
  182. library, first install the libjpeg-turbo SDK, which is available from
  183. https://sourceforge.net/projects/libjpeg-turbo/files/. Next, use the
  184. JPEG_INCLUDE_DIR and JPEG_LIBRARY CMake variables to specify the location of
  185. libjpeg-turbo. For example, adding
  186. -DJPEG_INCLUDE_DIR=/opt/libjpeg-turbo/include \
  187. -DJPEG_LIBRARY=/opt/libjpeg-turbo/lib/libjpeg.a
  188. to the CMake command line will link TigerVNC against a static version of
  189. libjpeg-turbo installed under /opt/TigerVNC (which is the normal install
  190. location for the libjpeg-turbo SDK on Unix and Linux platforms.) Replace "lib"
  191. with "lib32" or "lib64" to use the 32-bit or 64-bit version of the library on
  192. 64-bit Linux platforms.
  193. When building on Windows systems, adding
  194. -DJPEG_INCLUDE_DIR=/c/libjpeg-turbo-gcc[64]/include \
  195. -DJPEG_LIBRARY=/c/libjpeg-turbo-gcc[64]/lib/libjpeg.a
  196. to the CMake command line will link TigerVNC against the static version of
  197. libjpeg-turbo provided by the libjpeg-turbo SDK for GCC (MinGW.)
  198. CMake will report:
  199. Performing Test FOUND_LIBJPEG_TURBO - Success
  200. if it successfully finds libjpeg-turbo.
  201. =====================
  202. Building Java Support
  203. =====================
  204. TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on
  205. any platform that has a Java Runtime Environment (JRE) installed. The Java
  206. viewer works similarly to the native viewer, but with lower performance.
  207. To build the Java TigerVNC Viewer, add
  208. -DBUILD_JAVA=1
  209. to the CMake or build-xorg command line. The build system will attempt to find
  210. an installed Java Development Kit (JDK) and determine the appropriate paths for
  211. the Java compiler (javac) and the JAR creation utility (jar). You can override
  212. these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake
  213. variables. You can also override the default flags that are passed to javac
  214. by setting the JAVACFLAGS CMake variable. The build system will look for
  215. keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These
  216. tools are needed to sign the JAR file, which is necessary to enable certain
  217. functionality (such as clipboard transfers) when the Java viewer is used as an
  218. applet.
  219. If the Java viewer is built along with the Windows TigerVNC Server (WinVNC),
  220. then the build system will embed the Java viewer into WinVNC4.exe so that it
  221. will automatically be served up using WinVNC's built-in HTTP server.
  222. Similarly, if the Java viewer is built along with the Unix TigerVNC Server
  223. (Xvnc), then the build system will include the Java viewer in the server
  224. tarball.
  225. ======================================
  226. Building Native Language Support (NLS)
  227. ======================================
  228. NLS requires gettext, which is supplied with most Linux distributions and
  229. with MinGW for Windows and which can easily be built from source on OS X and
  230. other Unix variants.
  231. You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
  232. specify the locations of libiconv and libintl, respectively. For instance,
  233. adding
  234. -DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
  235. to the CMake command line would link TigerVNC against a static version of
  236. libintl located under /opt/gettext. Adding
  237. -DICONV_INCLUDE_DIR=/mingw/include \
  238. -DICONV_LIBRARIES=/mingw/lib/libiconv.a \
  239. -DGETTEXT_INCLUDE_DIR=/mingw/include \
  240. -DLIBINTL_LIBRARY=/mingw/lib/libintl.a
  241. to the CMake command line would link TigerVNC against the static versions of
  242. libiconv and libintl included in the MinGW Developer Toolkit.
  243. ===============================================
  244. Building Transport Layer Security (TLS) support
  245. ===============================================
  246. VeNCrypt (the TigerVNC security and authentication extensions) can be built
  247. with TLS support, which provides built-in encryption for VNC sessions. This
  248. requires GnuTLS, which is readily available in many Linux distributions but not
  249. as readily available in binary form on other types of systems. This section
  250. describes the issues associated with building a version of TigerVNC with TLS
  251. support and how to work around those issues.
  252. Unix/Mac
  253. --------
  254. In general, if you are building on a Unix-ish platform that has the GnuTLS
  255. libraries and include files installed in the standard system locations, then
  256. the TigerVNC build system should detect the system version of GnuTLS
  257. automatically and link against it. However, this produces a version of
  258. TigerVNC that depends on the GnuTLS dynamic libraries, and thus the TigerVNC
  259. binaries are not portable.
  260. To build a fully portable, cross-compatible version of TigerVNC with TLS
  261. support, it is necessary to link against the GnuTLS static library (as well
  262. as the static libraries of its dependencies.) If you are lucky enough, then
  263. your O/S distribution may include pre-packaged versions of these static
  264. libraries. Otherwise, it will be necessary to build GnuTLS, libgcrypt,
  265. libtasn1, and libgpg-error from source.
  266. You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
  267. build TigerVNC against a custom build of GnuTLS that is installed in a
  268. non-system directory. For instance, adding
  269. -DGNUTLS_INCLUDE_DIR=/opt/gnutls/include \
  270. -DGNUTLS_LIBRARY='/opt/gnutls/lib/libgnutls.a;/opt/gnutls/lib/libgcrypt.a;/opt/gnutls/lib/libgpg-error.a;/opt/gnutls/lib/libtasn1.a' \
  271. -DUSE_INCLUDED_ZLIB=1
  272. to the CMake or 'build-xorg build' command line will cause TigerVNC to be
  273. statically linked against a custom installation of GnuTLS that resides under
  274. /opt/gnutls. GnuTLS depends on zlib, so specifying -DUSE_INCLUDED_ZLIB=1 will
  275. satisfy that dependency using TigerVNC's in-tree version of zlib, which
  276. prevents TigerVNC from depending on the libz dynamic library.
  277. MinGW
  278. -----
  279. An installer containing the GnuTLS header files, as well as static and dynamic
  280. link libraries for 32-bit MinGW, can be downloaded from the following site:
  281. http://josefsson.org/gnutls4win/
  282. As of this writing, GnuTLS cannot be built cleanly with MinGW64 due to the fact
  283. that portions of the code assume an LP64 data model (Windows uses LLP64.)
  284. Thus, it is not possible at this time to produce a Win64 version of TigerVNC
  285. with TLS support.
  286. Whether you use the above installer or build GnuTLS from source, make sure that
  287. you install the libraries and headers into a pathname that doesn't contain
  288. spaces (the installer will try to install under c:\Program Files unless you
  289. tell it otherwise.) If the GnuTLS include path contains spaces, then the MinGW
  290. resource compiler will barf when you try to build TigerVNC.
  291. You can manipulate the GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY CMake variables to
  292. specify the directory under which you installed GnuTLS. For instance, adding
  293. -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
  294. -DGNUTLS_LIBRARY=/c/gnutls/lib/libgnutls.dll.a
  295. to the CMake command line when using MinGW will cause TigerVNC to be linked
  296. against GnuTLS DLLs that are installed under c:\gnutls.
  297. Adding
  298. -DGNUTLS_INCLUDE_DIR=/c/gnutls/include \
  299. -DGNUTLS_LIBRARY='/c/gnutls/lib/libgnutls.a;/c/gnutls/lib/libgcrypt.a;/c/gnutls/lib/libtasn1.a;/c/gnutls/lib/libgpg-error.a'
  300. to the CMake command line will cause TigerVNC to be statically linked against
  301. GnuTLS libraries that are installed under c:\gnutls.
  302. ===================
  303. Installing TigerVNC
  304. ===================
  305. You can use the build system to install TigerVNC into a directory of your
  306. choosing. To do this, add:
  307. -DCMAKE_INSTALL_PREFIX={install_directory}
  308. to the CMake command line. Then, you can run 'make install' to build and
  309. install it.
  310. If you don't specify CMAKE_INSTALL_PREFIX, then the default is
  311. c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
  312. =========================
  313. Creating Release Packages
  314. =========================
  315. The following commands can be used to create various types of release packages:
  316. Unix
  317. ----
  318. make tarball
  319. Create a binary tarball containing the TigerVNC Viewer
  320. make servertarball
  321. Create a binary tarball containing both the TigerVNC Server and Viewer
  322. make dmg
  323. Create Macintosh disk image file that contains an application bundle of the
  324. TigerVNC Viewer
  325. make udmg
  326. On 64-bit OS X systems, this creates a version of the Macintosh package and
  327. disk image which contains universal i386/x86-64 binaries. You should first
  328. configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
  329. out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
  330. build system will look for the 32-bit build under {source_directory}/osxx86
  331. by default, but you can override this by setting the OSX_X86_BUILD CMake
  332. variable to the directory containing your configured 32-bit build. Either
  333. the 64-bit or 32-bit build can be configured to be backward compatible by
  334. using the instructions in the "Build Recipes" section.
  335. Windows
  336. -------
  337. make installer
  338. Create a Windows installer using Inno Setup. The installer package
  339. (TigerVNC[64].exe) will be located under {build_directory}.
  340. =============
  341. Build Recipes
  342. =============
  343. 32-bit Build on 64-bit Linux/Unix (including OS X)
  344. --------------------------------------------------
  345. Set the following environment variables before building TigerVNC.
  346. CFLAGS='-O3 -m32'
  347. CXXFLAGS='-O3 -m32'
  348. LDFLAGS=-m32
  349. If you are building the TigerVNC Server on a modern Unix/Linux system, then
  350. you will also need to pass the appropriate --host argument when configuring the
  351. X server source (for instance, --host=i686-pc-linux-gnu).
  352. 64-bit Backward-Compatible Build on 64-bit OS X
  353. -----------------------------------------------
  354. Add
  355. -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \
  356. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
  357. to the CMake command line. The OS X 10.5 SDK must be installed.
  358. 32-bit Backward-Compatible Build on 64-bit OS X
  359. -----------------------------------------------
  360. Set the following environment variables:
  361. CC=gcc-4.0
  362. CXX=g++-4.0
  363. CFLAGS='-O3 -m32'
  364. CXXFLAGS='-O3 -m32'
  365. LDFLAGS=-m32
  366. and add
  367. -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \
  368. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
  369. to the CMake command line. The OS X 10.4 SDK must be installed.
  370. 64-bit MinGW Build on Cygwin
  371. ----------------------------
  372. cd {build_directory}
  373. CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
  374. RC=/usr/bin/x86_64-w64-mingw32-windres \
  375. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  376. -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
  377. -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
  378. make
  379. This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
  380. other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
  381. packages (and their dependencies) must be installed.
  382. 32-bit MinGW Build on Cygwin
  383. ----------------------------
  384. cd {build_directory}
  385. CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
  386. RC=/usr/bin/i686-w64-mingw32-windres \
  387. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  388. -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
  389. -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
  390. make
  391. This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
  392. other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
  393. packages (and their dependencies) must be installed.
  394. MinGW-w64 Build on Windows
  395. --------------------------
  396. This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
  397. (which is faster than the Cygwin version):
  398. cd {build_directory}
  399. CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
  400. CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
  401. RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
  402. cmake -G "MSYS Makefiles" \
  403. -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
  404. -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
  405. {source_directory}
  406. make
  407. MinGW Build on Linux
  408. --------------------
  409. cd {build_directory}
  410. CC={mingw_binary_path}/i386-mingw32-gcc \
  411. CXX={mingw_binary_path}/i386-mingw32-g++ \
  412. RC={mingw_binary_path}/i386-mingw32-windres \
  413. cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
  414. -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
  415. -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
  416. {source_directory}
  417. make