This way of building is only experimental. If you are not successful try MSYS-Build |
---|
Table of Contents
- Table of Contents
- 1. Downloading, Compiling and Installing the needed Tools
- 2. Cloning and Compiling OpenWalnut
- 3. Stuff worth mentioning
1. Downloading, Compiling and Installing the needed Tools
1.1 Installing Visual Studio
First, let's start off with downloading the compiler and the IDE. For this, we use the latest Visual Studio Community Edition, which right now is Visual Studio 2022. You can also try with any other Version you have, but this is the Version used in this tutorial.
Go to the Website: https://visualstudio.microsoft.com/de/downloads/
and download/install the Community Edition.
It is mandatory that you install the additional component Desktop development with C++ as this includes our compiler.
Depending on your internet speed, this may take a while, so grab yourself a coffee or a tee or something else and relax while the installers does its magic.
1.2 Installing Build Tools
After you installed Visual Studio, you can now install some smaller build tools.
The first one is CMake, which is used for creating the project solution: https://cmake.org/download/
Download and install the appropriate version for your platform.
When asked to add CMake to the system path, you should do it,
as it allows us to use CMake from the console.
Then install Git (https://git-scm.com/download/win) which is used to contribute to the project. When you are asked to adjust your PATH environment, please choose git from command line. All the other option can be left as they are, or you can adjust them if you know what you are doing.
After that, install the latest Python2 release and the latest Python3 release (https://www.python.org/downloads/windows/). It is mandatory that you have both
1.3 Downloading the dependencies
First, you should decide where you want to put all the dependencies that you have to compile yourself. In this tutorial, we use C:\ow_workspace
.
Then download our dependency package (https://seafile.rlp.net/f/35d60552eff6409baa85/) and extract it inside your workspace.
This contains the boost-1.78
, eigen3
, nifticlib-2.0.0
, openscenegraph-3.6.5
and zlib
precompiled for MSVC.
You can also compile those yourself, but that takes a lot of time and is a little tricky.
After that, you have to set some environment variables so that CMake finds the dependencies.
If you chose a different workspace folder, then those paths have to be adjusted.
Variable | Value |
---|---|
BOOST_ROOT | C:\ow_workspace\boost |
NIFTILIB_INCLUDE_DIR | C:\ow_workspace\niftilib\include |
NIFTILIB_LIBRARY_DIR | C:\ow_workspace\niftilib\lib |
OSG_ROOT | C:\ow_workspace\openscenegraph |
ZLIB_INCLUDE_DIR | C:\ow_workspace\zlib\include |
ZLIB_LIBRARY_DIR | C:\ow_workspace\zlib\lib |
You also have to add the following folder to the PATH variable:
C:\ow_workspace\niftilib\bin
C:\ow_workspace\openscenegraph\bin
C:\ow_workspace\zlib\bin
1.4 Installing QT
Create a folder called qt
inside your workspace.
Then open a PowerShell and navigate to the qt
folder.
Run the command pip install aqtinstaller
.
This is an alternative installer for qt that has MSVC binaries.
After that run the command aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 -m all
.
You can also install a different QT version, but for this tutorial we use 5.15.2.
Then you have to set the environment variable Qt5_DIR
to C:\ow_workspace\qt\5.15.2\msvc2019_64
. If you downloaded Qt6, it has to be Qt6_DIR
.
Also, you have to add C:\ow_workspace\qt\5.15.2\msvc2019_64\bin
to the PATH.
2. Cloning and Compiling OpenWalnut
Open a PowerShell in your workspace directory.
Then clone the repository (git clone https://bsvgit.informatik.uni-leipzig.de/openwalnut/openwalnut.git
) and checkout the branch you want (At the moment, the 580-qt6-support is the only branch with MSVC support).
Navigate into the OpenWalnut build directory (cd openwalnut/build
) and run the command:
cmake -G"Visual Studio 17 2022" -DBoost_USE_STATIC_LIBS=ON -DOW_FIX_WINDOWS_RANDOM_ERROR=ON -DOW_FIX_EEP_WINDOWS_ERROR=ON -DEIGEN3_INCLUDE_DIR=C:\ow_workspace\eigen -DCMAKE_BUILD_TYPE=Release -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DBUILD_SHARED_LIBS=ON ..\src
Attention, if you used a different workspace folder, then you have to change the EIGEN3_INCLUDE_DIR.
After that, an OpenWalnut.sln should have been generated. Open this Project File, change the build target from Debug to Release and build the Solution (Build/Build Solution).
3. Stuff worth mentioning
There will always be a project called core_devdoc
failing, as there is no support for the documentation at the moment.
Also, no style check project will be build yet.
All warnings are disabled, as the port to MSVC throws a lot of them.