summaryrefslogtreecommitdiff
path: root/compiler/vconone/CMakeLists.txt
blob: b8cb7933143477912ddb929d9e8f94419486e9d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if (NOT VCONONE_VERSION)
  set(VCONONE_VERSION 0x0000000000080001)
  # NOTE order is [build patch minor major]
  # if VCONONE_VERSION is set with -D option, it will be cached
  # you may have to remove cache file if you remove -D option
endif()

configure_file(version_cfg.h.in version_cfg.h @ONLY)

set(DRIVER "driver/driver.cpp")

file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE TESTS "src/*.test.cpp")
list(REMOVE_ITEM SOURCES ${TESTS})

add_library(vconone STATIC ${SOURCES})
target_include_directories(vconone PUBLIC include)
target_include_directories(vconone PUBLIC ${CMAKE_CURRENT_BINARY_DIR})

add_executable(one-version ${DRIVER})
target_link_libraries(one-version vconone)
install(TARGETS one-version DESTINATION bin)

if(NOT ENABLE_TEST)
  return()
endif(NOT ENABLE_TEST)

nnas_find_package(GTest REQUIRED)

GTest_AddTest(vconone_test ${TESTS})
target_link_libraries(vconone_test vconone)