Moved cmake functions, variables to API 2.0 naming style (#20281)

* Merge Linux CC + static build + clang compiler

* Improvements

* Removed ie prefixes from cmake scripts

* Fixes for NPU
This commit is contained in:
Ilya Lavrenov
2023-10-09 22:30:32 +04:00
committed by GitHub
parent cba4721cf6
commit ead4b8a0ec
104 changed files with 508 additions and 467 deletions

View File

@@ -4,10 +4,12 @@
cmake_minimum_required(VERSION 3.13)
if(NOT DEFINED IEDevScripts_DIR)
message(FATAL_ERROR "IEDevScripts_DIR is not defined")
if(NOT DEFINED OpenVINODeveloperScripts_DIR )
message(FATAL_ERROR "OpenVINODeveloperScripts_DIR is not defined")
endif()
set(IEDevScripts_DIR "${OpenVINODeveloperScripts_DIR}") # for BW compatibility
# disable FindPkgConfig.cmake for Android
if(ANDROID)
# Android toolchain does not provide pkg-config file. So, cmake mistakenly uses
@@ -23,7 +25,7 @@ macro(ov_set_if_not_defined var value)
endmacro()
set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${IEDevScripts_DIR}")
set(CMAKE_MODULE_PATH "${OpenVINODeveloperScripts_DIR}")
function(set_ci_build_number)
set(repo_root "${CMAKE_SOURCE_DIR}")
@@ -67,7 +69,7 @@ endif()
# Prepare temporary folder
#
function(set_temp_directory temp_variable source_tree_dir)
function(ov_set_temp_directory temp_variable source_tree_dir)
if(DEFINED OV_TEMP)
message(STATUS "OV_TEMP cmake variable is set : ${OV_TEMP}")
file(TO_CMAKE_PATH ${OV_TEMP} temp)
@@ -84,6 +86,11 @@ function(set_temp_directory temp_variable source_tree_dir)
endif()
endfunction()
macro(set_temp_directory)
message(WARNING "'set_temp_directory' is deprecated. Please, use 'ov_set_temp_directory'")
ov_set_temp_directory(${ARGV})
endmacro()
#
# For cross-compilation
#
@@ -139,37 +146,41 @@ if(NOT DEFINED OUTPUT_ROOT)
endif()
# Enable postfixes for Debug/Release builds
set(IE_DEBUG_POSTFIX_WIN "d")
set(IE_RELEASE_POSTFIX_WIN "")
set(IE_DEBUG_POSTFIX_LIN "")
set(IE_RELEASE_POSTFIX_LIN "")
set(IE_DEBUG_POSTFIX_MAC "d")
set(IE_RELEASE_POSTFIX_MAC "")
set(OV_DEBUG_POSTFIX_WIN "d")
set(OV_RELEASE_POSTFIX_WIN "")
set(OV_DEBUG_POSTFIX_LIN "")
set(OV_RELEASE_POSTFIX_LIN "")
set(OV_DEBUG_POSTFIX_MAC "d")
set(OV_RELEASE_POSTFIX_MAC "")
if(WIN32)
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_WIN})
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_WIN})
set(OV_DEBUG_POSTFIX ${OV_DEBUG_POSTFIX_WIN})
set(OV_RELEASE_POSTFIX ${OV_RELEASE_POSTFIX_WIN})
elseif(APPLE)
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_MAC})
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_MAC})
set(OV_DEBUG_POSTFIX ${OV_DEBUG_POSTFIX_MAC})
set(OV_RELEASE_POSTFIX ${OV_RELEASE_POSTFIX_MAC})
else()
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_LIN})
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_LIN})
set(OV_DEBUG_POSTFIX ${OV_DEBUG_POSTFIX_LIN})
set(OV_RELEASE_POSTFIX ${OV_RELEASE_POSTFIX_LIN})
endif()
set(CMAKE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX})
set(CMAKE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX})
set(CMAKE_DEBUG_POSTFIX ${OV_DEBUG_POSTFIX})
set(CMAKE_RELEASE_POSTFIX ${OV_RELEASE_POSTFIX})
# Support CMake multi-configuration for Visual Studio / Ninja or Xcode build
if(OV_GENERATOR_MULTI_CONFIG)
set(IE_BUILD_POSTFIX $<$<CONFIG:Debug>:${IE_DEBUG_POSTFIX}>$<$<CONFIG:Release>:${IE_RELEASE_POSTFIX}>)
set(OV_BUILD_POSTFIX $<$<CONFIG:Debug>:${OV_DEBUG_POSTFIX}>$<$<CONFIG:Release>:${OV_RELEASE_POSTFIX}>)
else()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(IE_BUILD_POSTFIX ${IE_DEBUG_POSTFIX})
set(OV_BUILD_POSTFIX ${OV_DEBUG_POSTFIX})
else()
set(IE_BUILD_POSTFIX ${IE_RELEASE_POSTFIX})
set(OV_BUILD_POSTFIX ${OV_RELEASE_POSTFIX})
endif()
endif()
add_definitions(-DOV_BUILD_POSTFIX=\"${OV_BUILD_POSTFIX}\")
# for BW compatibility; removed before 2024.0
set(IE_BUILD_POSTFIX ${OV_BUILD_POSTFIX})
add_definitions(-DIE_BUILD_POSTFIX=\"${IE_BUILD_POSTFIX}\")
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
@@ -178,11 +189,6 @@ ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FO
ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
if(CPACK_GENERATOR MATCHES "^(DEB|RPM)$")
# to make sure that lib/<multiarch-triplet> is created on Debian
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Cmake install prefix" FORCE)
endif()
include(packaging/packaging)
if(APPLE)
@@ -261,7 +267,7 @@ include(api_validator/api_validator)
include(vs_version/vs_version)
include(plugins/plugins)
include(frontends/frontends)
include(add_ie_target)
include(add_target_helpers)
include(CMakePackageConfigHelpers)
if(ENABLE_FUZZING)

View File

@@ -23,7 +23,7 @@ ov_add_target(
link_dependencies
DEPENDENCIES
dependencies
ie::important_plugin
openvino::important_plugin
OBJECT_FILES
object libraries
DEFINES
@@ -90,8 +90,7 @@ function(ov_add_target)
source_group("include" FILES ${includes})
source_group("src" FILES ${sources})
set(all_sources)
list(APPEND all_sources ${sources} ${includes} ${ARG_OBJECT_FILES})
set(all_sources ${sources} ${includes} ${ARG_OBJECT_FILES})
# defining a target
if (ARG_TYPE STREQUAL EXECUTABLE)
@@ -102,7 +101,7 @@ function(ov_add_target)
message(SEND_ERROR "Invalid target type ${ARG_TYPE} specified for target name ${ARG_NAME}")
endif()
ieTargetLinkWholeArchive(${ARG_NAME} ${ARG_LINK_LIBRARIES_WHOLE_ARCHIVE})
ov_target_link_whole_archive(${ARG_NAME} ${ARG_LINK_LIBRARIES_WHOLE_ARCHIVE})
if (ARG_DEFINES)
target_compile_definitions(${ARG_NAME} PRIVATE ${ARG_DEFINES})
@@ -140,11 +139,6 @@ function(ov_add_target)
endif()
endfunction()
function(addIeTarget)
message(WARNING "'addIeTarget' is deprecated, please, use 'ov_add_target' instead")
ov_add_target(${ARGV})
endfunction()
#[[
Wrapper function over addIeTarget, that also adds a test with the same name.
You could use
@@ -195,6 +189,13 @@ function(ov_add_test_target)
EXCLUDE_FROM_ALL)
endfunction()
# deprecated
function(addIeTarget)
message(WARNING "'addIeTarget' is deprecated, please, use 'ov_add_target' instead")
ov_add_target(${ARGV})
endfunction()
function(addIeTargetTest)
message(WARNING "'addIeTargetTest' is deprecated, please, use 'ov_add_test_target' instead")
ov_add_test_target(${ARGV})

View File

@@ -29,7 +29,7 @@ if(WIN32)
endif()
endif()
function(_ie_add_api_validator_post_build_step_recursive)
function(_ov_add_api_validator_post_build_step_recursive)
cmake_parse_arguments(API_VALIDATOR "" "TARGET" "" ${ARGN})
get_target_property(LIBRARY_TYPE ${API_VALIDATOR_TARGET} TYPE)
@@ -55,9 +55,9 @@ function(_ie_add_api_validator_post_build_step_recursive)
continue()
endif()
if(TARGET "${orig_library}")
_ie_add_api_validator_post_build_step_recursive(TARGET ${orig_library})
_ov_add_api_validator_post_build_step_recursive(TARGET ${orig_library})
else()
_ie_add_api_validator_post_build_step_recursive(TARGET ${library})
_ov_add_api_validator_post_build_step_recursive(TARGET ${library})
endif()
endif()
endforeach()
@@ -113,10 +113,10 @@ function(_ov_add_api_validator_post_build_step)
endif()
# collect targets
_ie_add_api_validator_post_build_step_recursive(TARGET ${API_VALIDATOR_TARGET})
_ov_add_api_validator_post_build_step_recursive(TARGET ${API_VALIDATOR_TARGET})
if (API_VALIDATOR_EXTRA)
foreach(target IN LISTS API_VALIDATOR_EXTRA)
_ie_add_api_validator_post_build_step_recursive(TARGET ${target})
_ov_add_api_validator_post_build_step_recursive(TARGET ${target})
endforeach()
endif()
@@ -171,7 +171,7 @@ function(_ov_add_api_validator_post_build_step)
-D ONECORE_API_VALIDATOR_EXCLUSION=${ONECORE_API_VALIDATOR_EXCLUSION}
-D ONECORE_API_VALIDATOR_OUTPUT=${output_file}
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-P "${IEDevScripts_DIR}/api_validator/api_validator_run.cmake")
-P "${OpenVINODeveloperScripts_DIR}/api_validator/api_validator_run.cmake")
list(APPEND byproducts_files ${output_file})
unset(target_name)
@@ -191,13 +191,15 @@ function(_ov_add_api_validator_post_build_step)
endfunction()
#
# ie_add_api_validator_post_build_step(TARGET <name>)
# ov_add_api_validator_post_build_step(TARGET <name>)
#
macro(ov_add_api_validator_post_build_step)
_ov_add_api_validator_post_build_step(${ARGV})
endmacro()
function(ov_add_api_validator_post_build_step)
_ov_add_api_validator_post_build_step(${ARGN})
endfunction()
macro(ie_add_api_validator_post_build_step)
message(WARNING "ie_add_api_validator_post_build_step is deprecated, use ov_add_api_validator_post_build_step instead")
_ov_add_api_validator_post_build_step(${ARGV})
endmacro()
# deprecated
function(ie_add_api_validator_post_build_step)
message(WARNING "'ie_add_api_validator_post_build_step' is deprecated, use 'ov_add_api_validator_post_build_step' instead")
_ov_add_api_validator_post_build_step(${ARGN})
endfunction()

