Skip to content

Commit 74126d8

Browse files
committed
Use py-build-cmake
1 parent ca625dc commit 74126d8

12 files changed

+148
-103
lines changed

.github/workflows/genai_python_lib.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ jobs:
2424
- run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh
2525
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
2626
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j
27-
# GitHub Actions already provides what is listed in ./requirements-build.txt but the internal
28-
# build system doesn't. Install ./requirements-build.txt to detect possible conflicts.
29-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
27+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
3028
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
31-
- run: source ./ov/setupvars.sh && python -m pip install . --config-settings=build-dir="build" --verbose
29+
- run: source ./ov/setupvars.sh && python -m pip install . --verbose
3230
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
3331

3432
macos_genai_python_lib:
@@ -49,11 +47,9 @@ jobs:
4947
- run: brew install coreutils scons
5048
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
5149
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j
52-
# GitHub Actions already provides what is listed in ./requirements-build.txt but the internal
53-
# build system doesn't. Install ./requirements-build.txt to detect possible conflicts.
54-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
50+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
5551
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
56-
- run: source ./ov/setupvars.sh && python -m pip install . --config-settings=build-dir="build" --verbose
52+
- run: source ./ov/setupvars.sh && python -m pip install . --verbose
5753
- run: python -c "from openvino_genai import LLMPipeline"
5854
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
5955

@@ -78,8 +74,8 @@ jobs:
7874
- run: mklink /D ov w_openvino_toolkit_windows_2024.2.0.dev20240529_x86_64
7975
- run: call ./ov/setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
8076
- run: call ./ov/setupvars.bat && cmake --build ./build/ --config Release -j
81-
- run: call ./ov/setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
77+
- run: call ./ov/setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
8278
# cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that.
8379
- run: set "PYTHONPATH=./build/" && call ./ov/setupvars.bat && python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
84-
- run: call ./ov/setupvars.bat && python -m pip install . --config-settings=build-dir="build" --verbose
80+
- run: call ./ov/setupvars.bat && python -m pip install . --verbose
8581
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# build/artifact dirs
2-
_*
32
[Bb]uild*/
4-
cmake-build*
53

64
# but ensure we don't skip __init__.py and __main__.py
75
!__init__.py
@@ -15,16 +13,13 @@ cmake-build*
1513
.DS_Store
1614
**/tags
1715
compile_commands.json
18-
bin/
1916
.local_vimrc
2017
.gdb_history
2118
.vimspector.json
2219
doc/
23-
docs/build_documentation/work_dir/
2420
temp/
2521
.repo/
2622
CMakeLists.txt.user
27-
docs/IE_PLUGIN_DG/html/
2823
CMakeUserPresets.json
2924

3025
*.project

CMakeLists.txt

+20-27
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,30 @@ elseif(NOT GENERATOR_IS_MULTI_CONFIG_VAR AND NOT DEFINED CMAKE_BUILD_TYPE)
1717
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...")
1818
endif()
1919

20-
project(OpenVINOGenAI VERSION 2024.2.0.0)
20+
project(OpenVINOGenAI
21+
VERSION 2024.2.0.0
22+
DESCRIPTION "OpenVINO GenAI"
23+
HOMEPAGE_URL "https://github.com/openvinotoolkit/openvino.genai"
24+
LANGUAGES CXX)
2125

22-
option(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "Boolean toggle to include/exclude top level directory." OFF)
23-
if(WIN32)
24-
set(CPACK_GENERATOR "ZIP" CACHE STRING "List of CPack generators to use.")
26+
# Find OpenVINODeveloperPackage first to compile with SDL flags
27+
find_package(OpenVINODeveloperPackage QUIET
28+
PATHS "${OpenVINO_DIR}")
29+
if(NOT OpenVINODeveloperPackage_FOUND)
30+
find_package(OpenVINO REQUIRED COMPONENTS Runtime)
2531
endif()
2632

