From 4091b6c2bf0bd01fd425aae9e91040ce9a7d0487 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 10 Oct 2023 13:34:10 +0800 Subject: [PATCH] Fixed compilation when building out of OV source tree --- modules/nvidia_plugin/CMakeLists.txt | 12 +++++------- modules/nvidia_plugin/src/CMakeLists.txt | 4 ++-- .../nvidia_plugin/tests/functional/CMakeLists.txt | 9 +++------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/modules/nvidia_plugin/CMakeLists.txt b/modules/nvidia_plugin/CMakeLists.txt index b05fbadb1..4a40aee55 100644 --- a/modules/nvidia_plugin/CMakeLists.txt +++ b/modules/nvidia_plugin/CMakeLists.txt @@ -3,7 +3,7 @@ # cmake_minimum_required(VERSION 3.13) -project(InferenceEngineNVIDIAGpuPlugin CXX CUDA) +project(OpenVINONVIDIAGpuPlugin CXX CUDA) # Initialize CMAKE_CUDA_ARCHITECTURES when CMAKE_CUDA_COMPILER_ID is NVIDIA. # Raise an error if CUDA_ARCHITECTURES is empty. @@ -26,8 +26,6 @@ if (ENABLE_CUDNN_BACKEND_API) add_definitions(-DENABLE_CUDNN_BACKEND_API) endif() -set(IE_MAIN_CUDA_PLUGIN_SOURCE_DIR ${InferenceEngineNVIDIAGpuPlugin_SOURCE_DIR}) - find_package(OpenVINODeveloperPackage REQUIRED PATHS "${InferenceEngineDeveloperPackage_DIR}") @@ -35,7 +33,7 @@ include(cmake/features.cmake) set(HAS_REQUIRED REQUIRED) -if(${CMAKE_VERSION} VERSION_LESS "3.17.0") +if(CMAKE_VERSION VERSION_LESS 3.17.0) set(HAS_REQUIRED) find_package(CUDA REQUIRED) set(CUDAToolkit_VERSION_MAJOR ${CUDA_VERSION_MAJOR}) @@ -149,7 +147,7 @@ include(FetchContent) FetchContent_Declare(GSL GIT_REPOSITORY "https://github.com/microsoft/GSL" GIT_TAG "v3.1.0") -if(${CMAKE_VERSION} VERSION_LESS "3.14.0") +if(CMAKE_VERSION VERSION_LESS 3.14.0) FetchContent_GetProperties(GSL) if(NOT GSL_POPULATED) FetchContent_Populate(GSL) @@ -165,7 +163,7 @@ set_property(TARGET GSL PROPERTY INTERFACE_COMPILE_FEATURES) FetchContent_Declare(fmt-header-only GIT_REPOSITORY "https://github.com/fmtlib/fmt" GIT_TAG "7.1.3") -if(${CMAKE_VERSION} VERSION_LESS "3.14.0") +if(CMAKE_VERSION VERSION_LESS 3.14.0) FetchContent_GetProperties(fmt-header-only) if(NOT fmt-header-only_POPULATED) FetchContent_Populate(fmt-header-only) @@ -194,4 +192,4 @@ endif() # install # ATTENTION: uncomment to install component -# ie_cpack(template) +# ov_cpack(template) diff --git a/modules/nvidia_plugin/src/CMakeLists.txt b/modules/nvidia_plugin/src/CMakeLists.txt index c3e087911..e95f98e4e 100644 --- a/modules/nvidia_plugin/src/CMakeLists.txt +++ b/modules/nvidia_plugin/src/CMakeLists.txt @@ -43,7 +43,7 @@ ov_mark_target_as_cc(${TARGET_NAME}) set_property(TARGET ${OBJ_NAME} PROPERTY CUDA_ARCHITECTURES ${CMAKE_CUDA_ARCHITECTURES}) -ieTargetLinkWholeArchive(${TARGET_NAME} ${OBJ_NAME}) +ov_target_link_whole_archive(${TARGET_NAME} ${OBJ_NAME}) target_include_directories(${OBJ_NAME} SYSTEM PUBLIC @@ -53,7 +53,7 @@ target_include_directories(${OBJ_NAME} PUBLIC "${CUTENSOR_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" - "${IE_MAIN_CUDA_PLUGIN_SOURCE_DIR}/include" + "${OpenVINONVIDIAGpuPlugin_SOURCE_DIR}/include" PRIVATE $ ) diff --git a/modules/nvidia_plugin/tests/functional/CMakeLists.txt b/modules/nvidia_plugin/tests/functional/CMakeLists.txt index e9860db1a..0c116a594 100644 --- a/modules/nvidia_plugin/tests/functional/CMakeLists.txt +++ b/modules/nvidia_plugin/tests/functional/CMakeLists.txt @@ -3,14 +3,12 @@ # SPDX-License-Identifier: Apache-2.0 # -# [cmake:functional_tests] set(TARGET_NAME ov_nvidia_func_tests) -if (ENABLE_INTEL_CPU) +# TODO: remove dependency on CPU plugin after migration to tests for API 2.0 +if(CMAKE_SOURCE_DIR STREQUAL OpenVINO_SOURCE_DIR AND ENABLE_INTEL_CPU) set(OPENVINO_ADDITIONAL_DEPENDENCIES openvino_intel_cpu_plugin) -else(ENABLE_INTEL_CPU) - set(OPENVINO_ADDITIONAL_DEPENDENCIES) -endif (ENABLE_INTEL_CPU) +endif() ov_add_test_target( NAME @@ -34,4 +32,3 @@ ov_add_test_target( if(ENABLE_PROXY) target_compile_definitions(${TARGET_NAME} PUBLIC PROXY_PLUGIN_ENABLED) endif() -# [cmake:functional_tests]