View File

@@ -88,10 +88,10 @@ function(ov_add_clang_format_target TARGET_NAME)
-D "CLANG_FORMAT=${CLANG_FORMAT}"
-D "INPUT_FILE=${source_file}"
-D "OUTPUT_FILE=${output_file}"
-P "${IEDevScripts_DIR}/clang_format/clang_format_check.cmake"
-P "${OpenVINODeveloperScripts_DIR}/clang_format/clang_format_check.cmake"
DEPENDS
"${source_file}"
"${IEDevScripts_DIR}/clang_format/clang_format_check.cmake"
"${OpenVINODeveloperScripts_DIR}/clang_format/clang_format_check.cmake"
COMMENT
"[clang-format] ${source_file}"
VERBATIM)
@@ -110,10 +110,10 @@ function(ov_add_clang_format_target TARGET_NAME)
-D "CLANG_FORMAT=${CLANG_FORMAT}"
-D "INPUT_FILES=${all_input_sources}"
-D "EXCLUDE_PATTERNS=${CLANG_FORMAT_EXCLUDE_PATTERNS}"
-P "${IEDevScripts_DIR}/clang_format/clang_format_fix.cmake"
-P "${OpenVINODeveloperScripts_DIR}/clang_format/clang_format_fix.cmake"
DEPENDS
"${all_input_sources}"
"${IEDevScripts_DIR}/clang_format/clang_format_fix.cmake"
"${OpenVINODeveloperScripts_DIR}/clang_format/clang_format_fix.cmake"
COMMENT
"[clang-format] ${TARGET_NAME}_fix"
VERBATIM)

View File

