From 939ddeac41da04605d091afbce4f2cec9b312bbe Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Thu, 4 Feb 2021 11:13:44 +0300 Subject: [PATCH] Moved ittapi to thirdparty (#4164) --- CMakeLists.txt | 2 +- openvino/itt/CMakeLists.txt | 31 --------------------- thirdparty/CMakeLists.txt | 1 + thirdparty/ittapi/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 32 deletions(-) create mode 100644 thirdparty/ittapi/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 998370d750a..105181b6f85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,8 +142,8 @@ function(openvino_developer_export_targets) "A list of OpenVINO exported components" FORCE) endfunction() -add_subdirectory(openvino) add_subdirectory(thirdparty) +add_subdirectory(openvino) build_ngraph() add_subdirectory(inference-engine) add_subdirectory(model-optimizer) diff --git a/openvino/itt/CMakeLists.txt b/openvino/itt/CMakeLists.txt index 22b287164fb..85a8cf19874 100644 --- a/openvino/itt/CMakeLists.txt +++ b/openvino/itt/CMakeLists.txt @@ -18,37 +18,6 @@ set(TARGET_NAME itt) file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp") -if(ENABLE_PROFILING_ITT) - if(DEFINED INTEL_VTUNE_DIR OR DEFINED ENV{INTEL_VTUNE_DIR}) - find_package(ITT - PATHS "${CMAKE_CURRENT_SOURCE_DIR}/cmake" - NO_DEFAULT_PATH) - if(NOT ITT_FOUND) - message(WARNING "Profiling option enabled, but no ITT library was found under INTEL_VTUNE_DIR") - endif() - else() - include(FetchContent) - FetchContent_Declare( - ext_ittapi - GIT_REPOSITORY https://github.com/intel/ittapi.git - GIT_TAG v3.18.6 - ) - - FetchContent_GetProperties(ext_ittapi) - if(NOT ext_ittapi_POPULATED) - FetchContent_Populate(ext_ittapi) - add_subdirectory(${ext_ittapi_SOURCE_DIR} ${ext_ittapi_BINARY_DIR}) - endif() - - target_compile_definitions(ittnotify INTERFACE ENABLE_PROFILING_ITT) - if (UNIX) - target_compile_options(ittnotify PRIVATE -Wno-undef) - endif() - - openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittnotify) - endif() -endif() - add_library(${TARGET_NAME} STATIC ${SOURCES}) add_library(openvino::itt ALIAS ${TARGET_NAME}) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 9aeae14b57f..efaa7c3ecdd 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -14,4 +14,5 @@ # limitations under the License. # ****************************************************************************** +add_subdirectory(ittapi) add_subdirectory(itt_collector) diff --git a/thirdparty/ittapi/CMakeLists.txt b/thirdparty/ittapi/CMakeLists.txt new file mode 100644 index 00000000000..f89bb0c0b1c --- /dev/null +++ b/thirdparty/ittapi/CMakeLists.txt @@ -0,0 +1,46 @@ +# ****************************************************************************** +# Copyright 2017-2021 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ****************************************************************************** + +if(ENABLE_PROFILING_ITT) + if(DEFINED INTEL_VTUNE_DIR OR DEFINED ENV{INTEL_VTUNE_DIR}) + find_package(ITT + PATHS "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + NO_DEFAULT_PATH) + if(NOT ITT_FOUND) + message(WARNING "Profiling option enabled, but no ITT library was found under INTEL_VTUNE_DIR") + endif() + else() + include(FetchContent) + FetchContent_Declare( + ext_ittapi + GIT_REPOSITORY https://github.com/intel/ittapi.git + GIT_TAG v3.18.6 + ) + + FetchContent_GetProperties(ext_ittapi) + if(NOT ext_ittapi_POPULATED) + FetchContent_Populate(ext_ittapi) + add_subdirectory(${ext_ittapi_SOURCE_DIR} ${ext_ittapi_BINARY_DIR}) + endif() + + target_compile_definitions(ittnotify INTERFACE ENABLE_PROFILING_ITT) + if (UNIX) + target_compile_options(ittnotify PRIVATE -Wno-undef) + endif() + + openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittnotify) + endif() +endif()