Compiling Yabause under Windows with Cmake

From Yabause
Jump to: navigation, search
Yabause Manual
For users
For developers
edit

top » build: windows » host: windows

Setting up the build environment :

This includes the compiler and the required tools to build Yabause and its dependencies.

CMake

  • Download the latest CMake version and install it : CMake 3.5.2

OpenAL

  • Download the latest OpenAL sources and unzip it : OpenAL 1.17.2

Qt Libraries

SDL2 Development Libraries

  • Download and install the latest SDL2 Development Libraries : SDL-devel-2.0.4-VC.zip
  • Create a directory : C:\SDL2
  • Unzip "SDL-devel-2.0.4-VC" in C:\SDL2

Visual C++ 2015 Express Edition

Installation and Compiling :

  • Create a directory : C:\Yabause

How to get the Yabause source from GitHub ?

  • Download the zip file (file with sources) : Download
  • Unzip in C:\Yabause Source.

Compiling Mini18n

  • Create a directory : C:\mini18n
  • Launch CMake (cmake-gui).
Where is the code source : C:/Yabause Source/yabause-master/mini18n
Where to build the binaries : C:/mini18n
  • Click on "Configure" button.
  • Choose Visual Studio 14 2014 Win64 and push the "Finish" button.
  • Change CMAKE_INSTALL_PREFIX's value to where you want to install mini18n. e.g. C:/Program Files/mini18n. Make a note of this for later.
  • Click on "Generate" button.
  • Close CMake.
  • Start Visual Studio as administrator(this is important). Select "File" menu, then "Open", then "Project/Solution...". Open C:/mini18n and select "mini18n.sln". Visual Studio will load project.
  • Select "Release" solution configuration.
  • On the left panel, right click on "Solution 'mini18n' (8 projects)". Choose "Build Solution".
  • On the left panel, right click on "Install" and choose "Build".

Compiling Yabause

  • Create a directory : C:\Yabause
  • Launch CMake (cmake-gui) and set the paths :
Where is the code source : C:/Yabause Source/yabause-master/yabause
Where to build the binaries : C:/Yabause
  • Click on "Configure" button.
  • Choose Visual Studio 14 2014 Win64 and push the "Finish" button.
  • You'll get a window with lot red lines. we're going to setting the paths :
MINI18N_INCLUDE_DIR --> C:/Program Files/mini18n/include(or wherever you put mini18n)
MINI18N_LIBRARY --> C:/Program Files/mini18n/lib/mini18n-static.lib(or wherever you put mini18n)
QT_MAKE_EXECUTABLE --> C:/Qt/Qt5.7.0/5.7/msvc2015_64/bin
QT5_DIR --> C:/Qt/Qt5.7.0/5.7/msvc2015_64/lib/cmake/Qt5
SDL2_INCLUDE_DIR --> C:/SDL2/SDL2-2.0.4/include
SDL2_LIBRARY_TEMP --> C:/SDL2/SDL2-2.0.4/lib/x64/SDL2.lib
YAB_PORTS -> qt
YAB_PORT_OSD -> Make sure it's checked
YAB_WANT_OPENGL -> Make sure it's unchecked (reason why)
  • Click on "Generate" button.
  • "Error in configuration process, project files may be invalid" dialog is displayed. You have to set 2 more paths :
Qt5Multimedia_DIR --> C:/Qt/Qt5.7.0/5.7/msvc2015_64/lib/cmake/Qt5Multimedia
Qt5OpenGL_DIR --> C:/Qt/Qt5.7.0/5.7/msvc2015_64/lib/cmake/Qt5OpenGL
  • Click on "Generate" button.


  • Start Visual Studio as administrator (only needed if you want to install Yabause to program files). Select "File" menu, then "Open", then "Project/Solution...". Open C:/Yabause Source and select "yabause.sln". Visual Studio will load project.
  • Optionally set active solution to "Release".
  • On the left panel, right click on "Solution 'Yabause' (8 projects)". Choose "Build Solution".
  • Be patient. Get yourself a coffee or something.
  • To get your Yabause.exe, go to : c:/Yabause/src/qt/Release. If you ran Visual Studio as administrator it'll also get installed to your program files\yabause directory.

