summaryrefslogtreecommitdiff
path: root/python/openvino/runtime/common/utils/CMakeLists.txt
diff options
context:
space:
mode:
authorEric Dao <eric@erickhangdao.com>2025-03-10 17:54:31 -0400
committerEric Dao <eric@erickhangdao.com>2025-03-10 17:54:31 -0400
commitab224e2e6ba65f5a369ec392f99cd8845ad06c98 (patch)
treea1e757e9341863ed52b8ad4c5a1c45933aab9da4 /python/openvino/runtime/common/utils/CMakeLists.txt
parent40da1752f2c8639186b72f6838aa415e854d0b1d (diff)
downloadthesis-master.tar.gz
thesis-master.tar.bz2
thesis-master.zip
completed thesisHEADmaster
Diffstat (limited to 'python/openvino/runtime/common/utils/CMakeLists.txt')
-rw-r--r--python/openvino/runtime/common/utils/CMakeLists.txt61
1 files changed, 61 insertions, 0 deletions
diff --git a/python/openvino/runtime/common/utils/CMakeLists.txt b/python/openvino/runtime/common/utils/CMakeLists.txt
new file mode 100644
index 0000000..e1e7293
--- /dev/null
+++ b/python/openvino/runtime/common/utils/CMakeLists.txt
@@ -0,0 +1,61 @@
+# Copyright (C) 2018-2022 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+#
+set(TARGET_NAME "ie_samples_utils")
+
+file(GLOB_RECURSE SOURCES "*.cpp" "*.hpp" "*.h")
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
+
+add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${SOURCES})
+set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "src")
+
+target_include_directories(${TARGET_NAME}
+ PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
+
+find_package(OpenVINO REQUIRED COMPONENTS Runtime)
+
+if(TARGET gflags)
+ set(GFLAGS_TARGET gflags)
+else()
+ if(EXISTS /etc/debian_version)
+ set(gflags_component nothreads_static)
+ else()
+ find_package(gflags QUIET OPTIONAL_COMPONENTS nothreads_static)
+ if(NOT gflags_FOUND)
+ set(gflags_component shared)
+ else()
+ set(gflags_component nothreads_static)
+ endif()
+ endif()
+ find_package(gflags QUIET OPTIONAL_COMPONENTS ${gflags_component})
+ if(gflags_FOUND)
+ if(TARGET ${GFLAGS_TARGET})
+ # nothing
+ elseif(TARGET gflags_nothreads-static)
+ # Debian 9: gflag_component is ignored
+ set(GFLAGS_TARGET gflags_nothreads-static)
+ elseif(TARGET gflags-shared)
+ # gflags shared case for CentOS / RHEL / Fedora
+ set(GFLAGS_TARGET gflags-shared)
+ else()
+ message(FATAL_ERROR "Internal error: failed to find imported target 'gflags' using '${gflags_component}' component")
+ endif()
+
+ message(STATUS "gflags (${gflags_VERSION}) is found at ${gflags_DIR} using '${gflags_component}' component")
+ endif()
+
+ if(NOT gflags_FOUND)
+ if(EXISTS "$ENV{INTEL_OPENVINO_DIR}/samples/cpp/thirdparty/gflags")
+ add_subdirectory("$ENV{INTEL_OPENVINO_DIR}/samples/cpp/thirdparty/gflags" "${CMAKE_CURRENT_BINARY_DIR}/gflag")
+ set(GFLAGS_TARGET gflags_nothreads_static)
+ else()
+ message(FATAL_ERROR "Failed to find 'gflags' library using '${gflags_component}' component")
+ endif()
+ endif()
+endif()
+
+target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime ${GFLAGS_TARGET})
+
+if(COMMAND add_clang_format_target)
+ add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
+endif()