@@ -9,31 +9,31 @@ include(CheckCXXCompilerFlag)
# ov_disable_deprecated_warnings()
#
# Disables deprecated warnings generation in current scope (directory, function)
# Defines ie_c_cxx_deprecated varaible which contains C / C++ compiler flags
# Defines ov_c_cxx_deprecated varaible which contains C / C++ compiler flags
#
macro(ov_disable_deprecated_warnings)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(ie_c_cxx_deprecated "/wd4996")
set(ov_c_cxx_deprecated "/wd4996")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if(WIN32)
set(ie_c_cxx_deprecated "/Qdiag-disable:1478,1786")
set(ov_c_cxx_deprecated "/Qdiag-disable:1478,1786")
else()
set(ie_c_cxx_deprecated "-diag-disable=1478,1786")
set(ov_c_cxx_deprecated "-diag-disable=1478,1786")
endif()
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
set(ie_c_cxx_deprecated "-Wno-deprecated-declarations")
set(ov_c_cxx_deprecated "-Wno-deprecated-declarations")
else()
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ie_c_cxx_deprecated}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ie_c_cxx_deprecated}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ie_c_cxx_deprecated}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ie_c_cxx_deprecated}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ov_c_cxx_deprecated}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ov_c_cxx_deprecated}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ov_c_cxx_deprecated}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ov_c_cxx_deprecated}")
endmacro()
macro(disable_deprecated_warnings)
message(WARNING "disable_deprecated_warnings is deprecated, use ov_disable_deprecated_warnings instead")
message(WARNING "'disable_deprecated_warnings' is deprecated, use 'ov_disable_deprecated_warnings' instead")
ov_disable_deprecated_warnings()
endmacro()
@@ -41,30 +41,30 @@ endmacro()
# ov_deprecated_no_errors()
#
# Don't threat deprecated warnings as errors in current scope (directory, function)
# Defines ie_c_cxx_deprecated_no_errors varaible which contains C / C++ compiler flags
# Defines ov_c_cxx_deprecated_no_errors varaible which contains C / C++ compiler flags
#
macro(ov_deprecated_no_errors)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# show 4996 only for /w4
set(ie_c_cxx_deprecated_no_errors "/wd4996")
set(ov_c_cxx_deprecated_no_errors "/wd4996")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if(WIN32)
set(ie_c_cxx_deprecated_no_errors "/Qdiag-warning:1478,1786")
set(ov_c_cxx_deprecated_no_errors "/Qdiag-warning:1478,1786")
else()
set(ie_c_cxx_deprecated_no_errors "-diag-warning=1478,1786")
set(ov_c_cxx_deprecated_no_errors "-diag-warning=1478,1786")
endif()
elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
set(ie_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations")
set(ov_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations")
# Suppress #warning messages
set(ie_c_cxx_deprecated_no_errors "${ie_c_cxx_deprecated_no_errors} -Wno-cpp")
set(ov_c_cxx_deprecated_no_errors "${ov_c_cxx_deprecated_no_errors} -Wno-cpp")
else()
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ie_c_cxx_deprecated_no_errors}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ie_c_cxx_deprecated_no_errors}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ie_c_cxx_deprecated_no_errors}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ie_c_cxx_deprecated_no_errors}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ov_c_cxx_deprecated_no_errors}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ov_c_cxx_deprecated_no_errors}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ov_c_cxx_deprecated_no_errors}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ov_c_cxx_deprecated_no_errors}")
endmacro()
#
@@ -74,24 +74,24 @@ endmacro()
#
macro(ov_dev_package_no_errors)
if(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
set(ie_c_cxx_dev_no_errors "-Wno-all")
set(ov_c_cxx_dev_no_errors "-Wno-all")
if(SUGGEST_OVERRIDE_SUPPORTED)
set(ie_cxx_dev_no_errors "-Wno-error=suggest-override")
set(ov_cxx_dev_no_errors "-Wno-error=suggest-override")
endif()
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ie_c_cxx_dev_no_errors} ${ie_cxx_dev_no_errors}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ie_c_cxx_dev_no_errors}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ie_c_cxx_dev_no_errors} ${ie_cxx_dev_no_errors}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ie_c_cxx_dev_no_errors}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ov_c_cxx_dev_no_errors} ${ov_cxx_dev_no_errors}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ov_c_cxx_dev_no_errors}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ov_c_cxx_dev_no_errors} ${ov_cxx_dev_no_errors}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ov_c_cxx_dev_no_errors}")
endmacro()
#
# ie_sse42_optimization_flags(<output flags>)
# ov_sse42_optimization_flags(<output flags>)
#
# Provides SSE4.2 compilation flags depending on an OS and a compiler
#
macro(ie_sse42_optimization_flags flags)
macro(ov_sse42_optimization_flags flags)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# No such option for MSVC 2019
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
@@ -111,11 +111,11 @@ macro(ie_sse42_optimization_flags flags)
endmacro()
#
# ie_avx2_optimization_flags(<output flags>)
# ov_avx2_optimization_flags(<output flags>)
#
# Provides AVX2 compilation flags depending on an OS and a compiler
#
macro(ie_avx2_optimization_flags flags)
macro(ov_avx2_optimization_flags flags)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(${flags} /arch:AVX2)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
@@ -132,12 +132,12 @@ macro(ie_avx2_optimization_flags flags)
endmacro()
#
# ie_avx512_optimization_flags(<output flags>)
# ov_avx512_optimization_flags(<output flags>)
#
# Provides common AVX512 compilation flags for AVX512F instruction set support
# depending on an OS and a compiler
#
macro(ie_avx512_optimization_flags flags)
macro(ov_avx512_optimization_flags flags)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(${flags} /arch:AVX512)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
@@ -154,9 +154,9 @@ macro(ie_avx512_optimization_flags flags)
endmacro()
#
# ie_arm_neon_optimization_flags(<output flags>)
# ov_arm_neon_optimization_flags(<output flags>)
#
macro(ie_arm_neon_optimization_flags flags)
macro(ov_arm_neon_optimization_flags flags)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
@@ -219,7 +219,7 @@ endfunction()
# Enables Link Time Optimization compilation
#
macro(ie_enable_lto)
message(WARNING "ie_add_compiler_flags is deprecated, set INTERPROCEDURAL_OPTIMIZATION_RELEASE target property instead")
message(WARNING "'ie_enable_lto' is deprecated, set 'INTERPROCEDURAL_OPTIMIZATION_RELEASE' target property instead")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
endmacro()
@@ -236,7 +236,7 @@ macro(ov_add_compiler_flags)
endmacro()
macro(ie_add_compiler_flags)
message(WARNING "ie_add_compiler_flags is deprecated, use ov_add_compiler_flags instead")
message(WARNING "'ie_add_compiler_flags' is deprecated, use 'ov_add_compiler_flags' instead")
ov_add_compiler_flags(${ARGN})
endmacro()

View File

