9055154014806da4c5bc9b87012f924f2f16f9e7
[platform/core/ml/nnfw.git] / compiler / vconone / CMakeLists.txt
1 if (NOT VCONONE_VERSION)
2   set(VCONONE_VERSION 0x00000000000b0001)
3   # NOTE order is [build patch minor major]
4   # if VCONONE_VERSION is set with -D option, it will be cached
5   # you may have to remove cache file if you remove -D option
6 endif()
7
8 configure_file(version_cfg.h.in version_cfg.h @ONLY)
9
10 set(DRIVER "driver/driver.cpp")
11
12 file(GLOB_RECURSE SOURCES "src/*.cpp")
13 file(GLOB_RECURSE TESTS "src/*.test.cpp")
14 list(REMOVE_ITEM SOURCES ${TESTS})
15
16 add_library(vconone STATIC ${SOURCES})
17 target_include_directories(vconone PUBLIC include)
18 target_include_directories(vconone PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
19
20 add_executable(one-version ${DRIVER})
21 target_link_libraries(one-version vconone)
22 install(TARGETS one-version DESTINATION bin)
23
24 if(NOT ENABLE_TEST)
25   return()
26 endif(NOT ENABLE_TEST)
27
28 nnas_find_package(GTest REQUIRED)
29
30 GTest_AddTest(vconone_test ${TESTS})
31 target_link_libraries(vconone_test vconone)