62 lines
2.1 KiB
Diff
62 lines
2.1 KiB
Diff
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
|
|
|