Browse Source

doc: updated MinGW-w64 building documentation.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
03c8272aea
  1. 2
      README.md
  2. 46
      doc/building.dox
  3. 2
      doc/getting-started.dox

2
README.md

@ -87,7 +87,7 @@ Minimal dependencies
- C++ compiler with good C++11 support. Compilers which are tested to have - C++ compiler with good C++11 support. Compilers which are tested to have
everything needed are **GCC** >= 4.7, **Clang** >= 3.1 and **MSVC** 2015. everything needed are **GCC** >= 4.7, **Clang** >= 3.1 and **MSVC** 2015.
On Windows you can also use **MinGW**. GCC 4.6, 4.5, 4.4 and MSVC 2013 On Windows you can also use **MinGW-w64**. GCC 4.6, 4.5, 4.4 and MSVC 2013
support involves some ugly workarounds and thus is available only in support involves some ugly workarounds and thus is available only in
`compatibility` branch. `compatibility` branch.
* **CMake** >= 2.8.9 * **CMake** >= 2.8.9

46
doc/building.dox

@ -34,7 +34,7 @@ Minimal set of tools and libraries required for building is:
- C++ compiler with good C++11 support. Compilers which are tested to have - C++ compiler with good C++11 support. Compilers which are tested to have
everything needed are **GCC** >= 4.7, **Clang** >= 3.1 and **MSVC** 2015. everything needed are **GCC** >= 4.7, **Clang** >= 3.1 and **MSVC** 2015.
On Windows you can also use **MinGW**. GCC 4.6, 4.5, 4.4 and MSVC 2013 On Windows you can also use **MinGW-w64**. GCC 4.6, 4.5, 4.4 and MSVC 2013
support involves some ugly workarounds and thus is available only in support involves some ugly workarounds and thus is available only in
`compatibility` branch. `compatibility` branch.
- **CMake** >= 2.8.9 - **CMake** >= 2.8.9
@ -89,14 +89,14 @@ want to set `CMAKE_INSTALL_RPATH` to `lib/` subdir of given prefix (e.g.
@subsection building-windows Building on Windows @subsection building-windows Building on Windows
On Windows you can use either MinGW or MSVC 2013 compiler. It's then up to you On Windows you can use either MinGW-w64 or MSVC 2013 compiler. It's then up to
whether you will use QtCreator, Visual Studio or do the build from command- you whether you will use QtCreator, Visual Studio or do the build from command-
line. Note that for most convenient usage it's best use some dedicated line. Note that for most convenient usage it's best use some dedicated
directory (e.g. `C:/Sys`) for installing dependencies instead of putting each directory (e.g. `C:/Sys`) for installing dependencies instead of putting each
dependency to its own directory in `C:/Program Files`. Then add its `bin/` dependency to its own directory in `C:/Program Files`. Then add its `bin/`
subdir (e.g. `C:/Sys/bin`) to PATH so all the DLLs are found when running the subdir (e.g. `C:/Sys/bin`) to PATH so all the DLLs are found when running the
executables. If you are using MinGW, the `C:/MinGW` directory is in most cases executables. If you are using MinGW-w64, the `C:/MinGW` directory is in most
already prepared for exactly this. cases already prepared for exactly this.
Then, when running CMake, set `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX` Then, when running CMake, set `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX`
value to that directory (e.g. `-DCMAKE_INSTALL_PREFIX=C:/Sys`). value to that directory (e.g. `-DCMAKE_INSTALL_PREFIX=C:/Sys`).
@ -121,7 +121,7 @@ project file generated by CMake in the build directory.
@subsubsection building-windows-qtcreator Using QtCreator @subsubsection building-windows-qtcreator Using QtCreator
On Windows you can also use QtCreator (just QtCreator, you don't need the full On Windows you can also use QtCreator (just QtCreator, you don't need the full
Qt SDK). Configure it to use CMake and either MSVC compiler or MinGW and and Qt SDK). Configure it to use CMake and either MSVC compiler or MinGW-w64 and
then just open project's root `CMakeLists.txt` file within it. QtCreator then then just open project's root `CMakeLists.txt` file within it. QtCreator then
asks you where to create build directory, allows you to specify initial CMake asks you where to create build directory, allows you to specify initial CMake
parameters (e.g. `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX`) and then you parameters (e.g. `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX`) and then you
@ -343,30 +343,34 @@ contents in `toolchains/` subdirectory.
git submodule init git submodule init
git submodule update git submodule update
@subsection building-cross-win Crosscompiling for Windows using MinGW @subsection building-cross-win Crosscompiling for Windows using MinGW-w64
@note This guide is tailored mainly for crosscompiling from ArchLinux. For @note This guide is tailored mainly for crosscompiling from ArchLinux. For
this system there is also prepared `mingw32-magnum` development package in this system there is also prepared `mingw-w64-magnum` development package
`package/archlinux`, named `PKGBUILD-mingw32`. See in `package/archlinux`, named `PKGBUILD-mingw-w64`. See
@ref building-packages-arch "above" for more information. @ref building-packages-arch "above" for more information.
You will need MinGW32 versions of the compiler and all dependent libraries You will need MinGW-w64 versions of the compiler and all dependent libraries
(Corrade), i.e. these ArchLinux packages: (Corrade), i.e. these ArchLinux packages:
- `mingw32-gcc`, which depends on `mingw32-w32api` containing OpenGL headers - `mingw-w64-gcc`
- `mingw32-runtime` - `mingw-w64-corrade`
- `mingw32-corrade`
Then create build directory and run cmake and build command in it. You may need Then create build directories for 32b/64b build and run cmake and build command
to modify the `basic-mingw32.cmake` file and `CMAKE_INSTALL_PREFIX` to suit in them. You may need to modify the `basic-mingw-w64-32.cmake`/`basic-mingw-w64-64.cmake`
your distribution filesystem hierarchy and specify path where Corrade is files and `CMAKE_INSTALL_PREFIX` to suit your distribution filesystem
installed in `CMAKE_PREFIX_PATH`. hierarchy and specify path where Corrade is installed in `CMAKE_PREFIX_PATH`.
mkdir build-win && cd build-win mkdir build-mingw-w64-32 && cd build-mingw-w64-32
cmake .. \ cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw-w64-32.cmake \
-DCMAKE_PREFIX_PATH=/usr/i486-mingw32 \ -DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32
-DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32 cmake --build .
mkdir build-mingw-w64-64 && cd build-mingw-w64-64
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw-w64-64.cmake \
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32
cmake --build . cmake --build .
Then you can install the package using `cmake --build . --target install` to Then you can install the package using `cmake --build . --target install` to

2
doc/getting-started.dox

@ -158,7 +158,7 @@ of build dir:
make make
./src/MyApplication ./src/MyApplication
On Windows you can use either MinGW or MSVC 2013 compiler. It's then up to you On Windows you can use either MSVC or MinGW-w64 compiler. It's then up to you
whether you will use QtCreator or Visual Studio. With Visual Studio the most whether you will use QtCreator or Visual Studio. With Visual Studio the most
straightforward way to create the project file is via the command-line: straightforward way to create the project file is via the command-line:

Loading…
Cancel
Save