forked from openvinotoolkit/openvino.genai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
76 lines (61 loc) · 2.68 KB
/
CMakeLists.txt
File metadata and controls
76 lines (61 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (C) 2025-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
find_package(OpenVINOGenAI REQUIRED
PATHS
"${CMAKE_BINARY_DIR}" # Reuse the package from the build.
${OpenVINO_DIR} # GenAI may be installed alongside OpenVINO.
NO_CMAKE_FIND_ROOT_PATH
)
file(DOWNLOAD https://raw.githubusercontent.com/nothings/stb/f75e8d1cad7d90d72ef7a4661f1b994ef78b4e31/stb_image_write.h ${CMAKE_BINARY_DIR}/stb_image_write.h
EXPECTED_HASH MD5=845b8b43d7d941890a57a477455558ad)
include(FetchContent)
include(${CMAKE_CURRENT_SOURCE_DIR}/../fetch_opencv.cmake)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
FetchContent_Declare(indicators
URL https://github.com/p-ranav/indicators/archive/refs/tags/v2.3.tar.gz
URL_HASH SHA256=70da7a693ff7a6a283850ab6d62acf628eea17d386488af8918576d0760aef7b)
FetchContent_MakeAvailable(indicators)
# create main sample executable
add_executable(text2video text2video.cpp imwrite_video.cpp)
target_include_directories(text2video PRIVATE ${CMAKE_BINARY_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/../image_generation/" "${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cpp/src/")
ov_genai_link_opencv(text2video core imgproc videoio imgcodecs)
target_link_libraries(text2video PRIVATE openvino::genai indicators::indicators)
if(UNIX AND NOT APPLE)
set_target_properties(text2video PROPERTIES
INSTALL_RPATH "$ORIGIN/../lib"
)
elseif(APPLE)
set_target_properties(text2video PROPERTIES
INSTALL_RPATH "@loader_path/../lib"
)
endif()
set_target_properties(text2video PROPERTIES
# Ensure out of box LC_RPATH on macOS with SIP
INSTALL_RPATH_USE_LINK_PATH ON)
install(TARGETS text2video
RUNTIME DESTINATION samples_bin/
COMPONENT samples_bin
EXCLUDE_FROM_ALL)
# create LoRA sample executable
add_executable(lora_text2video lora_text2video.cpp imwrite_video.cpp)
target_include_directories(lora_text2video PRIVATE ${CMAKE_BINARY_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/../image_generation/" "${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cpp/src/")
ov_genai_link_opencv(lora_text2video core imgproc videoio imgcodecs)
target_link_libraries(lora_text2video PRIVATE openvino::genai indicators::indicators)
if(UNIX AND NOT APPLE)
set_target_properties(lora_text2video PROPERTIES
INSTALL_RPATH "$ORIGIN/../lib"
)
elseif(APPLE)
set_target_properties(lora_text2video PROPERTIES
INSTALL_RPATH "@loader_path/../lib"
)
endif()
set_target_properties(lora_text2video PROPERTIES
# Ensure out of box LC_RPATH on macOS with SIP
INSTALL_RPATH_USE_LINK_PATH ON)
install(TARGETS lora_text2video
RUNTIME DESTINATION samples_bin/
COMPONENT samples_bin
EXCLUDE_FROM_ALL)