From b16c9fb6d225092a2e59baa5d40c50e1ddea75b6 Mon Sep 17 00:00:00 2001
From: Anonymous <>
Date: Tue, 27 Jan 2026 00:00:00 +0000
Subject: [PATCH 4/6] Fix bug of CMake scripts ignoring the destinations to install llama libs.

---
 CMakeLists.txt            | 2 +-
 tools/mtmd/CMakeLists.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d24fa080..3a4e5916 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -270,7 +270,7 @@ set_target_properties(llama
     PROPERTIES
         PUBLIC_HEADER "${LLAMA_PUBLIC_HEADERS}")
 
-install(TARGETS llama LIBRARY PUBLIC_HEADER)
+install(TARGETS llama LIBRARY DESTINATION "${LLAMA_LIB_INSTALL_DIR}" PUBLIC_HEADER DESTINATION "${LLAMA_INCLUDE_INSTALL_DIR}")
 
 configure_package_config_file(
         ${CMAKE_CURRENT_SOURCE_DIR}/cmake/llama-config.cmake.in
diff --git a/tools/mtmd/CMakeLists.txt b/tools/mtmd/CMakeLists.txt
index 751440af..9e8900fe 100644
--- a/tools/mtmd/CMakeLists.txt
+++ b/tools/mtmd/CMakeLists.txt
@@ -59,7 +59,7 @@ set_target_properties(mtmd
     PROPERTIES
     PUBLIC_HEADER "${MTMD_PUBLIC_HEADERS}")
 
-install(TARGETS mtmd LIBRARY PUBLIC_HEADER)
+install(TARGETS mtmd LIBRARY DESTINATION "${LLAMA_LIB_INSTALL_DIR}" PUBLIC_HEADER DESTINATION "${LLAMA_INCLUDE_INSTALL_DIR}")
 
 if (NOT MSVC)
     # for stb_image.h and miniaudio.h
-- 
2.51.0

