cmake : install targets (#2256)

fix #2252
This commit is contained in:
wzy 2023-07-19 15:01:11 +08:00 committed by GitHub
parent d01bccde9f
commit b1f4290953
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 42 additions and 0 deletions

View file

@ -1,6 +1,7 @@
function(llama_add_test source)
get_filename_component(TEST_TARGET ${source} NAME_WE)
add_executable(${TEST_TARGET} ${source})
install(TARGETS ${TEST_TARGET} RUNTIME)
target_link_libraries(${TEST_TARGET} PRIVATE llama)
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}> ${ARGN})
endfunction()