27-
add_subdirectory(./thirdparty/)
33+
include(cmake/features.cmake)
34+
35+
add_subdirectory(thirdparty)
2836
add_subdirectory(src)
29-
add_subdirectory(samples/cpp/beam_search_causal_lm/)
30-
add_subdirectory(samples/cpp/chat_sample/)
31-
add_subdirectory(samples/cpp/greedy_causal_lm/)
32-
add_subdirectory(samples/cpp/multinomial_causal_lm/)
33-
add_subdirectory(samples/cpp/prompt_lookup_decoding_lm/)
34-
add_subdirectory(samples/cpp/speculative_decoding_lm/)
35-
36-
install(DIRECTORY
37-
./samples/cpp/beam_search_causal_lm
38-
./samples/cpp/chat_sample
39-
./samples/cpp/greedy_causal_lm
40-
./samples/cpp/multinomial_causal_lm
41-
# Don't install prompt_lookup_decoding_lm and speculative_decoding_lm because they don't use openvino_genai library and arent verifyed yet.
42-
DESTINATION samples/cpp/ COMPONENT cpp_samples_genai)
43-
install(DIRECTORY
44-
./samples/python/beam_search_causal_lm
45-
./samples/python/chat_sample
46-
./samples/python/greedy_causal_lm
47-
./samples/python/multinomial_causal_lm
48-
DESTINATION samples/python/ COMPONENT cpp_samples_genai
49-
USE_SOURCE_PERMISSIONS)
50-
install(FILES ./samples/requirements.txt DESTINATION ./samples/ COMPONENT cpp_samples_genai)
37+
add_subdirectory(samples)
38+
5139
install(FILES LICENSE DESTINATION licensing COMPONENT licensing_genai RENAME LICENSE-GENAI)
5240
install(FILES third-party-programs.txt DESTINATION licensing COMPONENT licensing_genai RENAME third-party-programs-genai.txt)
41+
42+
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
43+
if(WIN32 AND NOT DEFINED CPACK_GENERATOR)
44+
set(CPACK_GENERATOR "ZIP")
45+
endif()
5346
include(CPack)

cmake/features.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (C) 2018-2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
5+
option(ENABLE_PYTHON "Enable Python API build" ON)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (C) 2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Will be overwritten by pyproject.toml or cmake.
5-
__version__ = "0.0.0.0"
4+
# Will be overwritten by cmake.
5+
__version__ = "@OpenVINOGenAI_VERSION@"

pyproject.toml

+18-19
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,27 @@ dependencies = [
1919
"openvino_tokenizers~=2024.2.0.0"
2020
]
2121

22-
[tool.scikit-build]
23-
cmake.build-type = "Release"
24-
cmake.source-dir = "./"
25-
cmake.targets = ["py_generate_pipeline"] # Adding genai would trigger a Release build and Debug build after it. py_generate_pipeline depends on genai and genai will be built anyway. It's not been investigated why both build types are triggered.
26-
cmake.version = ">=3.23"
27-
install.components = ["wheel_genai"]
28-
sdist.cmake = true
29-
wheel.packages = ["src/python/openvino_genai"]
30-
wheel.install-dir = "openvino_genai"
31-
wheel.build-tag = "000"
32-
wheel.license-files = ["LICENSE", "SECURITY.md", "third-party-programs.txt"]
22+
[tool.py-build-cmake.module]
23+
directory = "src/python"
3324

34-
[[tool.scikit-build.generate]]
35-
path = "openvino_genai/__version__.py"
36-
template = '''
37-
__version__ = "${version}"
38-
'''
25+
[tool.py-build-cmake.sdist]
26+
exclude = ["llm_bench", "samples", "tests", "thirdparty"]
27+
28+
[tool.py-build-cmake.cmake]
29+
minimum_version = "3.23"
30+
build_type = "Release"
31+
config = ["Release"]
32+
find_python3 = true
33+
build_args = ["--parallel", "--target", "py_generate_pipeline"]
34+
install_args = ["--strip"]
35+
install_components = ["wheel_genai"]
3936

4037
[build-system]
41-
# TODO: add build.tool-args = ["--parallel"] after scikit-build-core is updated to 0.9.4+.
42-
requires = ["scikit-build-core~=0.8.0"] # See https://github.com/openvinotoolkit/openvino_tokenizers/pull/123
43-
build-backend = "scikit_build_core.build"
38+
requires = [
39+
"py-build-cmake@git+https://github.com/tttapa/py-build-cmake@7ab73da351c7140f06d727a8705bece4cf544cd9",
40+
"cmake~=3.23"
41+
]
42+
build-backend = "py_build_cmake.build"
4443

