Build Settings
July 14, 2026 · View on GitHub
VTK has a number of settings available for its build. The common variables to modify include:
BUILD_SHARED_LIBS(defaultON): If set, shared libraries will be built. This is usually what is wanted.VTK_USE_PCH(defaultON): If set, VTK will use precompiled headers to speed up compilation.VTK_USE_CUDA(defaultOFF): Whether CUDA support will be available or not.VTK_USE_MPI(defaultOFF): Whether MPI support will be available or not.VTK_WRAP_PYTHON(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether Python support will be available or not.
Less common, but variables which may be of interest to some:
VTK_BUILD_EXAMPLES(defaultOFF): If set, VTK's example code will be added as tests to the VTK test suite.VTK_ENABLE_LOGGING(defaultON): If set, enhanced logging will be enabled.VTK_LOGGING_TIME_PRECISION(default3; requiresVTK_ENABLE_LOGGING): Change the precision of times output whenVTK_ENABLE_LOGGINGis on.VTK_BUILD_TESTING(defaultOFF): Whether to build tests or not. Valid values areOFF(no testing),WANT(enable tests as possible), andON(enable all tests; may error out if features otherwise disabled are required by test code).VTK_ENABLE_KITS(defaultOFF; requiresBUILD_SHARED_LIBS): Compile VTK into a smaller set of libraries. Can be useful on platforms where VTK takes a long time to launch due to expensive disk access.VTK_ENABLE_WRAPPING(defaultON): Whether any wrapping support will be available or not.VTK_WRAP_JAVA(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether Java support will be available or not.VTK_JAVA_RELEASE_VERSION(default8; requiresVTK_WRAP_JAVA): The version of Java in which VTK's Java wrapping will be built for.VTK_WRAP_SERIALIZATION(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether serialization code will be auto generated or not.VTK_BUILD_TYPES_JSON(defaultOFF; requiresVTK_WRAP_SERIALIZATION): Whether to emit a per-class JSON type manifest (<Class>.json) describing the serialized properties and methods, for language-agnostic API bindings. Installed toshare/vtk*/types. Off by default; default builds emit no manifests and incur no extra parse. See .VTK_BUILD_MAVEN_PKG(defaultOFF; requiresVTK_WRAP_JAVA): Whether to build the Java Maven package for VTK.VTK_SMP_IMPLEMENTATION_TYPE(defaultSequential): Set which SMPTools will be implemented by default. Must be eitherSequential,STDThread,OpenMPorTBB. The backend can be changed at runtime if the desired backend has his optionVTK_SMP_ENABLE_<backend_name>set toON.VTK_ENABLE_CATALYST(defaultOFF): Enable catalyst-dependent modules including the VTK catalyst implementation. Depends on an external Catalyst.VTK_WEBASSEMBLY_64_BIT(defaultOFF): This option is applicable only when building with Emscripten toolchain. Adds -sMEMORY64 compiler and linker flags.VTK_WEBASSEMBLY_THREADS(defaultOFF): This option is applicable only when building with Emscripten toolchain. Adds-pthreadcompiler and linker flags. WhenVTK_BUILD_TESTINGisON, this also runs unit tests in web workers, which is the only way for the tests to reliably load data files without having to embed entire datasets inside the test binaries.VTK_WEBASSEMBLY_SMP_THREAD_POOL_SIZE(default0, means runtime hardware concurrency): This option can be used for limiting the number of webassembly threads consumed by SMP tools. By setting this you can reserve threads for your application to use.VTK_WEBASSEMBLY_LEGACY_EXCEPTIONS(defaultON): This option is applicable only when building with Emscripten toolchain. WhenON, VTK is compiled with the legacy Wasm EH proposal, matching emscripten's historical default (-sWASM_LEGACY_EXCEPTIONS=1). Set toOFFwhen the rest of the link — the consumer application and any other libraries — is built with-sWASM_LEGACY_EXCEPTIONS=0; the resulting binary then uses the standardized exception handling proposal end-to-end. Mixing both proposals causes the browser to reject the module at instantiate with "module uses a mix of legacy and new exception handling instructions".VTK_TESTING_WASM_ENGINE(default ``): Path to a wasm runtime executable. This is used to run C++ tests in wasm environments.VTK_WRAP_JAVASCRIPT(defaultOFF; requiresVTK_ENABLE_WRAPPING): Whether JavaScript support will be available or not.VTK_WASM_DEBUGINFO(defaultNONE): Extent of debug information in webassembly binaries when VTK_WRAP_JAVASCRIPT isON. Controls the debug flags that allow the compiler to collect the debugging information. Must be eitherNONE,READABLE_JS,PROFILEorDEBUG_NATIVE.VTK_WASM_OPTIMIZATION(defaultSMALL): Optimization knobs for the webassembly binaries when VTK_WRAP_JAVASCRIPT isON. Controls the optimization flags being used when running emcc. Must be eitherNO_OPTIMIZATION,LITTLE,MORE,BEST,SMALL,SMALLESTorSMALLEST_WITH_CLOSURE.VTK_WEBASSEMBLY_JOB_POOL_LINK_SIZE(default number of processors): Size of the job pool for linking wasm targets. Adjust as needed to avoid OOM errors.VTK_JPEG_ENABLE_SIMD(defaultOFF): Whether the libjpeg-turbo library should be compiled with SIMD extensions or not. On x86(-64) targets, NASM must be installed (or set its path by setting theCMAKE_ASM_NASM_COMPILERvariable). This is not compatible with WASM builds.
OpenGL related build options:
When OpenGL is used, a valid rendering environment (e.g., X, Cocoa, OSMesa, EGL) must be available. Sanity checks are in place to prevent a broken build.
For specific platforms:
- Android:
vtkEGLRenderWindowis the default. - macOS:
vtkCocoaRenderWindowis the default. - iOS:
vtkIOSRenderWindowis the default. - WebAssembly:
vtkWebAssemblyOpenGLRenderWindowis the default.
Please learn more about how you can influence the render window selection process in
Additional Rendering related build options:
On Linux, the order of render window attempts is:
vtkXOpenGLRenderWindowvtkEGLRenderWindowvtkOSOpenGLRenderWindow
On Windows:
vtkWin32OpenGLRenderWindowvtkOSOpenGLRenderWindow
By default, VTK automatically selects the most appropriate render window class at runtime. This selection process uses the Initialize method of the compiled subclass to test whether the chosen setup is valid. If the initialization succeeds, the corresponding render window instance is returned.
The default values of the following CMake VTK_OPENGL_HAS_* knobs are already configured so
that the above condition is always met on all supported platforms.
VTK_USE_COCOA(defaultON; requires macOS): Use Cocoa for render windows.VTK_USE_X(defaultONfor Unix-like platforms except macOS, iOS, and Emscripten,OFFotherwise): Use X for render windows.VTK_OPENGL_USE_GLES(defaultOFF; forcedONfor Android): Whether to use OpenGL ES API for OpenGL or not.VTK_OPENGL_HAS_EGL(defaultONfor Android and Linux,OFFotherwise): Use to indicate that the OpenGL library being used supports EGL context management.VTK_DEFAULT_EGL_DEVICE_INDEX(default0; requiresVTK_OPENGL_HAS_EGL): The default EGL device to use for EGL render windows.VTK_USE_WAYLAND_OPENGL(defaultOFF; requiresVTK_OPENGL_HAS_EGL): Use Wayland as backend for EGL render windows instead of X.VTK_ENABLE_WEBGPU(defaultOFF; required if using Emscripten): Enable WebGPU rendering support.VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN(defaultOFF): Whether to default to offscreen render windows by default or not.VTK_USE_OPENGL_DELAYED_LOAD(defaultOFF; requires Windows and CMake >= 3.13): If set, use delayed loading to load the OpenGL DLL at runtime.VTK_DEFAULT_RENDER_WINDOW_HEADLESS(defaultOFF; only available if applicable): Default to a headless render window.VTK_USE_WIN32_OPENGL(defaultONfor Windows, forcedOFFotherwise): Use Win32 APIs for render windows (typically only relevant for OSMesa on Windows builds).
More advanced options:
VTK_ABI_NAMESPACE_NAME(default<DEFAULT>aka""): If set, VTK will wrap all VTK public symbols in aninline namespace <VTK_ABI_NAMESPACE_NAME>to allow runtime co-habitation with different VTK versions. Some C ABIs are also wrapped in this namespace using macro expansion#define c_abi VTK_ABI_NAMESPACE_MANGLE(c_abi)VTK_ABI_NAMESPACE_ATTRIBUTES(default<DEFAULT>aka""): If set, VTK will inject these attributes into theinline namespace. i.e.inline namespace <VTK_ABI_NAMESPACE_ATTRIBUTES> <VTK_ABI_NAMESPACE_NAME>TheVTK_ABI_NAMESPACE_ATTRIBUTESis only applied the the APIs inside of the namespace, not to C APIs.VTK_BUILD_DOCUMENTATION(defaultOFF): If set, VTK will build its API documentation using Doxygen.VTK_BUILD_SPHINX_DOCUMENTATION(defaultOFF): If set, VTK will build its sphinx documentation website.VTK_BUILD_ALL_MODULES(defaultOFF): If set, VTK will enable all modules not disabled by other features.VTK_ENABLE_REMOTE_MODULES(defaultON): If set, VTK will try to build remote modules (theRemotedirectory). If unset, no remote modules will build.VTK_ENABLE_EXTRA_BUILD_WARNINGS(defaultOFF; requires CMake >= 3.19): If set, VTK will enable additional build warnings.VTK_ENABLE_EXTRA_BUILD_WARNINGS_EVERYTHING(defaultOFF; requiresVTK_ENABLE_EXTRA_BUILD_WARNINGSand-Weverythingsupport): If set, VTK will enable all build warnings (with some explicitly turned off).VTK_USE_EXTERNAL(defaultOFF): Whether to prefer external third party libraries or the versions VTK's source contains.VTK_TARGET_SPECIFIC_COMPONENTS(defaultOFF): Whether to install files into target-specific components (<TARGET>-runtime,<TARGET>-development, etc.) or general components (runtime,development, etc.)VTK_VERSIONED_INSTALL(defaultON): Whether to add version numbers to VTK's include directories and library names in the install tree.VTK_CUSTOM_LIBRARY_SUFFIX(default depends onVTK_VERSIONED_INSTALL): The custom suffix for libraries built by VTK. Defaults to either an empty string orX.YwhereXandYare VTK's major and minor version components, respectively.VTK_CUSTOM_LIBRARY_VERSION(default depends onVTK_VERSIONED_INSTALL): The custom version for libraries built by VTK. Defaults to either an empty string orX.YwhereXandYare VTK's major and minor version if VTK_VERSIONED_INSTALL is ON.VTK_INSTALL_SDK(defaultON): If set, VTK will install its headers, CMake API, etc. into its install tree for use.VTK_FORBID_DOWNLOADS(defaultOFF): If set, VTK will error on any network activity required during the build (namely remote modules and testing data).VTK_DATA_STORE(default is complicated): If set or detected, points to where VTK external data will be stored or looked up.VTK_DATA_EXCLUDE_FROM_ALL(default is complicated, but generallyOFF): If set or detected, data downloads will only happen upon explicit request rather than through the build's default target.VTK_RELOCATABLE_INSTALL(defaultON): If set, the install tree will be relocatable to another path. If unset, the install tree may be tied to the build machine with absolute paths, but finding dependencies in non-standard locations may require work without passing extra information when consuming VTK.VTK_UNIFIED_INSTALL_TREE(defaultOFF): If set, the install tree is stipulated to be a unified install tree of VTK and all of its dependencies; a unified tree usually simplifies things including, but not limited to, the Python module paths, library search paths, and plugin searching. This option is irrelevant if a relocatable install is requested as such setups assume that dependencies are set up either via a unified tree or some other mechanism such as modules).VTK_ENABLE_SANITIZER(defaultOFF): Whether to enable sanitization of the VTK codebase or not.VTK_SANITIZER(defaultaddress; requiresVTK_ENABLE_SANITIZER): The sanitizer to use.VTK_USE_LARGE_DATA(defaultOFF; requiresVTK_BUILD_TESTING): Whether to enable tests which use "large" data or not (usually used to reduce the amount of data downloading required for the test suite).VTK_USE_HIP(defaultOFF; requires CMAKE >= 3.21 and NOTVTK_USE_CUDA) Whether HIP support will be available or not.VTK_LEGACY_REMOVE(defaultOFF): If set, VTK will disable legacy, deprecated APIs.VTK_LEGACY_SILENT(defaultOFF; requiresVTK_LEGACY_REMOVEto beOFF): If set, usage of legacy, deprecated APIs will not cause warnings.VTK_USE_FUTURE_CONST(defaultOFF): If set, theVTK_FUTURE_CONSTmacro expands toconst; otherwise it expands to nothing. This is used to incrementally add more const correctness to the codebase while making it opt-in for backwards compatibility.VTK_USE_FUTURE_BOOL(defaultOFF): If set, thevtkTypeBooltypedef is defined tobool; otherwise it'sint. VTK was created before C++ even hadbool, and so its oldest code usedint. Set toONto opt in to using more realbools, set toOFFonly if required for backwards compatibility.VTK_USE_TK(defaultOFF; requiresVTK_WRAP_PYTHON): If set, VTK will enable Tkinter support for VTK widgets.VTK_BUILD_COMPILE_TOOLS_ONLY(defaultOFF): If set, VTK will compile just its compile tools for use in a cross-compile build.VTK_NO_PYTHON_THREADS(defaultOFF): If set, then all Python threading in VTK will be disabled.VTK_PYTHON_FULL_THREADSAFE(defaultON): If set, lock the Python GIL for Python C API calls, to make it safe to allow Python thread concurrency.VTK_SERIAL_TESTS_USE_MPIEXEC(defaultOFF): Used on HPC to run serial tests on compute nodes. If set, it prefixes serial tests with "{MPIEXEC_NUMPROC_FLAG}" "1" ${MPIEXEC_PREFLAGS}VTK_WINDOWS_PYTHON_DEBUGGABLE(defaultOFF): Set toONif using a debug build of Python.VTK_WINDOWS_PYTHON_DEBUGGABLE_REPLACE_SUFFIX(defaultOFF): Set toONto use just a_dsuffix for Python modules.VTK_BUILD_PYI_FILES(defaultOFF): Set toONto build.pyitype hint files for VTK's Python interfaces.VTK_DLL_PATHS(default""orVTK_DLL_PATHSfrom the environment): If set, these paths will be added via Python 3.8'sos.add_dll_directorymechanism in order to find dependent DLLs when loading VTK's Python modules. Note that when using the variable, paths are in CMake form (using/) and in the environment are a path list in the platform's preferred format.VTK_ENABLE_VR_COLLABORATION(defaultOFF): IfON, includes support for multi client VR collaboration. Requires libzmq and cppzmq external libraries.VTK_SMP_ENABLE_<backend_name>(defaultOFFif needs an external library otherwiseON): If set, builds with the specified SMPTools backend implementation that can be changed on runtime withVTK_SMP_BACKEND_IN_USEenvironment variable.VTK_USE_VIDEO_FOR_WINDOWS(defaultOFF; requires Windows): Enable thevtkAVIWriterclass in theVTK::IOMoviemodule.VTK_USE_VIDEO_FOR_WINDOWS_CAPTURE(defaultOFF; requires Windows): Enable thevtkWin32VideoSourceclass in theVTK::IOVideomodule.VTK_USE_MICROSOFT_MEDIA_FOUNDATION(defaultOFF; requires Windows): Enable thevtkMP4Writerclass in theVTK::IOMoviemodule.VTK_USE_64BIT_TIMESTAMPS(defaultOFF; forced on for 64-bit builds): Build with 64-bitvtkMTimeType.VTK_USE_64BIT_IDS(defaultOFFfor 32-bit builds;ONfor 64-bit builds): WhethervtkIdTypeshould be 32-bit or 64-bit.VTK_DEBUG_LEAKS(defaultOFF): Whether VTK will report leakedvtkObjectinstances at process destruction or not.VTK_DEBUG_RANGE_ITERATORS(defaultOFF; requires aDebugbuild): Detect errors withfor-rangeiterators in VTK (note that this is very slow).VTK_ALWAYS_OPTIMIZE_ARRAY_ITERATORS(defaultOFF; requiresNOT VTK_DEBUG_RANGE_ITERATORS): Optimizefor-rangearray iterators even inDebugbuilds.VTK_ALL_NEW_OBJECT_FACTORY(defaultOFF): IfON, classes usingvtkStandardNewMacrowill usevtkObjectFactoryNewMacroallowing overrides to be available even when not explicitly requested throughvtkObjectFactoryNewMacroorvtkAbstractObjectFactoryNewMacro.VTK_ENABLE_VISKORES_OVERRIDES(defaultOFF): IfON, enables factory override of certain VTK filters by their Viskores counterparts. There is also a runtime switch that can be used to enable/disable the overrides at run-time (on by default). It can be accessed using the static functionviskoresFilterOverrides::SetEnabled(bool).VTK_GENERATE_SPDX(defaultOFF): IfON, SPDX file will be generated at build time and installed for each module and third party, in order to be able to create a SBOM. See and for more info.VTK_ANARI_ENABLE_NVTX(defaultOFF; requires CUDA Toolkit): IfON, enables the NVIDIA Tools Extension Library (NVTX) for profiling the ANARI rendering code and visualizing these events in tools like NSight Systems.
vtkArrayDispatch related options:
The VTK_DISPATCH_<array_type>_ARRAYS options (default OFF for all but AOS) enable the
specified type of array to be included in a dispatch type list. Explicit arrays (such as
AOS, SOA, Typed, and implicit arrays) are included in the vtkArrayDispatchTypeList.h
The implicit array framework is included in the CommonCore module. The following array types
currently exist for use with the VTK dispatch mechanism:
VTK_DISPATCH_AOS_ARRAYS(defaultON): includes dispatching for the commonly used "array-of-structure" ordered arrays derived fromvtkAOSDataArrayTemplateVTK_DISPATCH_SOA_ARRAYS(defaultOFF): includes dispatching for "structure-of-array" ordered arrays derived fromvtkSOADataArrayTemplateVTK_DISPATCH_AFFINE_ARRAYS(defaultOFF): includes dispatching for linearly varyingvtkAffineArrays as part of the implicit array frameworkVTK_DISPATCH_CONSTANT_ARRAYS(defaultOFF): includes dispatching for constant arraysvtkConstantArrayas part of the implicit array frameworkVTK_DISPATCH_STRIDED_ARRAYS(defaultOFF): includes dispatching for strided arraysvtkStridedArrayas part of the implicit array frameworkVTK_DISPATCH_STRUCTURED_POINT_ARRAYS(defaultOFF): includes dispatching for structured point arraysvtkStructuredPointArrayas part of the implicit array framework
Adding increasing numbers of arrays in the dispatch mechanism can greatly slow down compile times.
The VTK module system provides a number of variables to control modules which are not otherwise controlled by the other options provided.
-
VTK_MODULE_USE_EXTERNAL_<name>(default depends onVTK_USE_EXTERNAL): Use an external source for the named third-party module rather than the copy contained within the VTK source tree.Activating this option within an interactive cmake configuration (i.e. ccmake, cmake-gui) could end up finding libraries in the standard locations rather than copies in non-standard locations. It is recommended to pass the variables necessary to find the intended external package to the first configure to avoid finding unintended copies of the external package. The variables which matter depend on the package being found, but those ending with `_LIBRARY` and `_INCLUDE_DIR` as well as the general CMake `find_package` variables ending with `_DIR` and `_ROOT` are likely candidates. Example: ``` ccmake -D HDF5_ROOT:PATH=/home/user/myhdf5 ../vtk/sources ``` -
VTK_MODULE_ENABLE_<name>(defaultDEFAULT): Change the build settings for the named module. Valid values are those for the module system's build settings (see below). -
VTK_GROUP_ENABLE_<name>(defaultDEFAULT): Change the default build settings for modules belonging to the named group. Valid values are those for the module system's build settings (see below).
For variables which use the module system's build settings, the valid values are as follows:
YES: Require the module to be built.WANT: Build the module if possible.DEFAULT: Use the settings by the module's groups andVTK_BUILD_ALL_MODULES.DONT_WANT: Don't build the module unless required as a dependency.NO: Do not build the module.
If any YES module requires a NO module, an error is raised.