aa3a9421dcd98b665a3d8252a55ec9f05998830a
[platform/core/ml/nnfw.git] / tests / nnfw_api / CMakeLists.txt
1 if (NOT BUILD_RUNTIME_NNFW_API_TEST)
2   return()
3 endif(NOT BUILD_RUNTIME_NNFW_API_TEST)
4
5 if (NOT BUILD_ONERT)
6   message(STATUS "Skip build NNFW API test: no runtime build")
7   return()
8 endif(NOT BUILD_ONERT)
9
10 nnfw_find_package(GTest)
11
12 set(RUNTIME_NNFW_API_TEST nnfw_api_gtest)
13 file(GLOB_RECURSE RUNTIME_NNFW_API_TEST_SRC "src/*.cc" "src/*.cpp")
14
15 add_executable(${RUNTIME_NNFW_API_TEST} ${RUNTIME_NNFW_API_TEST_SRC})
16
17 nnfw_find_package(ARMCompute QUIET)
18 if(ARMCompute_FOUND)
19   target_compile_definitions(${RUNTIME_NNFW_API_TEST} PRIVATE TEST_ACL_BACKEND)
20 endif(ARMCompute_FOUND)
21
22 set(RUNTIME_NNFW_API_TEST_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/include
23                                   ${CMAKE_CURRENT_SOURCE_DIR}/src)
24 target_include_directories(${RUNTIME_NNFW_API_TEST} PRIVATE ${RUNTIME_NNFW_API_TEST_INCLUDE})
25
26 target_link_libraries(${RUNTIME_NNFW_API_TEST} nnfw-dev)
27 target_link_libraries(${RUNTIME_NNFW_API_TEST} gtest gmock)
28 target_link_libraries(${RUNTIME_NNFW_API_TEST} ${LIB_PTHREAD} dl)
29 target_link_libraries(${RUNTIME_NNFW_API_TEST} circle_schema)
30
31 install(TARGETS ${RUNTIME_NNFW_API_TEST} DESTINATION unittest_standalone)