Skip to content

Commit

Permalink
Final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Dec 17, 2020
1 parent 835d9d0 commit 1740df3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
18 changes: 11 additions & 7 deletions cmake/developer_package/IEDevScriptsConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ endif()
set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH "${IEDevScripts_DIR}")

function(set_ci_build_number)
set(repo_root "${CMAKE_SOURCE_DIR}")
include(version)
set(CI_BUILD_NUMBER "${CI_BUILD_NUMBER}" PARENT_SCOPE)
endfunction()

set_ci_build_number()

include(features)

#
Expand Down Expand Up @@ -104,6 +112,9 @@ endif()

# allow to override default OUTPUT_ROOT root
if(NOT DEFINED OUTPUT_ROOT)
if(NOT DEFINED OpenVINO_MAIN_SOURCE_DIR)
message(FATAL_ERROR "OpenVINO_MAIN_SOURCE_DIR is not defined")
endif()
set(OUTPUT_ROOT ${OpenVINO_MAIN_SOURCE_DIR})
endif()

Expand Down Expand Up @@ -200,13 +211,6 @@ include(linux_name)
include(models)
include(api_validator/api_validator)

function(set_ci_build_number)
set(OpenVINO_MAIN_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
include(version)
set(CI_BUILD_NUMBER "${CI_BUILD_NUMBER}" PARENT_SCOPE)
endfunction()
set_ci_build_number()

include(vs_version/vs_version)
include(plugins/plugins)
include(add_ie_target)
Expand Down
2 changes: 1 addition & 1 deletion cmake/developer_package/coverage/coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(NOT TARGET ie_coverage)
endif()

set(IE_COVERAGE_REPORTS "${CMAKE_BINARY_DIR}/coverage")
set(IE_COVERAGE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/coverage")
set(IE_COVERAGE_SCRIPT_DIR "${IEDevScripts_DIR}/coverage")

include(CMakeParseArguments)

Expand Down
5 changes: 4 additions & 1 deletion cmake/developer_package/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Usage: ie_option(<option_variable> "description" <initial value or boolean expression> [IF <condition>])

include (CMakeDependentOption)
include (version)

macro (ie_option variable description value)
option(${variable} "${description}" ${value})
Expand Down Expand Up @@ -32,6 +31,10 @@ macro (ie_option_enum variable description value)
endmacro()

function (print_enabled_features)
if(NOT COMMAND set_ci_build_number)
message(FATAL_ERROR "CI_BUILD_NUMBER is not set yet")
endif()

message(STATUS "Inference Engine enabled features: ")
message(STATUS "")
message(STATUS " CI_BUILD_NUMBER: ${CI_BUILD_NUMBER}")
Expand Down
2 changes: 1 addition & 1 deletion cmake/developer_package/shellcheck/shellcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(ie_shellcheck_process)

cmake_parse_arguments(IE_SHELLCHECK "" "DIRECTORY" "SKIP" ${ARGN})

set(IE_SHELLCHECK_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/shellcheck/shellcheck_process.cmake")
set(IE_SHELLCHECK_SCRIPT "${IEDevScripts_DIR}/shellcheck/shellcheck_process.cmake")
file(GLOB_RECURSE scripts "${IE_SHELLCHECK_DIRECTORY}/*.sh")
foreach(script IN LISTS scripts)
# check if we need to skip scripts
Expand Down
10 changes: 8 additions & 2 deletions cmake/developer_package/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
#

function (branchName VAR)
if(NOT DEFINED repo_root)
message(FATAL_ERROR "repo_root is not defined")
endif()
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${OpenVINO_MAIN_SOURCE_DIR}
WORKING_DIRECTORY ${repo_root}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set (${VAR} ${GIT_BRANCH} PARENT_SCOPE)
endfunction()

function (commitHash VAR)
if(NOT DEFINED repo_root)
message(FATAL_ERROR "repo_root is not defined")
endif()
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${OpenVINO_MAIN_SOURCE_DIR}
WORKING_DIRECTORY ${repo_root}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set (${VAR} ${GIT_COMMIT_HASH} PARENT_SCOPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# SPDX-License-Identifier: Apache-2.0
#

# Variables to export in plugin's projects
# TODO: remove after changing [private plugins]
set(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_MAIN_SOURCE_DIR@") # KMB, HDDL
set(IE_MAIN_SOURCE_DIR "@IE_MAIN_SOURCE_DIR@") # KMB, HDDL

set(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_MAIN_SOURCE_DIR@")
set(IE_MAIN_SOURCE_DIR "@IE_MAIN_SOURCE_DIR@")
# Variables to export in plugin's projects

set(ie_options "@IE_OPTIONS@;CMAKE_BUILD_TYPE;CMAKE_SKIP_RPATH")
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path)
Expand Down Expand Up @@ -40,7 +41,7 @@ set(InferenceEngine_LIBRARIES IE::inference_engine)

# TODO: remove after private plugin change
list(APPEND CMAKE_MODULE_PATH "@OpenVINO_MAIN_SOURCE_DIR@/cmake/developer_package" # KMB
"@OpenVINO_MAIN_SOURCE_DIR@/cmake/developer_package/download" # KMB
"@OpenVINO_MAIN_SOURCE_DIR@/cmake/developer_package/download" # KMB, HDDL
"@IE_MAIN_SOURCE_DIR@/cmake") # HDDL

# generic stuff from developer package
Expand Down

0 comments on commit 1740df3

Please sign in to comment.