Build Instructions for windows
1. Download and install CMake
Add cmake executables path(C:\Program Files\CMake\bin) to PATH environment variable is recommended.
2. Download and install Qt
3. Download and instatll Visual Studio
4. Build VTK
- Open a developer command prompt(I will call this terminal from now on)
-
Open cmake-gui
Type cmake-gui in your terminal, a cmake graphical user interface will open.Make sure open cmake-gui from this termimal to get the necessary build tools.
cmake-gui
Warning: If you didn't add the path of cmake-gui to PATH, you should type the full path of cmake-gui.exe
-
Set the source and binary path in cmake-gui.
- Press Configure and select a project generator.Visual Studio and NMake Makefiles both are OK.I use NMake Makefiles here.
- You may want to use the VTK_GIT_TAG attribute to specify a commit hash of the latest release version which will be used to download and build a specific VTK-version from the remote repository, the default is the latest versin for now: 8.2.0.
-
Press Configure and then Generate
-
Open the terminal and navigate to
/dependencies/bin
in the project directory. From there, use the nmake command to invoke the build process. VTK will first be cloned so make sure you are connected to the internet -
Wait the build precess to complete, it may take a long time.
cd dependencies/bin nmake
Warning: Use msbuild or Visual Studio to build if you selected the Visual Studio as the generator.
- Launch cmake-gui and set the paths accordingly:
-
Press Configure and select a project generator
-
In most cases, CMake will fail to find Qt. Confirm the error dialog and enter
Qt
in the search field. Set the path toQt5Config.cmake
which might vary depending on your Qt-installation.
-
Press Configure again
-
Another error will probably pop up. This time VTK was not found. Type
VTK
in the search field and set the path todependencies/bin/VTK/bin
from the project root directory
- Press Configure and then Generate
Build QuickVtk in the terminal
cd bin
nmake
- enable Module_vtkRenderingExternal when build vtk.
- Set VTK_DIR to the build/install path of vtk when build QuickVtk