-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Generalize-install-locations.patch
62 lines (54 loc) · 2.15 KB
/
0001-Generalize-install-locations.patch
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
From 62ce17eb08b838fd4ac78d7fc3ece57694aad32a Mon Sep 17 00:00:00 2001
From: Tom Rix <trix@redhat.com>
Date: Sat, 20 Jan 2024 08:00:46 -0500
Subject: [PATCH] Generalize install locations
On Fedora the install location is dependent on the arch
ex/ for x86_64 libraries install to /usr/lib64
So copy how llama-cpp does its install, replacing 'llama' with 'whisper'
in the cmake variables.
Signed-off-by: Tom Rix <trix@redhat.com>
---
CMakeLists.txt | 17 ++++++++++++-----
cmake/DefaultTargetOptions.cmake | 4 ++--
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 567a58d..01e64c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -549,12 +549,19 @@ set_target_properties(${TARGET} PROPERTIES PUBLIC_HEADER "ggml.h;whisper.h")
include(GNUInstallDirs)
+set(WHISPER_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}
+ CACHE PATH "Location of header files")
+set(WHISPER_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}
+ CACHE PATH "Location of library files")
+set(WHISPER_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}
+ CACHE PATH "Location of binary files")
+
install(TARGETS ${TARGET}
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib/static
- RUNTIME DESTINATION bin
- RESOURCE DESTINATION bin
- PUBLIC_HEADER DESTINATION include
+ LIBRARY DESTINATION "${WHISPER_LIB_INSTALL_DIR}"
+ ARCHIVE DESTINATION "${WHISPER_LIB_INSTALL_DIR}/static"
+ RUNTIME DESTINATION "${WHISPER_BIN_INSTALL_DIR}"
+ RESOURCE DESTINATION "${WHISPER_BIN_INSTALL_DIR}"
+ PUBLIC_HEADER DESTINATION "${WHISPER_INCLUDE_INSTALL_DIR}"
)
#
diff --git a/cmake/DefaultTargetOptions.cmake b/cmake/DefaultTargetOptions.cmake
index b4e93e3..277b99e 100644
--- a/cmake/DefaultTargetOptions.cmake
+++ b/cmake/DefaultTargetOptions.cmake
@@ -12,6 +12,6 @@ target_compile_features(${TARGET}
set_target_properties(${TARGET}
PROPERTIES
EXPORT_COMPILE_COMMANDS ON
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
- INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
+ RUNTIME_OUTPUT_DIRECTORY "${WHISPER_BIN_INSTALL_DIR}"
+ INSTALL_RPATH "${WHISPER_LIB_INSTALL_DIR}"
)
--
2.43.0