Difference between revisions of "How to build VCMI (Windows/Vcpkg)"

From VCMI Project Wiki
Jump to: navigation, search
(Prerequisites)
Line 3: Line 3:
 
* Git or git GUI, for example, SourceTree [http://www.sourcetreeapp.com/download download]
 
* Git or git GUI, for example, SourceTree [http://www.sourcetreeapp.com/download download]
 
* CMake [https://cmake.org/download/ download]
 
* CMake [https://cmake.org/download/ download]
 +
* To unpack pre-build Vcpkg [http://www.7-zip.org/download.html download] 7z
  
 
= Install dependencies =
 
= Install dependencies =
 +
== Download pre-built Vcpkg ==
 +
You might save a time by using Vcpkg packages pre-built by VCMI team. They guaranteed to work since they tested with every commit by AppVeyor.
  
== Create initial directory ==
+
Download latest package from GitHub: https://github.com/vcmi/vcmi-deps-windows/releases
 +
 
 +
== Build Vcpkg on your own ==
 +
Be aware that building Vcpkg might take a lot of time depend on your CPU model and 10-20GB of disk space.
 +
=== Create initial directory ===
 
Create a directory for vcpkg development, eg. '''C:\vcpkg'''
 
Create a directory for vcpkg development, eg. '''C:\vcpkg'''
 
We will call this directory as '''[VCPKG_DIR]'''
 
We will call this directory as '''[VCPKG_DIR]'''
Line 17: Line 24:
 
* '''C:\Program Files (x86)\vcpkg''' (write protection)
 
* '''C:\Program Files (x86)\vcpkg''' (write protection)
  
== Clone vcpkg ==
+
=== Clone vcpkg ===
  
 
* open SourceTree
 
* open SourceTree
Line 25: Line 32:
 
* click '''Clone'''
 
* click '''Clone'''
  
== Build vcpkg ==
+
=== Build vcpkg ===
 
* Run '''[VCPKG_DIR]/bootstrap-vcpkg.bat'''
 
* Run '''[VCPKG_DIR]/bootstrap-vcpkg.bat'''
  
== Build dependencies ==
+
=== Build dependencies ===
 
* For 32-bit build run '''[VCPKG_DIR]/vcpkg.exe install minizip:x86-windows sdl2:x86-windows sdl2-image:x86-windows sdl2-ttf:x86-windows sdl2-mixer:x86-windows boost:x86-windows qt5:x86-windows ffmpeg:x86-windows'''
 
* For 32-bit build run '''[VCPKG_DIR]/vcpkg.exe install minizip:x86-windows sdl2:x86-windows sdl2-image:x86-windows sdl2-ttf:x86-windows sdl2-mixer:x86-windows boost:x86-windows qt5:x86-windows ffmpeg:x86-windows'''
 
* For 64-bit build run '''[VCPKG_DIR]/vcpkg.exe install minizip:x64-windows sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer:x64-windows boost:x64-windows qt5:x64-windows ffmpeg:x64-windows'''
 
* For 64-bit build run '''[VCPKG_DIR]/vcpkg.exe install minizip:x64-windows sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer:x64-windows boost:x64-windows qt5:x64-windows ffmpeg:x64-windows'''

Revision as of 15:28, 20 August 2017

Prerequisites

Install dependencies

Download pre-built Vcpkg

You might save a time by using Vcpkg packages pre-built by VCMI team. They guaranteed to work since they tested with every commit by AppVeyor.

Download latest package from GitHub: https://github.com/vcmi/vcmi-deps-windows/releases

Build Vcpkg on your own

Be aware that building Vcpkg might take a lot of time depend on your CPU model and 10-20GB of disk space.

Create initial directory

Create a directory for vcpkg development, eg. C:\vcpkg We will call this directory as [VCPKG_DIR]

It is recommended to avoid non-ascii characters in the path to your vcpkg folder. The folder should not be write-protected by system. Good location:

  • C:\vcpkg

Bad locations:

  • C:\Users\Michał\vcpkg (non-ascii character)
  • C:\Program Files (x86)\vcpkg (write protection)

Clone vcpkg

Build vcpkg

  • Run [VCPKG_DIR]/bootstrap-vcpkg.bat

Build dependencies

  • For 32-bit build run [VCPKG_DIR]/vcpkg.exe install minizip:x86-windows sdl2:x86-windows sdl2-image:x86-windows sdl2-ttf:x86-windows sdl2-mixer:x86-windows boost:x86-windows qt5:x86-windows ffmpeg:x86-windows
  • For 64-bit build run [VCPKG_DIR]/vcpkg.exe install minizip:x64-windows sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer:x64-windows boost:x64-windows qt5:x64-windows ffmpeg:x64-windows

Build VCMI

Create initial directory

Create a directory for VCMI development, eg. C:\VCMI We will call this directory as [VCMI_DIR]

It is recommended to avoid non-ascii characters in the path to your VCMI development folder. The folder should not be write-protected by system. Good location:

  • C:\VCMI

Bad locations:

  • C:\Users\Michał\VCMI (non-ascii character)
  • C:\Program Files (x86)\VCMI (write protection)

Clone VCMI

Compile VCMI

  • create [VCMI_DIR]/build
  • open [VCMI_DIR]/build in terminal
  • execute cmake ../source -DCMAKE_TOOLCHAIN_FILE=[VCPKG_DIR]/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=[VCMI_DIR]/install
  • open VCMI.sln in Visual Studio
  • select "Release" build type in combobox
  • right click on BUILD_ALL project - build project
  • right click on INSTALL project - build project
  • grab VCMI in [VCMI_DIR]/install folder!