Browse Source

doc: added Visual Studio building instructions.

pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
2ba69b2c2b
  1. 62
      doc/building.dox

62
doc/building.dox

@ -78,37 +78,53 @@ can be built and installed using these four commands:
See @ref building-features "below" for additional configuration options. See @ref building-features "below" for additional configuration options.
@subsection building-windows Using QtCreator and CMake GUI (on Windows) @subsection building-windows Building on Windows
On Windows, if you don't want to touch the command-line, the easiest way is to On Windows you can use either MinGW or MSVC 2013 compiler. It's then up to you
install QtCreator (just QtCreator, you don't need the full Qt SDK) and whether you will use QtCreator, Visual Studio or do the build from command-
configure it to use MinGW and CMake. 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
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
executables. If you are using MinGW, the `C:/MinGW` directory is in most cases
already prepared for exactly this.
For most convenient usage it's best to install (or copy/paste) all library When running CMake, set `CMAKE_FIND_ROOT_PATH` and `CMAKE_INSTALL_PREFIX`
dependencies into directory where MinGW is installed (e.g. `C:/MinGW/`), parameters to that directory so CMake knows where to look for installed
following proper filesystem hierarchy, i.e. headers into `include/` and libraries and where to install new ones.
binaries into `bin/` or `lib/`. CMake will then have no problem finding them
and you won't need to explicitly specify path to each one.
Then just open project's root `CMakeLists.txt` file within QtCreator. It then @subsubsection building-windows-msvc Using Visual Studio
On Windows CMake by default creates Visual Studio project files. You need to
use `compatibility` branch to compile with MSVC 2013, as said above.
The most straightforward way to build and install the library is again via the
command-line. The bonus point is that you don't even need to wait for Visual
Studio to load:
mkdir build
cd build
cmake -DCMAKE_FIND_ROOT_PATH="C:/Sys" -DCMAKE_INSTALL_PREFIX="C:/Sys" ..
cmake --build .
cmake --build --target install .
If you want to build and install from Visual Studio, just open the `Magnum.sln`
project file generated by CMake in the build directory.
@subsubsection building-windows-qtcreator Using QtCreator
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
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 and then you can just press *Configure* and everything is be ready parameters (e.g. `CMAKE_FIND_ROOT_PATH` and `CMAKE_INSTALL_PREFIX`) and then
to be built. you can just press *Configure* and everything is ready to be built.
After the initial import you might want to reconfigure some CMake variables, After the initial import you might want to reconfigure some CMake variables,
see @ref building-features "below" for more information. see @ref building-features "below" for more information.
For most convenient usage it's best to set `CMAKE_INSTALL_PREFIX` to directory Installation to given prefix can be done from within QtCreator by adding new
where MinGW is installed (e.g. `C:/MinGW/`) and add `C:/MinGW/bin` and `make install` build rule.
`C:/MinGW/lib` to `PATH`. Installation to given prefix can be then done from
within QtCreator by adding new `make install` build rule.
@subsubsection building-windows-troubleshooting Windows troubleshooting
If CMake isn't able to find dependencies (e.g. %Corrade is not found), point
`CMAKE_FIND_ROOT_PATH` and `CMAKE_INSTALL_PREFIX` to installation prefix of
dependency libraries, e.g. specify `-DCMAKE_FIND_ROOT_PATH=C:/MinGW/` CMake
parameter.
@subsection building-features Enabling or disabling features @subsection building-features Enabling or disabling features

Loading…
Cancel
Save