commit ce8705f49da5e5f59c2ddb3253ef88323a0cd9c4 Author: sophgo-forum-service <forum_service@sophgo.com> Date: Mon May 13 14:04:10 2024 +0800 [feat] cvimath opensource for cv18xx soc. - 9e8967
29 lines
766 B
CMake
29 lines
766 B
CMake
project(cvimath_sample)
|
|
|
|
# wrapper source
|
|
|
|
# include header
|
|
include_directories(
|
|
${CMAKE_SOURCE_DIR}/include
|
|
${TPU_SDK_ROOT}/include
|
|
${TPU_SDK_ROOT}/include/cvimath
|
|
)
|
|
|
|
# add libs
|
|
set( TPU_KERNEL_LIB "-L${TPU_SDK_ROOT}/lib -lcvikernel")
|
|
set( TEST_LIBS cvimath cviruntime)
|
|
|
|
file(GLOB CVI1835_SAMPLE ./*.cpp)
|
|
|
|
foreach(SAMPLE_SRC ${CVI1835_SAMPLE})
|
|
get_filename_component(SAMPLE_NAME ${SAMPLE_SRC} NAME_WE)
|
|
|
|
add_executable(${SAMPLE_NAME} ${SAMPLE_UTIL} ${SAMPLE_SRC})
|
|
target_link_libraries(${SAMPLE_NAME} ${TPU_KERNEL_LIB} ${TEST_LIBS})
|
|
set_target_properties(${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS "-Werror -Wall -Wextra")
|
|
install(TARGETS ${SAMPLE_NAME} DESTINATION bin)
|
|
|
|
add_test(${SAMPLE_NAME} ${SAMPLE_NAME} ctest_test)
|
|
|
|
endforeach()
|