Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Fix CMake dependencies for component-only OpenVINO builds (#39292)

Maksim Doronin254987107e04
diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
index 8cc23e61f31..5e32e355e1f 100644
--- a/cmake/developer_package/frontends/frontends.cmake
+++ b/cmake/developer_package/frontends/frontends.cmake
@@ -37,7 +37,7 @@ function(ov_generate_frontends_hpp)
# add frontends to libraries including ov_frontends.hpp
ov_target_link_frontends(openvino)
- set(ov_frontends_hpp "${CMAKE_BINARY_DIR}/src/frontends/common/src/ov_frontends.hpp")
+ set(ov_frontends_hpp "${OpenVINO_BINARY_DIR}/src/frontends/common/src/ov_frontends.hpp")
set(frontends_hpp_in "${OpenVINODeveloperScripts_DIR}/frontends/ov_frontends.hpp.in")
add_custom_command(OUTPUT "${ov_frontends_hpp}"
diff --git a/src/plugins/intel_npu/CMakeLists.txt b/src/plugins/intel_npu/CMakeLists.txt
index 108714a9ea7..c4c59f84462 100644
--- a/src/plugins/intel_npu/CMakeLists.txt
+++ b/src/plugins/intel_npu/CMakeLists.txt
@@ -89,8 +89,10 @@ endif()
add_subdirectory(src)
-if(ENABLE_TESTS)
+if(ENABLE_TESTS AND ENABLE_NPU_PLUGIN_ENGINE)
add_subdirectory(tests)
+elseif(ENABLE_TESTS)
+ message(WARNING "NPU plugin tests are skipped because ENABLE_NPU_PLUGIN_ENGINE is OFF.")
endif()
if(ENABLE_INTEL_NPU_INTERNAL)
diff --git a/src/plugins/intel_npu/cmake/features.cmake b/src/plugins/intel_npu/cmake/features.cmake
index 51ee1458315..36a6593e385 100644
--- a/src/plugins/intel_npu/cmake/features.cmake
+++ b/src/plugins/intel_npu/cmake/features.cmake
@@ -4,10 +4,6 @@
ov_option(ENABLE_NPU_PLUGIN_ENGINE "Enable compilation of NPU plugin engine" ON)
-if(NOT ENABLE_NPU_PLUGIN_ENGINE AND ENABLE_TESTS)
- message(FATAL_ERROR "Tests depends on npu plugin engine!")
-endif()
-
ov_dependent_option(ENABLE_INTEL_NPU_PROTOPIPE "Enable Intel NPU Protopipe tool" ON "ENABLE_INTEL_NPU_INTERNAL" OFF)
ov_option(ENABLE_INTEL_NPU_COMPILER "Enable download of Intel NPU Compiler library" ${BUILD_SHARED_LIBS})
diff --git a/src/tests/test_utils/common_test_utils/CMakeLists.txt b/src/tests/test_utils/common_test_utils/CMakeLists.txt
index a6526618592..0b117cdd904 100644
--- a/src/tests/test_utils/common_test_utils/CMakeLists.txt
+++ b/src/tests/test_utils/common_test_utils/CMakeLists.txt
@@ -23,8 +23,6 @@ function(add_common_utils ADD_TARGET_NAME)
EXCLUDED_SOURCE_PATHS
${TARGET_EXCLUDED_SOURCE_PATHS}
ADD_CLANG_FORMAT
- DEPENDENCIES
- openvino_template_plugin
LINK_LIBRARIES
PUBLIC
gtest
@@ -43,6 +41,10 @@ function(add_common_utils ADD_TARGET_NAME)
"${OpenVINO_SOURCE_DIR}/src/plugins/template/include"
)
+ if(ENABLE_TEMPLATE)
+ add_dependencies(${ADD_TARGET_NAME} openvino_template_plugin)
+ endif()
+
ov_developer_package_export_targets(TARGET ${ADD_TARGET_NAME}
INSTALL_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/")