4544
[tool.pytest.ini_options]
4645
markers = [

requirements-build.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
build~=1.2.1
2-
cmake~=3.29
1+
cmake~=3.29

samples/CMakeLists.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (C) 2018-2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
5+
add_subdirectory(cpp/beam_search_causal_lm)
6+
add_subdirectory(cpp/chat_sample)
7+
add_subdirectory(cpp/greedy_causal_lm)
8+
add_subdirectory(cpp/multinomial_causal_lm)
9+
add_subdirectory(cpp/prompt_lookup_decoding_lm)
10+
add_subdirectory(cpp/speculative_decoding_lm)
11+
12+
install(FILES requirements.txt DESTINATION samples
13+
COMPONENT cpp_samples_genai)
14+
15+
install(DIRECTORY
16+
cpp/beam_search_causal_lm
17+
cpp/chat_sample
18+
cpp/greedy_causal_lm
19+
cpp/multinomial_causal_lm
20+
# Don't install prompt_lookup_decoding_lm and speculative_decoding_lm because they don't use openvino_genai library and arent verifyed yet.
21+
DESTINATION samples/cpp COMPONENT cpp_samples_genai)
22+
23+
install(DIRECTORY
24+
python/beam_search_causal_lm
25+
python/chat_sample
26+
python/greedy_causal_lm
27+
python/multinomial_causal_lm
28+
DESTINATION samples/python COMPONENT cpp_samples_genai
29+
USE_SOURCE_PERMISSIONS)

src/CMakeLists.txt

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5-
# Find OpenVINODeveloperPackage first to compile with SDL flags
6-
find_package(OpenVINODeveloperPackage QUIET
7-
PATHS "${OpenVINO_DIR}")
8-
if(NOT OpenVINODeveloperPackage_FOUND)
9-
find_package(OpenVINO REQUIRED COMPONENTS Runtime)
10-
endif()
11-
125
add_subdirectory(cpp)
13-
add_subdirectory(python)
6+
7+
if(ENABLE_PYTHON)
8+
add_subdirectory(python)
9+
endif()

src/cpp/CMakeLists.txt

+24-22
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,20 @@ set_target_properties(${TARGET_NAME} PROPERTIES
5858
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
5959
)
6060
# Extract two last digits from CMAKE_PROJECT_VERSION_MAJOR because SOVERSION can only contain up to 4 symbols.
61-
string(REGEX MATCH [=[[0-9][0-9]$]=] MAJOR_SUFFIX ${CMAKE_PROJECT_VERSION_MAJOR})
62-
if(SKBUILD AND LINUX)
61+
string(REGEX MATCH [=[[0-9][0-9]$]=] MAJOR_SUFFIX ${OpenVINOGenAI_VERSION_MAJOR})
62+
if(DEFINED PY_BUILD_CMAKE_PACKAGE_NAME AND LINUX)
6363
# Don't pack symlinks but append version hash to the name for wheel
6464
set_target_properties(${TARGET_NAME} PROPERTIES
65-
SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJOR_SUFFIX}${CMAKE_PROJECT_VERSION_MINOR}${CMAKE_PROJECT_VERSION_PATCH})
66-
elseif(SKBUILD AND APPELE)
65+
SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJOR_SUFFIX}${OpenVINOGenAI_VERSION_MINOR}${OpenVINOGenAI_VERSION_PATCH})
66+
elseif(DEFINED PY_BUILD_CMAKE_PACKAGE_NAME AND APPELE)
6767
set_target_properties(${TARGET_NAME} PROPERTIES
68-
SUFFIX .${MAJOR_SUFFIX}${CMAKE_PROJECT_VERSION_MINOR}${CMAKE_PROJECT_VERSION_PATCH}${CMAKE_SHARED_LIBRARY_SUFFIX})
68+
SUFFIX .${MAJOR_SUFFIX}${OpenVINOGenAI_VERSION_MINOR}${OpenVINOGenAI_VERSION_PATCH}${CMAKE_SHARED_LIBRARY_SUFFIX})
6969
else()
7070
set_target_properties(${TARGET_NAME} PROPERTIES
7171
VERSION ${CMAKE_PROJECT_VERSION}
72-
SOVERSION ${MAJOR_SUFFIX}${CMAKE_PROJECT_VERSION_MINOR}${CMAKE_PROJECT_VERSION_PATCH})
72+
SOVERSION ${MAJOR_SUFFIX}${OpenVINOGenAI_VERSION_MINOR}${OpenVINOGenAI_VERSION_PATCH})
7373
endif()
7474

