Skip to content

Commit ce64880

Browse files
committed
Export mtmd target
1 parent ab5cdba commit ce64880

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ if (LLAMA_BUILD_COMMON)
241241

242242
endif()
243243

244+
if (LLAMA_BUILD_TOOLS)
245+
246+
install(
247+
TARGETS mtmd
248+
EXPORT llama-targets
249+
PUBLIC_HEADER
250+
DESTINATION ${LLAMA_INCLUDE_INSTALL_DIR}/mtmd)
251+
252+
endif()
253+
244254
install(
245255
EXPORT llama-targets
246256
FILE llama-targets.cmake

tools/mtmd/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ add_library(mtmd
1515

1616
target_link_libraries (mtmd PUBLIC ggml llama)
1717
target_link_libraries (mtmd PRIVATE Threads::Threads)
18-
target_include_directories(mtmd PUBLIC .)
18+
target_include_directories(
19+
mtmd
20+
PUBLIC
21+
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
22+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
23+
)
1924
target_include_directories(mtmd PRIVATE ../..)
2025
target_include_directories(mtmd PRIVATE ../../vendor)
2126
target_compile_features (mtmd PRIVATE cxx_std_17)
@@ -35,8 +40,6 @@ set_target_properties(mtmd
3540
PROPERTIES
3641
PUBLIC_HEADER "${MTMD_PUBLIC_HEADERS}")
3742

38-
install(TARGETS mtmd LIBRARY PUBLIC_HEADER)
39-
4043
if (NOT MSVC)
4144
# for stb_image.h and miniaudio.h
4245
target_compile_options(mtmd PRIVATE -Wno-cast-qual)

0 commit comments

Comments
 (0)