aboutsummaryrefslogtreecommitdiff
path: root/flatcc/test/monster_test/CMakeLists.txt
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-16 02:03:33 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-07-16 02:03:33 +0200
commitb31e4bc16d1df62b50c6f77a77041f9e7b6c906d (patch)
tree024c74c13d918aa6bde302aab6836fa33607613c /flatcc/test/monster_test/CMakeLists.txt
parentba6815ef8fb8ae472412b5af2837a7caba2799c2 (diff)
parent5a40295c4cf0af5ea8da9ced04a4ce7d3621a080 (diff)
Merge commit '5a40295c4cf0af5ea8da9ced04a4ce7d3621a080' as 'flatcc'
Diffstat (limited to 'flatcc/test/monster_test/CMakeLists.txt')
-rw-r--r--flatcc/test/monster_test/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/flatcc/test/monster_test/CMakeLists.txt b/flatcc/test/monster_test/CMakeLists.txt
new file mode 100644
index 0000000..5860a37
--- /dev/null
+++ b/flatcc/test/monster_test/CMakeLists.txt
@@ -0,0 +1,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})