blob: 5860a37e5d69da67d6dc876140e3cfa8942f6c62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
include(CTest)
set(INC_DIR "${PROJECT_SOURCE_DIR}/include")
set(GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(FBS_DIR "${PROJECT_SOURCE_DIR}/test/monster_test")
include_directories("${GEN_DIR}" "${INC_DIR}")
add_custom_target(gen_monster_test ALL)
add_custom_command (
TARGET gen_monster_test
COMMAND ${CMAKE_COMMAND} -E make_directory "${GEN_DIR}"
COMMAND flatcc_cli -a -o "${GEN_DIR}" "${FBS_DIR}/monster_test.fbs"
DEPENDS flatcc_cli "${FBS_DIR}/monster_test.fbs" "${FBS_DIR}/include_test1.fbs" "${FBS_DIR}/include_test2.fbs"
)
add_executable(monster_test monster_test.c)
add_dependencies(monster_test gen_monster_test)
target_link_libraries(monster_test flatccrt)
add_test(monster_test monster_test${CMAKE_EXECUTABLE_SUFFIX})
|