Setting up Execution Environment

After successful compilation of Yabause, it is required to copy several DLLs in yabause build output directory.

SDL :

  • Copy SDL2.dll from C:\SDL2\SDL2-2.0.4\lib\x64 to C:\Yabause\src\qt\Release directory.

Qt :

  • Copy Qt5Core.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin to C:\Yabause\src\qt\Release directory.
  • Copy Qt5Gui.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin to C:\Yabause\src\qt\Release directory.
  • Copy Qt5Multimedia.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin to C:\Yabause\src\qt\Release directory.
  • Copy Qt5Network.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin to C:\Yabause\src\qt\Release directory.
  • Copy Qt5OpenGL.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin to C:\Yabause\src\qt\Release directory.
  • Copy Qt5Widgets.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin to C:\Yabause\src\qt\Release directory.
  • Copy qwindows.dll from C:\Qt\Qt5.7.0\5.7\msvc2015_64\plugins\platforms to C:\Yabause\src\qt\Release\platforms directory.

Visual Studio :

Compiling Yabause with OpenAL

  • Launch CMake (cmake-gui) and set the paths :
Where is the code source : C:/Yabause-master/yabause
Where to build the binaries : C:/Yabause

  • Click on "Ok" button.
  • Choose Visual Studio 12 2013 and push the "Finish" button.
  • You'll get a window with lot red lines. we're going to setting the paths :
QT_MAKE_EXECUTABLE --> C:/Qt5/5.6/msvc2013/bin/qmake.exe
MINI18N_INCLUDE_DIR --> C:/Program Files(x86)/mini18n/include(or wherever you put mini18n)
MINI18N_LIBRARY --> C:/Program Files(x86)/mini18n/lib/mini18n.lib(or wherever you put mini18n)
QT5_DIR --> E:/Qt5/5.6/msvc2013/lib/cmake/Qt5
SDL_INCLUDE_DIR --> C:/SDL2-2.0.3/include
SDL_LIBRARY_TEMP --> C:/SDL2-2.0.3/lib/x86/SDL2.lib
SDL2_INCLUDE_DIR --> C:/SDL/SDL-1.2.15/include
SDL2_LIBRARY_TEMP --> C:/SDL-1.2.15/lib/x86/SDL.lib
OPENAL_INCLUDE_DIR --> C:/Openal-soft 1.17.2/include
OPENAL_LIBRARY --> C:/Openal-soft 1.17.2/libs/Win32/OpenAL32.lib
CMAKE_EXE_LINKER_FLAGS -->  /machine:X86 /OPT:NOREF
YAB_PORTS -> qt
YAB_PORT_OSD -> Make sure it's checked
  • Click on "Configure" button.
  • 6 new red lines will be displayed. You have to set 2 more paths :
Qt5Multimedia_DIR --> C:/Qt5/5.6/msvc2013/lib/cmake/Qt5Multimedia
  • Click on "Configure" button.
  • 1 new red line will be displayed. You have to set 1 more path :
Qt5Multimedia_DIR --> C:/Qt5/5.6/msvc2013/lib/cmake/Qt5Network
  • Click on "Configure" button.
  • Click on "Generate" button.


  • Start Visual Studio as administrator (only needed if you want to install Yabause to program files). Select "File" menu, then "Open", then "Project/Solution...". Open C:/Yabause Source and select "yabause.sln". Visual Studio will load project.
  • Optionally set active solution to "Release".
  • Right Click on Yabause Qt (Right Panel --> Solution), properties - > configuration -> Linker -> Advanced and change "Image Has Safe Exception Handlers" to "No (/SAFESEH:NO)"
  • On the left panel, right click on "Solution 'Yabause' (7 projects)". Choose "Build Solution".
  • Be patient. Get yourself a coffee or something.
  • To get your Yabause.exe, go to : c:/Yabause/src/qt/Release. If you ran Visual Studio as administrator it'll also get installed to your program files\yabause directory.