openvino/cmake/developer_package/packaging/archive.cmake

101 lines
3.3 KiB
CMake

# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
include(GNUInstallDirs)
if(APPLE)
# on macOS versions with SIP enabled, we need to use @rpath
# because DYLD_LIBRARY_PATH is ignored
set(CMAKE_SKIP_INSTALL_RPATH OFF)
else()
# we don't need RPATHs, because setupvars.sh is used
set(CMAKE_SKIP_INSTALL_RPATH ON)
endif()
#
# ov_archive_cpack_set_dirs()
#
# Set directories for ARCHIVE cpack
#
macro(ov_archive_cpack_set_dirs)
# common "archive" package locations
# TODO: move current variables to OpenVINO specific locations
set(OV_CPACK_INCLUDEDIR runtime/include)
set(OV_CPACK_OPENVINO_CMAKEDIR runtime/cmake)
set(OV_CPACK_DOCDIR docs)
set(OV_CPACK_LICENSESDIR licenses)
set(OV_CPACK_SAMPLESDIR samples)
set(OV_CPACK_WHEELSDIR tools)
set(OV_CPACK_TOOLSDIR tools)
set(OV_CPACK_DEVREQDIR tools)
set(OV_CPACK_PYTHONDIR python)
if(USE_BUILD_TYPE_SUBFOLDER)
set(build_type ${CMAKE_BUILD_TYPE})
else()
set(build_type $<CONFIG>)
endif()
if(WIN32)
set(OV_CPACK_LIBRARYDIR runtime/lib/${ARCH_FOLDER}/${build_type})
set(OV_CPACK_RUNTIMEDIR runtime/bin/${ARCH_FOLDER}/${build_type})
set(OV_CPACK_ARCHIVEDIR runtime/lib/${ARCH_FOLDER}/${build_type})
elseif(APPLE)
set(OV_CPACK_LIBRARYDIR runtime/lib/${ARCH_FOLDER}/${build_type})
set(OV_CPACK_RUNTIMEDIR runtime/lib/${ARCH_FOLDER}/${build_type})
set(OV_CPACK_ARCHIVEDIR runtime/lib/${ARCH_FOLDER}/${build_type})
else()
set(OV_CPACK_LIBRARYDIR runtime/lib/${ARCH_FOLDER})
set(OV_CPACK_RUNTIMEDIR runtime/lib/${ARCH_FOLDER})
set(OV_CPACK_ARCHIVEDIR runtime/lib/${ARCH_FOLDER})
endif()
set(OV_CPACK_PLUGINSDIR ${OV_CPACK_RUNTIMEDIR})
endmacro()
ov_archive_cpack_set_dirs()
#
# Override include / exclude rules for components
# This is required to exclude some files from installation
# (e.g. archive packages don't require python_package component)
#
macro(ov_define_component_include_rules)
# core components
unset(OV_CPACK_COMP_CORE_EXCLUDE_ALL)
unset(OV_CPACK_COMP_CORE_C_EXCLUDE_ALL)
unset(OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL)
unset(OV_CPACK_COMP_CORE_C_DEV_EXCLUDE_ALL)
# tbb
unset(OV_CPACK_COMP_TBB_EXCLUDE_ALL)
unset(OV_CPACK_COMP_TBB_DEV_EXCLUDE_ALL)
# licensing
unset(OV_CPACK_COMP_LICENSING_EXCLUDE_ALL)
# samples
unset(OV_CPACK_COMP_CPP_SAMPLES_EXCLUDE_ALL)
unset(OV_CPACK_COMP_C_SAMPLES_EXCLUDE_ALL)
unset(OV_CPACK_COMP_PYTHON_SAMPLES_EXCLUDE_ALL)
# python
unset(OV_CPACK_COMP_PYTHON_OPENVINO_EXCLUDE_ALL)
unset(OV_CPACK_COMP_BENCHMARK_APP_EXCLUDE_ALL)
unset(OV_CPACK_COMP_OVC_EXCLUDE_ALL)
set(OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE_EXCLUDE_ALL EXCLUDE_FROM_ALL)
unset(OV_CPACK_COMP_PYTHON_WHEELS_EXCLUDE_ALL)
unset(OV_CPACK_COMP_OPENVINO_REQ_FILES_EXCLUDE_ALL)
# nodejs
set(OV_CPACK_COMP_NPM_EXCLUDE_ALL EXCLUDE_FROM_ALL)
# tools
set(OV_CPACK_COMP_OPENVINO_DEV_REQ_FILES_EXCLUDE_ALL EXCLUDE_FROM_ALL)
# scripts
unset(OV_CPACK_COMP_INSTALL_DEPENDENCIES_EXCLUDE_ALL)
unset(OV_CPACK_COMP_SETUPVARS_EXCLUDE_ALL)
endmacro()
ov_define_component_include_rules()
# New in version 3.18
set(CPACK_ARCHIVE_THREADS 8)
# multiple packages are generated
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)