75-
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
76-
install(TARGETS ${TARGET_NAME}
77-
LIBRARY DESTINATION python/openvino_genai/ COMPONENT pygenai_${Python_VERSION_MAJOR}_${Python_VERSION_MINOR}
78-
RUNTIME DESTINATION python/openvino_genai/ COMPONENT pygenai_${Python_VERSION_MAJOR}_${Python_VERSION_MINOR})
79-
8075
# - Windows: `<openvino_dir>\runtime\bin\intel64\Release\`
8176
# - MacOS_x86: `<openvino_dir>/runtime/lib/intel64/Release`
8277
# - MacOS_arm64: `<openvino_dir>/runtime/lib/arm64/Release/`
@@ -98,17 +93,24 @@ endif()
9893
if(MSVC OR APPLE)
9994
set(ARCH_DIR ${ARCH_DIR}/${CMAKE_BUILD_TYPE})
10095
endif()
96+
10197
install(TARGETS ${TARGET_NAME} EXPORT OpenVINOGenAITargets
102-
LIBRARY DESTINATION runtime/lib/${ARCH_DIR} COMPONENT core_genai
103-
NAMELINK_COMPONENT core_genai_dev
104-
ARCHIVE DESTINATION runtime/lib/${ARCH_DIR} COMPONENT core_genai_dev
105-
RUNTIME DESTINATION runtime/bin/${ARCH_DIR} COMPONENT core_genai
106-
INCLUDES DESTINATION runtime/include)
107-
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION runtime/include COMPONENT core_genai_dev)
108-
install(EXPORT OpenVINOGenAITargets FILE OpenVINOGenAITargets.cmake NAMESPACE openvino:: DESTINATION runtime/cmake)
109-
include(CMakePackageConfigHelpers)
110-
configure_package_config_file(OpenVINOGenAIConfig.cmake.in "${CMAKE_BINARY_DIR}/OpenVINOGenAIConfig.cmake" INSTALL_DESTINATION runtime/cmake)
111-
install(FILES "${CMAKE_BINARY_DIR}/OpenVINOGenAIConfig.cmake" "${CMAKE_BINARY_DIR}/OpenVINOGenAIConfig.cmake" DESTINATION runtime/cmake COMPONENT core_genai_dev)
98+
LIBRARY DESTINATION runtime/lib/${ARCH_DIR} COMPONENT core_genai
99+
NAMELINK_COMPONENT core_genai_dev
100+
ARCHIVE DESTINATION runtime/lib/${ARCH_DIR} COMPONENT core_genai_dev
101+
RUNTIME DESTINATION runtime/bin/${ARCH_DIR} COMPONENT core_genai
102+
INCLUDES DESTINATION runtime/include)
103+
104+
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
105+
DESTINATION runtime/include COMPONENT core_genai_dev)
106+
install(EXPORT OpenVINOGenAITargets FILE OpenVINOGenAITargets.cmake
107+
NAMESPACE openvino:: DESTINATION runtime/cmake)
108+
112109
include(CMakePackageConfigHelpers)
113-
write_basic_package_version_file("${CMAKE_BINARY_DIR}/OpenVINOGenAIConfigVersion.cmake" VERSION ${CMAKE_PROJECT_VERSION} COMPATIBILITY AnyNewerVersion)
110+
configure_package_config_file("${OpenVINOGenAI_SOURCE_DIR}/cmake/templates/OpenVINOGenAIConfig.cmake.in"
111+
"${CMAKE_BINARY_DIR}/OpenVINOGenAIConfig.cmake" INSTALL_DESTINATION runtime/cmake)
112+
write_basic_package_version_file("${CMAKE_BINARY_DIR}/OpenVINOGenAIConfigVersion.cmake"
113+
VERSION ${OpenVINOGenAI_VERSION} COMPATIBILITY AnyNewerVersion)
114+
install(FILES "${CMAKE_BINARY_DIR}/OpenVINOGenAIConfig.cmake" "${CMAKE_BINARY_DIR}/OpenVINOGenAIConfigVersion.cmake"
115+
DESTINATION runtime/cmake COMPONENT core_genai_dev)
114116
export(EXPORT OpenVINOGenAITargets FILE "${CMAKE_BINARY_DIR}/OpenVINOGenAITargets.cmake" NAMESPACE openvino::)

src/python/CMakeLists.txt