@@ -16,7 +16,7 @@ endif()
set(OV_COVERAGE_REPORTS "${CMAKE_BINARY_DIR}/coverage")
set(OV_COVERAGE_SCRIPT_DIR "${IEDevScripts_DIR}/coverage")
set(OV_COVERAGE_SCRIPT_DIR "${OpenVINODeveloperScripts_DIR}/coverage")
include(CMakeParseArguments)
@@ -171,9 +171,9 @@ function(ov_coverage_genhtml)
endfunction()
#
# ie_coverage_remove(INPUT <info_file> OUTPUT <output_file> PATTERNS <patterns ...>)
# ov_coverage_remove(INPUT <info_file> OUTPUT <output_file> PATTERNS <patterns ...>)
#
function(ie_coverage_remove)
function(ov_coverage_remove)
cmake_parse_arguments(OV_COVERAGE "" "INPUT;OUTPUT" "PATTERNS" ${ARGN})
set(input_file "${OV_COVERAGE_REPORTS}/${OV_COVERAGE_INPUT}.info")
@@ -199,9 +199,9 @@ function(ie_coverage_remove)
endfunction()
#
# ie_coverage_merge(OUTPUT <output file> INPUTS <input files ...>)
# ov_coverage_merge(OUTPUT <output file> INPUTS <input files ...>)
#
function(ie_coverage_merge)
function(ov_coverage_merge)
cmake_parse_arguments(OV_COVERAGE "" "OUTPUT" "INPUTS" ${ARGN})
set(output_file "${OV_COVERAGE_REPORTS}/${OV_COVERAGE_OUTPUT}.info")
@@ -227,6 +227,8 @@ function(ie_coverage_merge)
add_dependencies(ov_coverage_${OV_COVERAGE_OUTPUT}_info ${dependencies})
endfunction()
# deprecated
if(NOT TARGET ie_coverage)
add_custom_target(ie_coverage)
set_target_properties(ie_coverage PROPERTIES FOLDER coverage)

View File

@@ -69,17 +69,17 @@ function(add_cpplint_target TARGET_NAME)
COMMAND
"${CMAKE_COMMAND}"
-D "Python3_EXECUTABLE=${Python3_EXECUTABLE}"
-D "CPPLINT_SCRIPT=${IEDevScripts_DIR}/cpplint/cpplint.py"
-D "CPPLINT_SCRIPT=${OpenVINODeveloperScripts_DIR}/cpplint/cpplint.py"
-D "INPUT_FILE=${source_file}"
-D "OUTPUT_FILE=${output_file}"
-D "WORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}"
-D "SKIP_RETURN_CODE=${ENABLE_CPPLINT_REPORT}"
-D "CUSTOM_FILTER=${custom_filter}"
-P "${IEDevScripts_DIR}/cpplint/cpplint_run.cmake"
-P "${OpenVINODeveloperScripts_DIR}/cpplint/cpplint_run.cmake"
DEPENDS
"${source_file}"
"${IEDevScripts_DIR}/cpplint/cpplint.py"
"${IEDevScripts_DIR}/cpplint/cpplint_run.cmake"
"${OpenVINODeveloperScripts_DIR}/cpplint/cpplint.py"
"${OpenVINODeveloperScripts_DIR}/cpplint/cpplint_run.cmake"
COMMENT
"[cpplint] ${source_file_relative_root}"
VERBATIM)

View File

@@ -19,9 +19,9 @@ set(_DEFINE_AVX2 "HAVE_AVX2" ${_DEFINE_AVX})
set(_DEFINE_AVX512F "HAVE_AVX512F" ${_DEFINE_AVX2})
## Arch specific compile options
ie_avx512_optimization_flags(_FLAGS_AVX512F)
ie_avx2_optimization_flags (_FLAGS_AVX2)
ie_sse42_optimization_flags (_FLAGS_SSE42)
ov_avx512_optimization_flags(_FLAGS_AVX512F)
ov_avx2_optimization_flags (_FLAGS_AVX2)
ov_sse42_optimization_flags (_FLAGS_SSE42)
set(_FLAGS_AVX "") ## TBD is not defined for IE project yet
set(_FLAGS_ANY "") ##

View File

@@ -20,6 +20,8 @@ function(ov_build_target_faster TARGET_NAME)
endif()
endfunction()
# deprecated
function(ie_faster_build)
message(WARNING "ie_faster_build is deprecated, use ov_build_target_faster instead")
ov_build_target_faster(${ARGV})

View File

