From 11d473866c6d6ac111f5aef402f03929b49c5d3b Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 26 Feb 2025 14:45:07 +0100 Subject: [PATCH] Install some example programs in user PATH. This allow the key programs whisper-bench, whisper-quantize, whisper-server and whisper-talk-llama to be available for users in addition to the shared library. The name of binary quantize is renamed to whisper-quantize, to avoid potential name conflicts. --- examples/bench/CMakeLists.txt | 2 ++ examples/cli/CMakeLists.txt | 2 +- examples/quantize/CMakeLists.txt | 4 +++- examples/server/CMakeLists.txt | 2 ++ examples/talk-llama/CMakeLists.txt | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/bench/CMakeLists.txt b/examples/bench/CMakeLists.txt index f255f2dc527..2698b8b0ad8 100644 --- a/examples/bench/CMakeLists.txt +++ b/examples/bench/CMakeLists.txt @@ -1,6 +1,8 @@ set(TARGET whisper-bench) add_executable(${TARGET} bench.cpp) +install(TARGETS ${TARGET} RUNTIME DESTINATION bin) + include(DefaultTargetOptions) target_link_libraries(${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/cli/CMakeLists.txt b/examples/cli/CMakeLists.txt index 3a73776c5cd..7b6a187e95e 100644 --- a/examples/cli/CMakeLists.txt +++ b/examples/cli/CMakeLists.txt @@ -5,4 +5,4 @@ include(DefaultTargetOptions) target_link_libraries(${TARGET} PRIVATE common whisper ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) -install(TARGETS ${TARGET} RUNTIME) +install(TARGETS ${TARGET} RUNTIME DESTINATION bin) diff --git a/examples/quantize/CMakeLists.txt b/examples/quantize/CMakeLists.txt index 8d2d2e4d487..f044b682c8f 100644 --- a/examples/quantize/CMakeLists.txt +++ b/examples/quantize/CMakeLists.txt @@ -1,6 +1,8 @@ -set(TARGET quantize) +set(TARGET whisper-quantize) add_executable(${TARGET} quantize.cpp) +install(TARGETS ${TARGET} RUNTIME DESTINATION bin) + include(DefaultTargetOptions) target_link_libraries(${TARGET} PRIVATE common whisper ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index 4667c307e79..a9e9045040a 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -1,6 +1,8 @@ set(TARGET whisper-server) add_executable(${TARGET} server.cpp httplib.h) +install(TARGETS ${TARGET} RUNTIME DESTINATION bin) + include(DefaultTargetOptions) target_link_libraries(${TARGET} PRIVATE common json_cpp whisper ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt index c15c6b5ad39..5ec54b7c210 100644 --- a/examples/talk-llama/CMakeLists.txt +++ b/examples/talk-llama/CMakeLists.txt @@ -25,6 +25,8 @@ if (WHISPER_SDL2) unicode-data.cpp) target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS}) + install(TARGETS ${TARGET} RUNTIME DESTINATION bin) + if (WHISPER_CLBLAST) set(CLBLAST_LIBNAME clblast) endif ()