simple Windows installer POC (#12308)

* Fixes for cases when TBB_DIR env var is set

* Don't use make in build_samples.sh script

* First version of Windows installer

* WIndows NSIS installer
This commit is contained in:
Ilya Lavrenov
2022-07-27 14:04:22 +04:00
committed by GitHub
parent 1dd13e2cf6
commit 101e1ea5ad
26 changed files with 177 additions and 53 deletions

View File

@@ -0,0 +1,41 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# installation directory
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel")
# TODO: provide icons
# set(CPACK_NSIS_MUI_ICON "")
# set(CPACK_NSIS_MUI_UNIICON "${CPACK_NSIS_MUI_ICON}")
# set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "")
# set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "")
# set(CPACK_NSIS_MUI_HEADERIMAGE "")
# we allow to install several packages at once
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL OFF)
set(CPACK_NSIS_MODIFY_PATH OFF)
set(CPACK_NSIS_DISPLAY_NAME "Intel(R) OpenVINO(TM) ${OpenVINO_VERSION}")
set(CPACK_NSIS_PACKAGE_NAME "Intel(R) OpenVINO(TM) ToolKit, v. ${OpenVINO_VERSION}.${OpenVINO_PATCH_VERSION}")
# contact
set(CPACK_NSIS_CONTACT "CPACK_NSIS_CONTACT")
# links in menu
set(CPACK_NSIS_MENU_LINKS
"https://docs.openvinoo.ai" "OpenVINO Documentation")
# welcome and finish titles
set(CPACK_NSIS_WELCOME_TITLE "Welcome to Intel(R) Distribution of OpenVINO(TM) Toolkit installation")
set(CPACK_NSIS_FINISH_TITLE "")
# autoresize?
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
# branding text
set(CPACK_NSIS_BRANDING_TEXT "Intel(R) Corp.")
set(CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION RIGHT)
# don't set this variable since we need a user to agree with a lincense
# set(CPACK_NSIS_IGNORE_LICENSE_PAGE OFF)

View File

@@ -51,19 +51,27 @@ ov_cpack_set_dirs()
#
# Wraps original `cpack_add_component` and adds component to internal IE list
#
unset(IE_CPACK_COMPONENTS_ALL CACHE)
function(ie_cpack_add_component name)
if(NOT ${name} IN_LIST IE_CPACK_COMPONENTS_ALL)
cpack_add_component(${name} ${args})
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 STRING "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 STRING "" FORCE)
endif()
endfunction()
foreach(comp IN LISTS IE_CPACK_COMPONENTS_ALL)
unset(_${comp}_cpack_component_args)
endforeach()
unset(IE_CPACK_COMPONENTS_ALL CACHE)
# create `tests` component
if(ENABLE_TESTS)
cpack_add_component(tests DISABLED)
cpack_add_component(tests HIDDEN)
endif()
#
@@ -110,6 +118,10 @@ if(CPACK_GENERATOR STREQUAL "DEB")
include(packaging/debian)
endif()
if(CPACK_GENERATOR STREQUAL "NSIS")
include(packaging/nsis)
endif()
macro(ie_cpack)
if(NOT DEFINED CPACK_GENERATOR)
set(CPACK_GENERATOR "TGZ")
@@ -122,6 +134,8 @@ macro(ie_cpack)
set(CPACK_PACKAGE_CONTACT "OpenVINO Developers <openvino@intel.com>")
set(CPACK_VERBATIM_VARIABLES ON)
set(CPACK_COMPONENTS_ALL ${ARGN})
# TODO: set proper license file
set(CPACK_RESOURCE_FILE_LICENSE "${OpenVINO_SOURCE_DIR}/LICENSE")
# TODO: check whether we need it
# default permissions for directories creation
@@ -159,15 +173,17 @@ macro(ie_cpack)
# generator specific variables
if(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|ZIP)$")
# New in version 3.18
set(CPACK_ARCHIVE_THREADS 8)
# multiple packages are generated
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
elseif(CPACK_GENERATOR STREQUAL "DEB")
# include Debian dedicated per-component configuration file
# NOTE: private modules need to define ov_debian_components macro
# for custom debian packages configuration
if(COMMAND ov_debian_components)
ov_debian_components()
endif()
endif()
# include GENERATOR dedicated per-component configuration file
# NOTE: private modules need to define ov_cpack_settings macro
# for custom packages configuration
if(COMMAND ov_cpack_settings)
ov_cpack_settings()
endif()
include(CPack)

View File

@@ -20,6 +20,7 @@ endif()
#
# ie_add_plugin(NAME <targetName>
# DEVICE_NAME <deviceName>
# [PSEUDO_DEVICE]
# [PSEUDO_PLUGIN_FOR <actual_device>]
# [AS_EXTENSION]
# [DEFAULT_CONFIG <key:value;...>]
@@ -32,7 +33,7 @@ endif()
# )
#
function(ie_add_plugin)
set(options SKIP_INSTALL ADD_CLANG_FORMAT AS_EXTENSION SKIP_REGISTRATION)
set(options SKIP_INSTALL PSEUDO_DEVICE ADD_CLANG_FORMAT AS_EXTENSION SKIP_REGISTRATION)
set(oneValueArgs NAME DEVICE_NAME VERSION_DEFINES_FOR PSEUDO_PLUGIN_FOR)
set(multiValueArgs DEFAULT_CONFIG SOURCES OBJECT_LIBRARIES CPPLINT_FILTERS)
cmake_parse_arguments(IE_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -135,12 +136,23 @@ function(ie_add_plugin)
# install rules
if(NOT IE_PLUGIN_SKIP_INSTALL OR NOT BUILD_SHARED_LIBS)
string(TOLOWER "${IE_PLUGIN_DEVICE_NAME}" install_component)
ie_cpack_add_component(${install_component} REQUIRED DEPENDS core)
if(IE_PLUGIN_PSEUDO_DEVICE)
set(plugin_hidden HIDDEN)
endif()
ie_cpack_add_component(${install_component}
DISPLAY_NAME "${IE_PLUGIN_DEVICE_NAME} runtime"
DESCRIPTION "${IE_PLUGIN_DEVICE_NAME} runtime"
${plugin_hidden}
DEPENDS ${OV_CPACK_COMP_CORE})
if(BUILD_SHARED_LIBS)
install(TARGETS ${IE_PLUGIN_NAME}
LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR}
COMPONENT ${install_component})
install(TARGETS ${IE_PLUGIN_NAME}
LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR}
COMPONENT ${install_component})
else()
ov_install_static_lib(${IE_PLUGIN_NAME} ${install_component})
endif()