@@ -6,19 +6,19 @@ include(options)
include(target_flags)
set (CPACK_GENERATOR "TGZ" CACHE STRING "Cpack generator for OpenVINO")
list (APPEND IE_OPTIONS CPACK_GENERATOR)
list (APPEND OV_OPTIONS CPACK_GENERATOR)
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
# this must be addressed in a proper way
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF
ov_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF
"LINUX;EMSCRIPTEN OR NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
ov_option (OS_FOLDER "create OS dedicated folder in output" OFF)
if(OV_GENERATOR_MULTI_CONFIG)
ie_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" OFF)
ov_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" OFF)
else()
ie_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" ON)
ov_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" ON)
endif()
if(DEFINED ENV{CI_BUILD_NUMBER} AND NOT (WIN32 OR CMAKE_CROSSCOMPILING))
@@ -27,37 +27,37 @@ else()
set(CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT OFF)
endif()
ie_option (CMAKE_COMPILE_WARNING_AS_ERROR "Enable warnings as errors" ${CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT})
ov_option (CMAKE_COMPILE_WARNING_AS_ERROR "Enable warnings as errors" ${CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT})
ie_dependent_option (ENABLE_QSPECTRE "Enable Qspectre mitigation" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
ov_dependent_option (ENABLE_QSPECTRE "Enable Qspectre mitigation" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
ie_dependent_option (ENABLE_INTEGRITYCHECK "build DLLs with /INTEGRITYCHECK flag" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
ov_dependent_option (ENABLE_INTEGRITYCHECK "build DLLs with /INTEGRITYCHECK flag" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
ie_option (ENABLE_SANITIZER "enable checking memory errors via AddressSanitizer" OFF)
ov_option (ENABLE_SANITIZER "enable checking memory errors via AddressSanitizer" OFF)
ie_option (ENABLE_UB_SANITIZER "enable UndefinedBahavior sanitizer" OFF)
ov_option (ENABLE_UB_SANITIZER "enable UndefinedBahavior sanitizer" OFF)
ie_option (ENABLE_THREAD_SANITIZER "enable checking data races via ThreadSanitizer" OFF)
ov_option (ENABLE_THREAD_SANITIZER "enable checking data races via ThreadSanitizer" OFF)
ie_dependent_option (ENABLE_COVERAGE "enable code coverage" OFF "CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG" OFF)
ov_dependent_option (ENABLE_COVERAGE "enable code coverage" OFF "CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG" OFF)
# Defines CPU capabilities
ie_dependent_option (ENABLE_SSE42 "Enable SSE4.2 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
ov_dependent_option (ENABLE_SSE42 "Enable SSE4.2 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
ie_dependent_option (ENABLE_AVX2 "Enable AVX2 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
ov_dependent_option (ENABLE_AVX2 "Enable AVX2 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
ie_dependent_option (ENABLE_AVX512F "Enable AVX512 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
ov_dependent_option (ENABLE_AVX512F "Enable AVX512 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
# Type of build, we add this as an explicit option to default it to ON
get_property(BUILD_SHARED_LIBS_DEFAULT GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
ie_option (BUILD_SHARED_LIBS "Build as a shared library" ${BUILD_SHARED_LIBS_DEFAULT})
ov_option (BUILD_SHARED_LIBS "Build as a shared library" ${BUILD_SHARED_LIBS_DEFAULT})
# Android does not support SOVERSION
# see https://www.opengis.ch/2011/11/23/creating-non-versioned-shared-libraries-for-android/
ie_dependent_option (ENABLE_LIBRARY_VERSIONING "Enable libraries versioning" ON "NOT WIN32;NOT ANDROID;BUILD_SHARED_LIBS" OFF)
ov_dependent_option (ENABLE_LIBRARY_VERSIONING "Enable libraries versioning" ON "NOT WIN32;NOT ANDROID;BUILD_SHARED_LIBS" OFF)
ie_dependent_option (ENABLE_FASTER_BUILD "Enable build features (PCH, UNITY) to speed up build time" OFF "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16" OFF)
ov_dependent_option (ENABLE_FASTER_BUILD "Enable build features (PCH, UNITY) to speed up build time" OFF "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16" OFF)
if(CMAKE_CROSSCOMPILING OR WIN32)
set(STYLE_CHECKS_DEFAULT OFF)
@@ -65,22 +65,22 @@ else()
set(STYLE_CHECKS_DEFAULT ON)
endif()
ie_option (ENABLE_CPPLINT "Enable cpplint checks during the build" ${STYLE_CHECKS_DEFAULT})
ov_option (ENABLE_CPPLINT "Enable cpplint checks during the build" ${STYLE_CHECKS_DEFAULT})
ie_dependent_option (ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)
ov_dependent_option (ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)
ie_option (ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" ${STYLE_CHECKS_DEFAULT})
ov_option (ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" ${STYLE_CHECKS_DEFAULT})
ie_option (ENABLE_NCC_STYLE "Enable ncc style check" ${STYLE_CHECKS_DEFAULT})
ov_option (ENABLE_NCC_STYLE "Enable ncc style check" ${STYLE_CHECKS_DEFAULT})
ie_option (ENABLE_UNSAFE_LOCATIONS "skip check for MD5 for dependency" OFF)
ov_option (ENABLE_UNSAFE_LOCATIONS "skip check for MD5 for dependency" OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER_EQUAL 1930)
# Visual Studio 2022: 1930-1939 = VS 17.0 (v143 toolset)
set(_msvc_version_2022 ON)
endif()
ie_dependent_option (ENABLE_FUZZING "instrument build for fuzzing" OFF "OV_COMPILER_IS_CLANG OR _msvc_version_2022" OFF)
ov_dependent_option (ENABLE_FUZZING "instrument build for fuzzing" OFF "OV_COMPILER_IS_CLANG OR _msvc_version_2022" OFF)
#
# Check features

View File

@@ -38,7 +38,7 @@ function(ov_generate_frontends_hpp)
ov_target_link_frontends(openvino)
set(ov_frontends_hpp "${CMAKE_BINARY_DIR}/src/frontends/common/src/ov_frontends.hpp")
set(frontends_hpp_in "${IEDevScripts_DIR}/frontends/ov_frontends.hpp.in")
set(frontends_hpp_in "${OpenVINODeveloperScripts_DIR}/frontends/ov_frontends.hpp.in")
add_custom_command(OUTPUT "${ov_frontends_hpp}"
COMMAND
@@ -46,10 +46,10 @@ function(ov_generate_frontends_hpp)
-D "OV_FRONTENDS_HPP_HEADER_IN=${frontends_hpp_in}"
-D "OV_FRONTENDS_HPP_HEADER=${ov_frontends_hpp}"
-D "FRONTEND_NAMES=${FRONTEND_NAMES}"
-P "${IEDevScripts_DIR}/frontends/create_frontends_hpp.cmake"
-P "${OpenVINODeveloperScripts_DIR}/frontends/create_frontends_hpp.cmake"
DEPENDS
"${frontends_hpp_in}"
"${IEDevScripts_DIR}/frontends/create_frontends_hpp.cmake"
"${OpenVINODeveloperScripts_DIR}/frontends/create_frontends_hpp.cmake"
COMMENT
"Generate ov_frontends.hpp for static build"
VERBATIM)

View File

@@ -6,7 +6,7 @@ if(NOT COMMAND ov_check_pip_packages)
message(FATAL_ERROR "Internal error: ncc_naming_style.cmake must be included after ov_check_pip_packages")
endif()
set(ncc_style_dir "${IEDevScripts_DIR}/ncc_naming_style")
set(ncc_style_dir "${OpenVINODeveloperScripts_DIR}/ncc_naming_style")
set(ncc_style_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/ncc_naming_style")
# find python3

View File

@@ -2,46 +2,47 @@
# SPDX-License-Identifier: Apache-2.0
#
# Usage: ie_option(<option_variable> "description" <initial value or boolean expression> [IF <condition>])
include (CMakeDependentOption)
if(POLICY CMP0127)
cmake_policy(SET CMP0127 NEW)
endif()
macro (ie_option variable description value)
macro(ov_option variable description value)
option(${variable} "${description}" ${value})
list(APPEND OV_OPTIONS ${variable})
list(APPEND IE_OPTIONS ${variable})
endmacro()
# Usage: ov_option(<option_variable> "description" <initial value or boolean expression> [IF <condition>])
macro (ov_option variable description value)
ie_option(${variable} "${description}" ${value})
endmacro()
macro (ie_dependent_option variable description def_value condition fallback_value)
macro(ov_dependent_option variable description def_value condition fallback_value)
cmake_dependent_option(${variable} "${description}" ${def_value} "${condition}" ${fallback_value})
list(APPEND OV_OPTIONS ${variable})
list(APPEND IE_OPTIONS ${variable})
endmacro()
macro (ie_option_enum variable description value)
macro(ov_option_enum variable description value)
set(OPTIONS)
set(ONE_VALUE_ARGS)
set(MULTI_VALUE_ARGS ALLOWED_VALUES)
cmake_parse_arguments(IE_OPTION_ENUM "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})
cmake_parse_arguments(OPTION_ENUM "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})
if(NOT ${value} IN_LIST IE_OPTION_ENUM_ALLOWED_VALUES)
message(FATAL_ERROR "variable must be one of ${IE_OPTION_ENUM_ALLOWED_VALUES}")
if(NOT ${value} IN_LIST OPTION_ENUM_ALLOWED_VALUES)
message(FATAL_ERROR "Internal error: variable must be one of ${OPTION_ENUM_ALLOWED_VALUES}")
endif()
list(APPEND OV_OPTIONS ${variable})
list(APPEND IE_OPTIONS ${variable})
set(${variable} ${value} CACHE STRING "${description}")
set_property(CACHE ${variable} PROPERTY STRINGS ${IE_OPTION_ENUM_ALLOWED_VALUES})
set_property(CACHE ${variable} PROPERTY STRINGS ${OPTION_ENUM_ALLOWED_VALUES})
unset(OPTIONS)
unset(ONE_VALUE_ARGS)
unset(MULTI_VALUE_ARGS)
unset(OPTION_ENUM_ALLOWED_VALUES)
endmacro()
function (print_enabled_features)
function (ov_print_enabled_features)
if(NOT COMMAND set_ci_build_number)
message(FATAL_ERROR "CI_BUILD_NUMBER is not set yet")
endif()
@@ -49,8 +50,25 @@ function (print_enabled_features)
message(STATUS "OpenVINO Runtime enabled features: ")
message(STATUS "")
message(STATUS " CI_BUILD_NUMBER: ${CI_BUILD_NUMBER}")
foreach(_var ${IE_OPTIONS})
foreach(_var IN LISTS OV_OPTIONS)
message(STATUS " ${_var} = ${${_var}}")
endforeach()
message(STATUS "")
endfunction()
# deprecated
macro (ie_option variable description value)
message(WARNING "'ie_option' is deprecated, please, use 'ov_option' instead")
ov_option(${variable} "${description}" ${value})
endmacro()
macro(ie_dependent_option variable description def_value condition fallback_value)
message(WARNING "'ie_dependent_option' is deprecated, please, use 'ov_dependent_option' instead")
ov_dependent_option(${variable} "${description}" ${def_value} "${condition}" ${fallback_value})
endmacro()
function(print_enabled_features)
message(WARNING "'print_enabled_features' is deprecated, please, use 'ov_print_enabled_features' instead")
ov_print_enabled_features()
endfunction()

View File

@@ -44,11 +44,6 @@ macro(ov_archive_cpack_set_dirs)
set(OV_CPACK_ARCHIVEDIR runtime/lib/${ARCH_FOLDER})
endif()
set(OV_CPACK_PLUGINSDIR ${OV_CPACK_RUNTIMEDIR})
# for BW compatibility
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
endmacro()
ov_archive_cpack_set_dirs()

View File

@@ -47,11 +47,6 @@ macro(ov_common_libraries_cpack_set_dirs)
# skipped during common libraries packaging
set(OV_CPACK_WHEELSDIR "tools")
# for BW compatibility
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
endmacro()
ov_common_libraries_cpack_set_dirs()

View File

@@ -45,11 +45,6 @@ macro(ov_debian_cpack_set_dirs)
# skipped during debian packaging
set(OV_CPACK_WHEELSDIR "tools")
# for BW compatibility
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
endmacro()
ov_debian_cpack_set_dirs()
@@ -134,7 +129,9 @@ macro(ov_debian_specific_settings)
# homepage
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://docs.openvino.ai/")
# use lintian to check packages in post-build step
set(CPACK_POST_BUILD_SCRIPTS "${IEDevScripts_DIR}/packaging/debian/post_build.cmake")
set(CPACK_POST_BUILD_SCRIPTS "${OpenVINODeveloperScripts_DIR}/packaging/debian/post_build.cmake")
# to make sure that lib/<multiarch-triplet> is created on Debian
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Cmake install prefix" FORCE)
# enable for debug cpack run
if(NOT DEFINED CPACK_DEBIAN_PACKAGE_DEBUG)
set(CPACK_DEBIAN_PACKAGE_DEBUG OFF)

View File

@@ -83,11 +83,6 @@ macro(ov_archive_cpack_set_dirs)
set(OV_CPACK_ARCHIVEDIR runtime/lib/${ARCH_FOLDER})
endif()
set(OV_CPACK_PLUGINSDIR ${OV_CPACK_RUNTIMEDIR})
# for BW compatibility
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
endmacro()
ov_nsis_cpack_set_dirs()

View File

@@ -49,22 +49,22 @@ endfunction()
# Wraps original `cpack_add_component` and adds component to internal IE list
#
function(ov_cpack_add_component name)
if(NOT ${name} IN_LIST IE_CPACK_COMPONENTS_ALL)
if(NOT ${name} IN_LIST OV_CPACK_COMPONENTS_ALL)
cpack_add_component(${name} ${ARGN})
# need to store informarion about cpack_add_component arguments in CMakeCache.txt
# to restore it later
set(_${name}_cpack_component_args "${ARGN}" CACHE INTERNAL "Argument for cpack_add_component for ${name} cpack component" FORCE)
list(APPEND IE_CPACK_COMPONENTS_ALL ${name})
set(IE_CPACK_COMPONENTS_ALL "${IE_CPACK_COMPONENTS_ALL}" CACHE INTERNAL "" FORCE)
list(APPEND OV_CPACK_COMPONENTS_ALL ${name})
set(OV_CPACK_COMPONENTS_ALL "${OV_CPACK_COMPONENTS_ALL}" CACHE INTERNAL "" FORCE)
endif()
endfunction()
foreach(comp IN LISTS IE_CPACK_COMPONENTS_ALL)
foreach(comp IN LISTS OV_CPACK_COMPONENTS_ALL)
unset(_${comp}_cpack_component_args)
endforeach()
unset(IE_CPACK_COMPONENTS_ALL CACHE)
unset(OV_CPACK_COMPONENTS_ALL CACHE)
# create `tests` component
if(ENABLE_TESTS)
@@ -164,7 +164,7 @@ elseif(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|TZST|ZIP)$")
include(packaging/archive)
endif()
macro(ie_cpack)
macro(ov_cpack)
set(CPACK_SOURCE_GENERATOR "") # not used
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenVINO™ Toolkit")
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED OFF)
@@ -223,3 +223,10 @@ macro(ie_cpack)
include(CPack)
endmacro()
# deprecated
macro(ie_cpack)
message(WARNING "'ie_cpack' is deprecated. Please, use 'ov_cpack'")
ov_cpack(${ARGV})
endmacro()

View File

@@ -36,11 +36,6 @@ macro(ov_rpm_cpack_set_dirs)
# skipped during rpm packaging
set(OV_CPACK_WHEELSDIR "tools")
# for BW compatibility
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
endmacro()
ov_rpm_cpack_set_dirs()
@@ -128,7 +123,7 @@ macro(ov_rpm_specific_settings)
# TODO: fix "error: bad date in %changelog"
# set(CPACK_RPM_CHANGELOG_FILE "${OpenVINO_SOURCE_DIR}/cmake/developer_package/packaging/rpm/changelog")
# use rpmlint to check packages in post-build step
set(CPACK_POST_BUILD_SCRIPTS "${IEDevScripts_DIR}/packaging/rpm/post_build.cmake")
set(CPACK_POST_BUILD_SCRIPTS "${OpenVINODeveloperScripts_DIR}/packaging/rpm/post_build.cmake")
# enable for debug cpack run
ov_set_if_not_defined(CPACK_RPM_PACKAGE_DEBUG OFF)

View File

@@ -8,7 +8,7 @@ set(PLUGIN_FILES "" CACHE INTERNAL "")
function(ov_plugin_get_file_name target_name library_name)
set(LIB_PREFIX "${CMAKE_SHARED_MODULE_PREFIX}")
set(LIB_SUFFIX "${IE_BUILD_POSTFIX}${CMAKE_SHARED_MODULE_SUFFIX}")
set(LIB_SUFFIX "${OV_BUILD_POSTFIX}${CMAKE_SHARED_MODULE_SUFFIX}")
get_target_property(LIB_NAME ${target_name} OUTPUT_NAME)
if (LIB_NAME STREQUAL "LIB_NAME-NOTFOUND")
@@ -168,6 +168,7 @@ function(ov_add_plugin)
endfunction()
function(ie_add_plugin)
message(WARNING "'ie_add_plugin' is deprecated. Please, use 'ov_add_plugin'")
ov_add_plugin(${ARGN})
endfunction()
@@ -203,7 +204,7 @@ macro(ov_register_in_plugins_xml)
-D "OV_CONFIG_OUTPUT_FILE=${config_output_file}"
-D "OV_PLUGIN_NAME=${device_name}"
-D "OV_CONFIGS_DIR=${CMAKE_BINARY_DIR}/plugins"
-P "${IEDevScripts_DIR}/plugins/unregister_plugin_cmake.cmake"
-P "${OpenVINODeveloperScripts_DIR}/plugins/unregister_plugin_cmake.cmake"
COMMENT
"Remove ${device_name} from the plugins.xml file"
VERBATIM)
@@ -232,7 +233,7 @@ macro(ov_register_in_plugins_xml)
-D "OV_DEVICE_NAME=${device_name}"
-D "OV_PLUGIN_PROPERTIES=${${device_name}_CONFIG}"
-D "OV_PLUGIN_LIBRARY_NAME=${library_name}"
-P "${IEDevScripts_DIR}/plugins/create_plugin_file.cmake"
-P "${OpenVINODeveloperScripts_DIR}/plugins/create_plugin_file.cmake"
COMMENT "Register ${device_name} device as ${library_name}"
VERBATIM)
@@ -247,7 +248,7 @@ macro(ov_register_in_plugins_xml)
-D "CMAKE_SHARED_MODULE_PREFIX=${CMAKE_SHARED_MODULE_PREFIX}"
-D "OV_CONFIG_OUTPUT_FILE=${config_output_file}"
-D "OV_CONFIGS_DIR=${CMAKE_BINARY_DIR}/plugins"
-P "${IEDevScripts_DIR}/plugins/register_plugin_cmake.cmake"
-P "${OpenVINODeveloperScripts_DIR}/plugins/register_plugin_cmake.cmake"
COMMENT
"Registering plugins to plugins.xml config file"
VERBATIM)
@@ -266,6 +267,7 @@ endmacro()
# ie_register_plugins()
#
macro(ie_register_plugins)
message(WARNING "'ie_register_plugins' is deprecated. Please, use 'ov_register_plugins'")
ov_register_plugins(${ARGN})
endmacro()
@@ -346,7 +348,7 @@ function(ov_generate_plugins_hpp)
else()
set(ov_plugins_hpp "${CMAKE_BINARY_DIR}/src/inference/ov_plugins.hpp")
endif()
set(plugins_hpp_in "${IEDevScripts_DIR}/plugins/plugins.hpp.in")
set(plugins_hpp_in "${OpenVINODeveloperScripts_DIR}/plugins/plugins.hpp.in")
add_custom_command(OUTPUT "${ov_plugins_hpp}"
COMMAND
@@ -357,10 +359,10 @@ function(ov_generate_plugins_hpp)
-D "OV_PLUGINS_HPP_HEADER=${ov_plugins_hpp}"
${device_configs}
${as_extension}
-P "${IEDevScripts_DIR}/plugins/create_plugins_hpp.cmake"
-P "${OpenVINODeveloperScripts_DIR}/plugins/create_plugins_hpp.cmake"
DEPENDS
"${plugins_hpp_in}"
"${IEDevScripts_DIR}/plugins/create_plugins_hpp.cmake"
"${OpenVINODeveloperScripts_DIR}/plugins/create_plugins_hpp.cmake"
COMMENT
"Generate ov_plugins.hpp"
VERBATIM)

View File

@@ -7,7 +7,7 @@ if(NOT EXISTS "${OV_CONFIG_OUTPUT_FILE}")
endif()
# remove plugin file
file(REMOVE "${OV_CONFIGS_DIR}/${IE_PLUGIN_NAME}.xml")
file(REMOVE "${OV_CONFIGS_DIR}/${OV_PLUGIN_NAME}.xml")
# remove plugin
set(newContent "")
@@ -15,7 +15,7 @@ file(STRINGS "${OV_CONFIG_OUTPUT_FILE}" content)
set(skip_plugin OFF)
foreach(line IN LISTS content)
if("${line}" MATCHES "name=\"${IE_PLUGIN_NAME}\"")
if("${line}" MATCHES "name=\"${OV_PLUGIN_NAME}\"")
set(skip_plugin ON)
endif()

View File

@@ -103,7 +103,7 @@ function(ov_check_pip_packages)
from check_python_requirements import check_python_requirements ;
check_python_requirements('${ARG_REQUIREMENTS_FILE}') ;
"
WORKING_DIRECTORY "${IEDevScripts_DIR}"
WORKING_DIRECTORY "${OpenVINODeveloperScripts_DIR}"
RESULT_VARIABLE EXIT_CODE
OUTPUT_VARIABLE OUTPUT_TEXT
ERROR_VARIABLE ERROR_TEXT)

View File

@@ -17,20 +17,20 @@ if(shellcheck_PROGRAM)
endif()
endif()
function(ie_shellcheck_process)
function(ov_shellcheck_process)
if(NOT shellcheck_PROGRAM)
message(WARNING "shellcheck tool is not found")
return()
endif()
cmake_parse_arguments(IE_SHELLCHECK "" "DIRECTORY" "SKIP" ${ARGN})
cmake_parse_arguments(SHELLCHECK "" "DIRECTORY" "SKIP" ${ARGN})
set(IE_SHELLCHECK_SCRIPT "${IEDevScripts_DIR}/shellcheck/shellcheck_process.cmake")
file(GLOB_RECURSE scripts "${IE_SHELLCHECK_DIRECTORY}/*.sh")
set(SHELLCHECK_SCRIPT "${OpenVINODeveloperScripts_DIR}/shellcheck/shellcheck_process.cmake")
file(GLOB_RECURSE scripts "${SHELLCHECK_DIRECTORY}/*.sh")
foreach(script IN LISTS scripts)
# check if we need to skip scripts
unset(skip_script)
foreach(skip_directory IN LISTS IE_SHELLCHECK_SKIP)
foreach(skip_directory IN LISTS SHELLCHECK_SKIP)
if(script MATCHES "${skip_directory}/*")
set(skip_script ON)
endif()
@@ -39,21 +39,21 @@ function(ie_shellcheck_process)
continue()
endif()
string(REPLACE "${IE_SHELLCHECK_DIRECTORY}" "${CMAKE_BINARY_DIR}/shellcheck" output_file ${script})
string(REPLACE "${SHELLCHECK_DIRECTORY}" "${CMAKE_BINARY_DIR}/shellcheck" output_file ${script})
set(output_file "${output_file}.txt")
get_filename_component(script_name "${script}" NAME)
add_custom_command(OUTPUT ${output_file}
COMMAND ${CMAKE_COMMAND}
-D IE_SHELLCHECK_PROGRAM=${shellcheck_PROGRAM}
-D IE_SHELL_SCRIPT=${script}
-D IE_SHELLCHECK_OUTPUT=${output_file}
-P ${IE_SHELLCHECK_SCRIPT}
DEPENDS ${script} ${IE_SHELLCHECK_SCRIPT}
-D SHELLCHECK_PROGRAM=${shellcheck_PROGRAM}
-D SHELL_SCRIPT=${script}
-D SHELLCHECK_OUTPUT=${output_file}
-P ${SHELLCHECK_SCRIPT}
DEPENDS ${script} ${SHELLCHECK_SCRIPT}
COMMENT "Check script ${script_name}"
VERBATIM)
list(APPEND outputs ${output_file})
endforeach()
add_custom_target(ie_shellcheck DEPENDS ${outputs})
add_custom_target(ov_shellcheck DEPENDS ${outputs})
endfunction()

View File

@@ -2,25 +2,19 @@
# SPDX-License-Identifier: Apache-2.0
#
if(NOT DEFINED IE_SHELLCHECK_PROGRAM)
message(FATAL_ERROR "IE_SHELLCHECK_PROGRAM is not defined")
endif()
if(NOT DEFINED IE_SHELL_SCRIPT)
message(FATAL_ERROR "IE_SHELL_SCRIPT is not defined")
endif()
if(NOT DEFINED IE_SHELLCHECK_OUTPUT)
message(FATAL_ERROR "IE_SHELLCHECK_OUTPUT is not defined")
endif()
foreach(var SHELLCHECK_PROGRAM SHELL_SCRIPT SHELLCHECK_OUTPUT)
if(NOT DEFINED ${var})
message(FATAL_ERROR "${var} is not defined")
endif()
endforeach()
set(rules "SC1091,SC2164,SC2162,SC1090")
execute_process(COMMAND ${IE_SHELLCHECK_PROGRAM} --exclude=${rules} ${IE_SHELL_SCRIPT}
execute_process(COMMAND ${SHELLCHECK_PROGRAM} --exclude=${rules} ${SHELL_SCRIPT}
OUTPUT_VARIABLE error_message
RESULT_VARIABLE exit_code
OUTPUT_STRIP_TRAILING_WHITESPACE)
file(WRITE "${IE_SHELLCHECK_OUTPUT}" "${error_message}")
file(WRITE "${SHELLCHECK_OUTPUT}" "${error_message}")
if(NOT exit_code EQUAL 0)
message(FATAL_ERROR "${error_message}")

View File

@@ -14,13 +14,13 @@
# Path to IE own version of TBBConfig.cmake old TBB version without cmake config.
if(APPLE)
set(IE_OWN_TBB_CONFIG tbb/mac)
set(_OV_OWN_TBB_CONFIG tbb/mac)
elseif(UNIX)
set(IE_OWN_TBB_CONFIG tbb/lnx)
set(_OV_OWN_TBB_CONFIG tbb/lnx)
elseif(WIN)
set(IE_OWN_TBB_CONFIG tbb/win)
set(_OV_OWN_TBB_CONFIG tbb/win)
else()
unset(IE_OWN_TBB_CONFIG)
unset(_OV_OWN_TBB_CONFIG)
endif()
unset(TBB_DIR)
@@ -29,8 +29,10 @@ unset(TBB_DIR CACHE)
find_package(TBB
2017.0
CONFIG
PATHS "${IEDevScripts_DIR}/${IE_OWN_TBB_CONFIG}"
PATHS "${OpenVINODeveloperScripts_DIR}/${_OV_OWN_TBB_CONFIG}"
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH)
find_package_handle_standard_args(TBB CONFIG_MODE)
unset(_OV_OWN_TBB_CONFIG)

View File

@@ -166,6 +166,8 @@ endif()
ov_parse_ci_build_number()
macro (addVersionDefines FILE)
message(WARNING "'addVersionDefines' is deprecated. Please, use 'ov_add_version_defines'")
set(__version_file ${FILE})
if(NOT IS_ABSOLUTE ${__version_file})
set(__version_file "${CMAKE_CURRENT_SOURCE_DIR}/${__version_file}")

View File

@@ -73,7 +73,7 @@ function(ov_add_vs_version_file)
set(OV_VS_VER_INTERNALNAME_STR ${VS_VER_NAME})
set(vs_version_output "${CMAKE_CURRENT_BINARY_DIR}/vs_version.rc")
configure_file("${IEDevScripts_DIR}/vs_version/vs_version.rc.in" "${vs_version_output}" @ONLY)
configure_file("${OpenVINODeveloperScripts_DIR}/vs_version/vs_version.rc.in" "${vs_version_output}" @ONLY)
source_group("src" FILES ${vs_version_output})
target_sources(${VS_VER_NAME} PRIVATE ${vs_version_output})

View File

@@ -5,15 +5,14 @@
#[[
function links static library without removing any symbol from it.
ieTargetLinkWholeArchive(<target name> <lib1> [<lib2> ...])
ov_target_link_whole_archive(<target name> <lib1> [<lib2> ...])
Example:
ieTargetLinkWholeArchive("FunctionalTests" "CommonLib" "AnotherLib")
ov_target_link_whole_archive("FunctionalTests" "CommonLib" "AnotherLib")
#]]
function(ieTargetLinkWholeArchive targetName)
set(libs)
foreach(staticLib ${ARGN})
function(ov_target_link_whole_archive targetName)
foreach(staticLib IN LISTS ARGN)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# CMake does not support generator expression in LINK_FLAGS, so we workaround it a little bit:
# passing same static library as normal link (to get build deps working, and includes too), than using WHOLEARCHIVE option
@@ -52,3 +51,10 @@ function(ieTargetLinkWholeArchive targetName)
target_link_libraries(${targetName} PRIVATE ${libs})
endif()
endfunction()
# deprecated
function(ieTargetLinkWholeArchive)
message(WARNING "'ieTargetLinkWholeArchive' is deprecated, use 'ov_target_link_whole_archive' instead")
ov_target_link_whole_archive(${ARGN})
endfunction()