+39-8
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,31 @@ FetchContent_Declare(
1111
FetchContent_GetProperties(pybind11)
1212
if(NOT pybind11_POPULATED)
1313
FetchContent_Populate(pybind11)
14+
# search for FindPython3.cmake instead of legacy modules
15+
set(PYBIND11_FINDPYTHON ON)
16+
# the following two calls are required for cross-compilation
17+
if(OpenVINODeveloperPackage_DIR)
18+
ov_find_python3(REQUIRED)
19+
ov_detect_python_module_extension()
20+
else()
21+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
22+
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
23+
else()
24+
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
25+
endif()
26+
endif()
1427
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
1528
endif()
1629

1730
pybind11_add_module(py_generate_pipeline py_generate_pipeline.cpp)
18-
target_link_libraries(py_generate_pipeline PRIVATE openvino::genai nlohmann_json::nlohmann_json)
31+
target_link_libraries(py_generate_pipeline PRIVATE openvino::genai)
1932
set_target_properties(py_generate_pipeline PROPERTIES
2033
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
2134
)
2235
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/openvino_genai/__init__.py" DESTINATION "${CMAKE_BINARY_DIR}/openvino_genai/")
23-
write_file("${CMAKE_BINARY_DIR}/openvino_genai/__version__.py" "__version__ = \"${CMAKE_PROJECT_VERSION}\"")
36+
37+
configure_file("${OpenVINOGenAI_SOURCE_DIR}/cmake/templates/__version__.py.in"
38+
"${CMAKE_BINARY_DIR}/openvino_genai/__version__.py" @ONLY)
2439

2540
# setting RPATH / LC_RPATH depending on platform
2641
if(LINUX)
@@ -29,7 +44,7 @@ if(LINUX)
2944
elseif(APPLE)
3045
# to find libopenvino_genai.dylib in the same folder
3146
set(rpaths "@loader_path")
32-
if(DEFINED SKBUILD)
47+
if(DEFINED PY_BUILD_CMAKE_PACKAGE_NAME)
3348
# in case we build pip package, we need to refer to libopenvino.dylib from 'openvino' package
3449
list(APPEND rpaths "@loader_path/../openvino/libs")
3550
endif()
@@ -39,12 +54,28 @@ if(rpaths)
3954
set_target_properties(py_generate_pipeline PROPERTIES INSTALL_RPATH "${rpaths}")
4055
endif()
4156

42-
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
43-
install(FILES "${CMAKE_BINARY_DIR}/openvino_genai/__init__.py" "${CMAKE_BINARY_DIR}/openvino_genai/__version__.py" DESTINATION python/openvino_genai/ COMPONENT pygenai_${Python_VERSION_MAJOR}_${Python_VERSION_MINOR})
44-
install(TARGETS openvino_genai py_generate_pipeline LIBRARY DESTINATION python/openvino_genai/ COMPONENT pygenai_${Python_VERSION_MAJOR}_${Python_VERSION_MINOR})
57+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/openvino_genai/__init__.py"
58+
"${CMAKE_BINARY_DIR}/openvino_genai/__version__.py"
59+
DESTINATION python/openvino_genai
60+
COMPONENT pygenai_${Python_VERSION_MAJOR}_${Python_VERSION_MINOR})
61+
install(TARGETS py_generate_pipeline
62+
LIBRARY DESTINATION python/openvino_genai
63+
COMPONENT pygenai_${Python_VERSION_MAJOR}_${Python_VERSION_MINOR})
64+
65+
install(FILES "${CMAKE_BINARY_DIR}/openvino_genai/__version__.py"
66+
DESTINATION openvino_genai
67+
COMPONENT wheel_genai
68+
EXCLUDE_FROM_ALL)
69+
70+
install(FILES "${OpenVINOGenAI_SOURCE_DIR}/LICENSE"
71+
"${OpenVINOGenAI_SOURCE_DIR}/third-party-programs.txt"
72+
"${OpenVINOGenAI_SOURCE_DIR}/SECURITY.md"
73+
DESTINATION "${PY_BUILD_CMAKE_PACKAGE_NAME}-${PY_BUILD_CMAKE_PACKAGE_VERSION}.dist-info"
74+
COMPONENT wheel_genai
75+
EXCLUDE_FROM_ALL)
4576

4677
# wheel_genai component is used for wheel generation in pyproject.toml.
4778
# Exclude wheel_genai from normal packaging because there's pygenai_X_Y component for that.
4879
install(TARGETS openvino_genai py_generate_pipeline
49-
LIBRARY DESTINATION . COMPONENT wheel_genai EXCLUDE_FROM_ALL
50-
RUNTIME DESTINATION . COMPONENT wheel_genai EXCLUDE_FROM_ALL)
80+
LIBRARY DESTINATION openvino_genai COMPONENT wheel_genai EXCLUDE_FROM_ALL
81+
RUNTIME DESTINATION openvino_genai COMPONENT wheel_genai EXCLUDE_FROM_ALL)

0 commit comments

Comments
 (0)