diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in index 96df86520a2..09dc382fae3 100644 --- a/cmake/templates/OpenVINOConfig.cmake.in +++ b/cmake/templates/OpenVINOConfig.cmake.in @@ -274,6 +274,14 @@ endfunction() # OpenVINO config # +cmake_policy(PUSH) +# we need CMP0057 to allow IN_LIST in if() command +if(POLICY CMP0057) + cmake_policy(SET CMP0057 NEW) +else() + message(FATAL_ERROR "OpenVINO requires CMake 3.3 or newer") +endif() + # need to store current PACKAGE_PREFIX_DIR, because it's overwritten by sub-package one set(_ov_package_prefix_dir "${PACKAGE_PREFIX_DIR}") @@ -289,10 +297,30 @@ _ov_find_dependency(Threads) unset(_OV_ENABLE_OPENVINO_BUILD_SHARED) +set(RUNTIME_AND_FRONTEND_TARGETS openvino::runtime openvino::runtime::c + openvino::frontend::onnx openvino::frontend::paddle + openvino::frontend::tensorflow) + if(NOT TARGET openvino) set(_ov_as_external_package ON) include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") + foreach(target ${RUNTIME_AND_FRONTEND_TARGETS}) + if(TARGET ${target}) + get_target_property(ORIGINAL_NAME ${target} ALIASED_TARGET) + if (ORIGINAL_NAME MATCHES "ORIGINAL_NAME-NOTFOUND") + set (ORIGINAL_NAME ${target}) + endif() + get_target_property(imported_configs ${target} IMPORTED_CONFIGURATIONS) + if(RELWITHDEBINFO IN_LIST imported_configs) + set (MAP_CONFIG RELWITHDEBINFO) + else() + set (MAP_CONFIG RELEASE) + endif() + set_property(TARGET ${ORIGINAL_NAME} PROPERTY MAP_IMPORTED_CONFIG_RELWITHDEBINFO ${MAP_CONFIG}) + endif() + endforeach() + # WA for cmake version < 3.16 which does not export # IMPORTED_LINK_DEPENDENT_LIBRARIES_** properties if no PUBLIC dependencies for the library if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBB_FOUND) @@ -332,8 +360,7 @@ endif() # Apply common functions # -foreach(target openvino::runtime openvino::runtime::c - openvino::frontend::onnx openvino::frontend::paddle openvino::frontend::tensorflow) +foreach(target ${RUNTIME_AND_FRONTEND_TARGETS}) if(TARGET ${target} AND _ov_as_external_package) _ov_target_no_deprecation_error(${target}) endif() @@ -351,7 +378,10 @@ if(_need_package_name_reset) unset(_need_package_name_reset) endif() +unset(RUNTIME_AND_FRONTEND_TARGETS) unset(${CMAKE_FIND_PACKAGE_NAME}_IR_FOUND) unset(${CMAKE_FIND_PACKAGE_NAME}_Paddle_FOUND) unset(${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND) unset(${CMAKE_FIND_PACKAGE_NAME}_TensorFlow_FOUND) + +cmake_policy(POP) diff --git a/samples/cpp/build_samples_msvc.bat b/samples/cpp/build_samples_msvc.bat index 66540383922..828e6079362 100644 --- a/samples/cpp/build_samples_msvc.bat +++ b/samples/cpp/build_samples_msvc.bat @@ -6,7 +6,7 @@ @setlocal SETLOCAL EnableDelayedExpansion set "ROOT_DIR=%~dp0" -FOR /F "delims=\" %%i IN ("%ROOT_DIR%") DO set SAMPLES_TYPE=%%~nxi +FOR %%i IN ("%ROOT_DIR%\.") DO set SAMPLES_TYPE=%%~nxi set "SAMPLE_BUILD_DIR=%USERPROFILE%\Documents\Intel\OpenVINO\openvino_%SAMPLES_TYPE%_samples_build" set SAMPLE_INSTALL_DIR= @@ -49,7 +49,7 @@ if "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( if exist "%SAMPLE_BUILD_DIR%\CMakeCache.txt" del "%SAMPLE_BUILD_DIR%\CMakeCache.txt" -cd /d "%ROOT_DIR%" && cmake -E make_directory "%SAMPLE_BUILD_DIR%" && cd /d "%SAMPLE_BUILD_DIR%" && cmake -G "Visual Studio 16 2019" -A %PLATFORM% "%ROOT_DIR%" +cd /d "%ROOT_DIR%" && cmake -E make_directory "%SAMPLE_BUILD_DIR%" && cd /d "%SAMPLE_BUILD_DIR%" && cmake -A %PLATFORM% "%ROOT_DIR%" if ERRORLEVEL 1 GOTO errorHandling echo. diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp index e14fc1bc834..44256e68759 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp @@ -57,7 +57,6 @@ public: } static kernel_params_t get_kernel_params(const kernel_impl_params& impl_param) { - const auto& primitive = impl_param.typed_desc(); auto params = get_default_params(impl_param, 1); auto optional_params = get_default_optional_params(impl_param.get_program()); diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp index 1bb61859de3..ef1765e04d1 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp @@ -27,7 +27,6 @@ struct gather_tree_impl : typed_primitive_impl_ocl { } static kernel_params_t get_kernel_params(const kernel_impl_params& impl_param) { - const auto& primitive = impl_param.typed_desc(); auto params = get_default_params(impl_param, 1); auto optional_params = get_default_optional_params(impl_param.get_program()); diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp index b7bd6af0a90..7ed227c034d 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp @@ -26,7 +26,6 @@ struct range_impl : typed_primitive_impl_ocl { } static kernel_params_t get_kernel_params(const kernel_impl_params& impl_param) { - const auto& primitive = impl_param.typed_desc(); auto params = get_default_params(impl_param); for (int i : {1, 2}) params.inputs.push_back(convert_data_tensor(impl_param.get_input_layout(i))); diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp index 2c4115c916e..f5f93845cd6 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp @@ -61,7 +61,6 @@ protected: public: static kernel_params_t get_kernel_params(const kernel_impl_params& impl_param) { const auto& primitive = impl_param.typed_desc(); - const auto& input_layout = impl_param.get_input_layout(0); const auto& rois_layout = impl_param.get_input_layout(1); const auto& batches_layout = impl_param.get_input_layout(2); diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp index 85d8771d928..aa953467f95 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp @@ -26,7 +26,6 @@ struct select_impl : typed_primitive_impl_ocl(); auto params = get_default_params(impl_param); auto optional_params = get_default_optional_params(impl_param.get_program()); diff --git a/src/plugins/intel_gpu/src/graph/select.cpp b/src/plugins/intel_gpu/src/graph/select.cpp index 67d15063c73..242e2a8cd63 100644 --- a/src/plugins/intel_gpu/src/graph/select.cpp +++ b/src/plugins/intel_gpu/src/graph/select.cpp @@ -159,7 +159,7 @@ select_inst::typed_primitive_inst(network& network, select_node const& node) : p } } } else { - CLDNN_ERROR_MESSAGE(node.id(), "Unsupported broadcast_type: " + static_cast(node.get_primitive()->broadcast_spec.m_type)); + CLDNN_ERROR_MESSAGE(node.id(), "Unsupported broadcast_type: " + std::to_string(static_cast(node.get_primitive()->broadcast_spec.m_type))); } } } // namespace cldnn diff --git a/src/plugins/intel_gpu/src/plugin/infer_request.cpp b/src/plugins/intel_gpu/src/plugin/infer_request.cpp index 04402cd0b2b..4ac8877c0f9 100644 --- a/src/plugins/intel_gpu/src/plugin/infer_request.cpp +++ b/src/plugins/intel_gpu/src/plugin/infer_request.cpp @@ -23,7 +23,6 @@ using namespace InferenceEngine; namespace { -const char str_device_input_unsupported_blob[] = "Device input is of an unsupported blob type."; const char str_device_output_unsupported_blob[] = "Device output is of an unsupported blob type."; const char str_input_not_allocated[] = "Input data was not allocated."; const char str_output_not_allocated[] = "Output data was not allocated.";