OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#
# Common cmake options
#
ov_option (ENABLE_PROXY "Proxy plugin for OpenVINO Runtime" ON)
if(WIN32 AND AARCH64 AND NOT CMAKE_CL_64)
set(ENABLE_INTEL_CPU_DEFAULT OFF)
else()
set(ENABLE_INTEL_CPU_DEFAULT ON)
endif()
ov_dependent_option (ENABLE_INTEL_CPU "CPU plugin for OpenVINO Runtime" ${ENABLE_INTEL_CPU_DEFAULT}
"RISCV64 OR X86 OR X86_64 OR AARCH64 OR ARM" OFF)
ov_dependent_option (ENABLE_ARM_COMPUTE_CMAKE "Enable ARM Compute build via cmake" OFF "ENABLE_INTEL_CPU" OFF)
ov_option (ENABLE_TESTS "unit, behavior and functional tests" OFF)
ov_option (ENABLE_TESTS_PER_SOURCE "Create one test executable per source file" OFF)
if(ENABLE_TESTS)
include(CTest)
enable_testing()
endif()
if(X86_64)
set(ENABLE_INTEL_GPU_DEFAULT ON)
else()
set(ENABLE_INTEL_GPU_DEFAULT OFF)
endif()
ov_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF)
if (APPLE OR ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
# oneDNN doesn't support old compilers and Android builds for now, so we'll build GPU plugin without oneDNN
set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF)
else()
set(ENABLE_ONEDNN_FOR_GPU_DEFAULT ON)
endif()
ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ${ENABLE_ONEDNN_FOR_GPU_DEFAULT} "ENABLE_INTEL_GPU" OFF)
# Set default GPU runtime to OCL. COMBINED (build ZE and OCL plugins side by side) is
# opt-in only; the default is never flipped.
set(OV_GPU_DEFAULT_RT "OCL")
if (ENABLE_INTEL_GPU)
ov_option_enum (GPU_RT_TYPE "Type of GPU runtime. Supported values: OCL (default), SYCL, ZE (L0 alias), and COMBINED (ZE+OCL, shared builds only)" ${OV_GPU_DEFAULT_RT} ALLOWED_VALUES ZE OCL L0 SYCL COMBINED)
if(GPU_RT_TYPE STREQUAL "L0")
set(GPU_RT_TYPE "ZE" CACHE STRING "Type of GPU runtime" FORCE)
endif()
# COMBINED ships two plugin libraries via plugins.xml, which requires shared libs.
if(GPU_RT_TYPE STREQUAL "COMBINED" AND NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "GPU_RT_TYPE=COMBINED requires BUILD_SHARED_LIBS=ON. "
"Static/monolithic builds support a single GPU runtime only.")
endif()
ov_option_enum (GPU_VENDOR "Target GPU vendor. Supported values: INTEL (default) and NVIDIA (SYCL runtime only)" INTEL
ALLOWED_VALUES INTEL NVIDIA)
# NVIDIA builds rely on the SYCL runtime and oneDNN, and do not support static builds yet.
if(GPU_VENDOR STREQUAL "NVIDIA")
if(NOT GPU_RT_TYPE STREQUAL "SYCL")
message(FATAL_ERROR "GPU_VENDOR=NVIDIA requires GPU_RT_TYPE=SYCL")
endif()
if(NOT ENABLE_ONEDNN_FOR_GPU)
message(FATAL_ERROR "GPU_VENDOR=NVIDIA requires ENABLE_ONEDNN_FOR_GPU=ON")
endif()
if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "GPU_VENDOR=NVIDIA does not support static builds (BUILD_SHARED_LIBS=OFF) yet")
endif()
endif()
endif()
if(APPLE)
set(ENABLE_CM_FOR_GPU_DEFAULT OFF)
else()
set(ENABLE_CM_FOR_GPU_DEFAULT ON)
endif()
ov_dependent_option (ENABLE_CM_FOR_GPU "Enable C for Metal (CM) kernels at GPU runtime" ${ENABLE_CM_FOR_GPU_DEFAULT} "ENABLE_INTEL_GPU" OFF)
ov_dependent_option (ENABLE_INTEL_NPU "NPU plugin for OpenVINO runtime" ON "X86_64;WIN32 OR LINUX OR ANDROID" OFF)
# matches ENABLE_INTEL_NPU_COMPILER default: internal NPU tools aren't built for static libs
ov_dependent_option (ENABLE_INTEL_NPU_INTERNAL "NPU plugin internal components for OpenVINO runtime" ${BUILD_SHARED_LIBS} "ENABLE_INTEL_NPU" OFF)
ov_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF)
ov_dependent_option (ENABLE_NPU_DEBUG_CAPS "enable NPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_NPU" OFF)
ov_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_GPU" OFF)
ov_dependent_option (ENABLE_MLIR_FOR_GPU "Enable MLIR / Graph Compiler based execution in GPU plugin [EXPERIMENTAL, NOT PRODUCTION-READY]" OFF "ENABLE_INTEL_GPU;ENABLE_GPU_DEBUG_CAPS;NOT GPU_RT_TYPE STREQUAL SYCL" OFF)
ov_dependent_option (ENABLE_CPU_DEBUG_CAPS "enable CPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_CPU" OFF)
ov_dependent_option (ENABLE_SNIPPETS_DEBUG_CAPS "enable Snippets debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS" OFF)
ov_dependent_option (ENABLE_SNIPPETS_LIBXSMM_TPP "allow Snippets to use LIBXSMM Tensor Processing Primitives" OFF "ENABLE_INTEL_CPU AND (X86_64 OR AARCH64)" OFF)
## ITT tracing level: OFF | BASE | FULL
# OFF - no ITT backend linked; macros are no-ops
# BASE - link ITT backend; only top-level API scopes are active (default)
# FULL - link ITT backend; preserve full instrumentation (default prior behavior)
ov_option_enum(ENABLE_PROFILING_ITT "ITT tracing mode: OFF | BASE | FULL" BASE
ALLOWED_VALUES OFF BASE FULL)
ov_option_enum(ENABLE_PROFILING_FILTER "Enable or disable ITT counter groups.\
Supported values:\
ALL - enable all ITT counters (default value)\
FIRST_INFERENCE - enable only first inference time counters" ALL
ALLOWED_VALUES ALL FIRST_INFERENCE)
ov_option (ENABLE_PROFILING_FIRST_INFERENCE "Build with ITT tracing of first inference time." ON)
ov_option_enum(SELECTIVE_BUILD "Enable OpenVINO conditional compilation or statistics collection. \
In case SELECTIVE_BUILD is enabled, the SELECTIVE_BUILD_STAT variable should contain the path to the collected IntelSEAPI statistics. \
Usage: -DSELECTIVE_BUILD=ON -DSELECTIVE_BUILD_STAT=/path/*.csv" OFF
ALLOWED_VALUES ON OFF COLLECT)
ov_option (ENABLE_DOCS "Build docs using Doxygen" OFF)
find_package(PkgConfig QUIET)
ov_dependent_option (ENABLE_PKGCONFIG_GEN "Enable openvino.pc pkg-config file generation" ON "LINUX OR APPLE;PkgConfig_FOUND;BUILD_SHARED_LIBS" OFF)
#
# OpenVINO Runtime specific options
#
# "OneDNN library based on OMP or TBB or Sequential implementation: TBB|OMP|SEQ|TBB_ADAPTIVE"
if(AARCH64)
set(THREADING_DEFAULT "TBB")
else()
set(THREADING_DEFAULT "TBB_ADAPTIVE")
endif()
set(THREADING_OPTIONS "TBB" "TBB_AUTO" "SEQ" "OMP" "TBB_ADAPTIVE")
set(THREADING "${THREADING_DEFAULT}" CACHE STRING "Threading")
set_property(CACHE THREADING PROPERTY STRINGS ${THREADING_OPTIONS})
list (APPEND OV_OPTIONS THREADING)
if(NOT THREADING IN_LIST THREADING_OPTIONS)
message(FATAL_ERROR "THREADING should be set to either ${THREADING_OPTIONS}")
endif()
if(X86_64 AND (WIN32 OR LINUX))
# we have a precompiled version of Intel OMP only for this platforms
set(ENABLE_INTEL_OPENMP_DEFAULT ON)
else()
set(ENABLE_INTEL_OPENMP_DEFAULT OFF)
endif()
ov_dependent_option (ENABLE_INTEL_OPENMP "Enables usage of Intel OpenMP instead of default compiler one" ${ENABLE_INTEL_OPENMP_DEFAULT} "THREADING STREQUAL OMP" OFF)
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" OR THREADING STREQUAL "TBB_ADAPTIVE") AND
(BUILD_SHARED_LIBS OR (LINUX AND X86_64)))
set(ENABLE_TBBBIND_2_5_DEFAULT ON)
else()
set(ENABLE_TBBBIND_2_5_DEFAULT OFF)
endif()
ov_dependent_option (ENABLE_TBBBIND_2_5 "Enable TBBBind_2_5 static usage in OpenVINO runtime" ${ENABLE_TBBBIND_2_5_DEFAULT} "THREADING MATCHES TBB; NOT APPLE" OFF)
ov_option (ENABLE_MULTI "Enables MULTI Device Plugin" ON)
ov_option (ENABLE_AUTO "Enables AUTO Device Plugin" ON)
ov_option (ENABLE_AUTO_BATCH "Enables Auto-Batching Plugin" ON)
ov_option (ENABLE_HETERO "Enables Hetero Device Plugin" ON)
ov_option (ENABLE_TEMPLATE "Enable template plugin" ON)
ov_dependent_option (ENABLE_PLUGINS_XML "Generate plugins.xml configuration file or not" OFF "BUILD_SHARED_LIBS" OFF)
ov_dependent_option (ENABLE_FUNCTIONAL_TESTS "functional tests" ON "ENABLE_TESTS" OFF)
ov_option (ENABLE_SAMPLES "console samples are part of OpenVINO Runtime package" ON)
set(OPENVINO_EXTRA_MODULES "" CACHE STRING "Extra paths for extra modules to include into OpenVINO build")
ov_option (ENABLE_GIL_PYTHON_API "Build Python API with Global Interpreter Lock" ON)
find_host_package(Python3 QUIET COMPONENTS Interpreter)
if(Python3_Interpreter_FOUND)
ov_option(ENABLE_OV_ONNX_FRONTEND "Enable ONNX FrontEnd" ON)
else()
ov_option(ENABLE_OV_ONNX_FRONTEND "Enable ONNX FrontEnd" OFF)
endif()
ov_option(ENABLE_OV_PADDLE_FRONTEND "Enable PaddlePaddle FrontEnd" ON)
ov_option(ENABLE_OV_IR_FRONTEND "Enable IR FrontEnd" ON)
ov_option(ENABLE_OV_PYTORCH_FRONTEND "Enable PyTorch FrontEnd" ON)
ov_option(ENABLE_OV_JAX_FRONTEND "Enable JAX FrontEnd" ON)
ov_option(ENABLE_OV_TF_FRONTEND "Enable TensorFlow FrontEnd" ON)
ov_option(ENABLE_OV_TF_LITE_FRONTEND "Enable TensorFlow Lite FrontEnd" ON)
ov_option(ENABLE_OV_GGUF_FRONTEND "Enable GGUF FrontEnd" ON)
if(WIN32 AND AARCH64 AND CMAKE_CL_64)
# Failed: openvino/src/bindings/js/node/thirdparty/node-lib.def: no such file or directory
set(ENABLE_JS_DEFAULT OFF)
# Some flags for building are failed on clang-cl win arm in snappy compression lib
set(ENABLE_SNAPPY_COMPRESSION_DEFAULT OFF)
else()
set(ENABLE_JS_DEFAULT ON)
set(ENABLE_SNAPPY_COMPRESSION_DEFAULT ON)
endif()
ov_dependent_option(ENABLE_SNAPPY_COMPRESSION "Enables compression support for TF FE" ${ENABLE_SNAPPY_COMPRESSION_DEFAULT}
"ENABLE_OV_TF_FRONTEND" OFF)
ov_dependent_option (ENABLE_STRICT_DEPENDENCIES "Skip configuring \"convinient\" dependencies for efficient parallel builds" ON "ENABLE_TESTS;ENABLE_OV_ONNX_FRONTEND" OFF)
if(CMAKE_HOST_LINUX AND LINUX)
# Debian packages are enabled on Ubuntu systems
# so, system TBB / pugixml / OpenCL can be tried for usage
set(ENABLE_SYSTEM_LIBS_DEFAULT ON)
else()
set(ENABLE_SYSTEM_LIBS_DEFAULT OFF)
endif()
if(CMAKE_CROSSCOMPILING AND (ANDROID OR RISCV64))
# when protobuf from /usr/include is used, then Android / Risc-V toolchain ignores include paths
# but if we build for Android using vcpkg / conan / etc where flatbuffers is not located in
# the /usr/include folders, we can still use 'system' flatbuffers
set(ENABLE_SYSTEM_FLATBUFFERS_DEFAULT OFF)
else()
set(ENABLE_SYSTEM_FLATBUFFERS_DEFAULT ON)
endif()
# use system TBB only for Debian / RPM packages
if(CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW|CONAN|VCPKG)$")
set(ENABLE_SYSTEM_TBB_DEFAULT ${ENABLE_SYSTEM_LIBS_DEFAULT})
else()
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
endif()
ov_dependent_option (ENABLE_SYSTEM_TBB "Enables use of system TBB" ${ENABLE_SYSTEM_TBB_DEFAULT}
"THREADING MATCHES TBB" OFF)
ov_option (ENABLE_SYSTEM_PUGIXML "Enables use of system PugiXML" OFF)
# the option is on by default, because we use only flatc compiler and don't use any libraries
ov_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Enables use of system flatbuffers" ${ENABLE_SYSTEM_FLATBUFFERS_DEFAULT}
"ENABLE_OV_TF_LITE_FRONTEND OR ENABLE_INTEL_NPU" OFF)
if(APPLE)
set(ENABLE_SYSTEM_OPENCL_DEFAULT ON)
else()
set(ENABLE_SYSTEM_OPENCL_DEFAULT ${ENABLE_SYSTEM_LIBS_DEFAULT})
endif()
ov_dependent_option (ENABLE_SYSTEM_OPENCL "Enables use of system OpenCL" ${ENABLE_SYSTEM_OPENCL_DEFAULT}
"ENABLE_INTEL_GPU" OFF)
# the option is turned off by default, because we compile our own static version of protobuf
# with LTO and -fPIC options, while system one does not have such flags
ov_dependent_option (ENABLE_SYSTEM_PROTOBUF "Enables use of system Protobuf" OFF
"ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_TF_FRONTEND" OFF)
# the option is turned off by default, because we don't want to have a dependency on libsnappy.so
ov_dependent_option (ENABLE_SYSTEM_SNAPPY "Enables use of system version of Snappy" OFF
"ENABLE_SNAPPY_COMPRESSION" OFF)
# the option is turned off by default, because we are not sure that system version of ZE loader is fresh enough
ov_dependent_option (ENABLE_SYSTEM_LEVEL_ZERO "Enables use of system version of Level Zero" OFF
"ENABLE_INTEL_NPU OR ENABLE_INTEL_GPU" OFF)
ov_dependent_option(ENABLE_JS "Enables JS API building" ${ENABLE_JS_DEFAULT} "NOT ANDROID;NOT EMSCRIPTEN" OFF)
ov_option(ENABLE_OPENVINO_DEBUG "Enable output for OPENVINO_DEBUG statements" OFF)
ov_dependent_option(ENABLE_IO_URING "Enables io_uring feature" OFF "LINUX" OFF)
ov_dependent_option (ENABLE_IPF_CLIENT_API "Enable IPF ClientApi integration for AUTO device telemetry" ON "MSVC;ENABLE_AUTO" OFF)
if(NOT BUILD_SHARED_LIBS AND ENABLE_OV_TF_FRONTEND)
set(FORCE_FRONTENDS_USE_PROTOBUF ON)
else()
set(FORCE_FRONTENDS_USE_PROTOBUF OFF)
endif()
# COMBINED includes a ZE build, so it needs the Level Zero loader too.
if(ENABLE_INTEL_NPU OR (ENABLE_INTEL_GPU AND (GPU_RT_TYPE STREQUAL "ZE" OR GPU_RT_TYPE STREQUAL "COMBINED")))
set(ENABLE_OV_ZERO_LOADER ON)
else()
set(ENABLE_OV_ZERO_LOADER OFF)
endif()
#
# Process featues
#
if(ENABLE_OPENVINO_DEBUG)
add_definitions(-DENABLE_OPENVINO_DEBUG)
endif()
if(ENABLE_DEBUG_CAPS)
add_definitions(-DENABLE_DEBUG_CAPS)
endif()
if (ENABLE_SNIPPETS_DEBUG_CAPS)
add_definitions(-DSNIPPETS_DEBUG_CAPS)
endif()
ov_print_enabled_features()