aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/whisper-cpp/cmake-config.diff
blob: 4d88e08ee29e7bc424f44d7361e6cb838c9e0df3 (plain)
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
diff --git a/cmake/whisper-config.cmake.in b/cmake/whisper-config.cmake.in
index 6a3fa227..f4f4162a 100644
--- a/cmake/whisper-config.cmake.in
+++ b/cmake/whisper-config.cmake.in
@@ -12,8 +12,9 @@ set(GGML_ACCELERATE @GGML_ACCELERATE@)
 @PACKAGE_INIT@
 
 set_and_check(WHISPER_INCLUDE_DIR "@PACKAGE_WHISPER_INCLUDE_INSTALL_DIR@")
-set_and_check(WHISPER_LIB_DIR     "@PACKAGE_WHISPER_LIB_INSTALL_DIR@")
-set_and_check(WHISPER_BIN_DIR     "@PACKAGE_WHISPER_BIN_INSTALL_DIR@")
+# In vcpkg, the following would be subject to vcpkg build type.
+# set_and_check(WHISPER_LIB_DIR     "@PACKAGE_WHISPER_LIB_INSTALL_DIR@")
+# set_and_check(WHISPER_BIN_DIR     "@PACKAGE_WHISPER_BIN_INSTALL_DIR@")
 
 # Ensure transient dependencies satisfied
 
@@ -50,6 +51,12 @@ find_library(whisper_LIBRARY whisper
 set(_whisper_link_deps "Threads::Threads" "@WHISPER_EXTRA_LIBS@")
 set(_whisper_transient_defines "@WHISPER_TRANSIENT_DEFINES@")
 
+if(NOT TARGET whisper)
+if(NOT "@BUILD_SHARED_LIBS@")
+    include(CMakeFindDependencyMacro)
+    find_dependency(ggml)
+    list(APPEND _whisper_link_deps ggml::ggml)
+endif()
 add_library(whisper UNKNOWN IMPORTED)
 
 set_target_properties(whisper
@@ -61,5 +68,6 @@ set_target_properties(whisper
         IMPORTED_LOCATION "${whisper_LIBRARY}"
         INTERFACE_COMPILE_FEATURES cxx_std_11
         POSITION_INDEPENDENT_CODE ON )
+endif()
 
 check_required_components(whisper)