Hi
Here a small guide to build wz4 from latest github source with third party libraries.
Requirements :
- Visual Studio (c++ dev editor and compiler) (tested and works with 2008,2010,2012,2013)
- yasm (assembleur compiler required for some wz4 code part)
- cmake (used to build assimp visual studio project)
- nvidia physx sdk (or suscribe to nvidia dev zone (third part library to simulate physics)
- assimp sdk (third part library to import 3d models)
- git (best way to always get latest wz4 sources)
Installation :
- install visual studio
- rename yasm binary to "yasm.exe" and put it in c:/windows folder
- install cmake
- install git
note : easiest way for now, is to use next predefined path (in wait of alternative methods to set path to libraries and wz4 sources code)
Get wz4 sources with git :
- create a folder C:\github
- right click empty place in folder and select "git bash" in menu
- at prompt, enter next command : git clone https://github.com/wzman/werkkzeug4CE.git
- it will download files and you obtain : C:\github\werkkzeug4CE folder with all wz4 files insides
- launch build_project.bat script to create visual studio project files
third-party libraries :
- create a folder C:\library to put all required libraries
Physx :
- extract archive content in C:\library folder to get : C:\library\PhysX-3.3.1_PC_SDK_Core
Assimp :
- extract archive content in C:\library folder to get : C:/library/assimp_3.1.1_build
- Run cmake-gui
- browse source = C:/library/assimp-3.1.1-win-binaries
- browse build = C:/library/assimp_3.1.1_build (create new empty folder)
- unckeck unused stuff : BUILD_ASSIMP_TOOLS, BUILD_SAMPLES, BUILD_TESTS, INSTALL_PDB
- click configure, and again if all is red
- click generate
- go to C:/library/assimp_3.1.1_build
- open Assimp.sln (double click) - select release - and Build
- you finally get C:/library/assimp_3.1.1_build\code\Release\ assimp.lib and assimp.dll required to compil with wz4
Wz4
- open C:\github\werkkzeug4CE\wz4\werkkzeug4\werkkzeug4.sln
- select release_dx9 and win32 or win64, and build
Optionnal :
To launch directly wz4 from visual studio editor you can put required third part dll inside wz4 folders, ex :
in C:\github\werkkzeug4CE\wz4\werkkzeug4\release_dx9_Win32, add :
- PhysX3CHECKED_x86.dll
- PhysX3CommonCHECKED_x86.dll
- PhysX3CookingCHECKED_x86.dll
from C:\library\PhysX-3.3.1_PC_SDK_Core\Bin\win32
and
- assimp.dll from C:\library\assimpBuild\code\Release
git updates
When new modifications are pushed on wz4 github project, you can update your code :
- Visual studio opened or closed
- right click in C:\github\werkkzeug4CE folder and select Git bash in menu
- enter : git pull origin master (get updates in master branch)
- Click build in visual studio, it will only recompile modifications.
Disable third part libraries
You can choose to not compil wz4 with physx or assimp libraries, it will remove physx and assimp features from wz4 if you don't want to use them and avoid to need extra dll.
- open C:\github\werkkzeug4CE\altona\main\base\types.hpp file
- search for
#define sCOMPIL_PHYSX // NVIDIA Physx library
#define sCOMPIL_ASSIMP // Open Asset import library
and put a comments at start of lines to ignore definitions, like this :
// #define sCOMPIL_PHYSX // NVIDIA Physx library
// #define sCOMPIL_ASSIMP // Open Asset import library
it will not compil both libraries here.
Patch Physx to works with other visual studio version than 2010
Note : this chapter is now obsolete, it was fixed by migrating physx 3.2.3 to 3.3.1
Physx packages (version 3.2.3), contain a bug and cause compilation errors when visual studio version is not 2010.
To get it working with your visual studio version you need to edit some files in physx folder. As theses file are binaries files you need an hexadecimal editor (like this)
concerned files are :
PhysX3ExtensionsCHECKED.lib
PxTaskCHECKED.lib
PhysXProfileSDKCHECKED.lib
in C:\library\PhysX-3.2.3_PC_SDK_Core\Lib\win32 (for 32 bits compilation version, do the same for 64 bits if you want to use it too)
open these file with your hexa editor and search for the string : MSC_VER=1600
replace 1600 with right number value according your visual studio version :
1600 = visual studio 2010
1700 = visual studio 2012
1800 = visual studio 2013
search again the same sting and replace all references. do the same for all specified files and it's done, you can now build your project.