From 7d58761e1dbc00bdc5c88639e323674f74cbfbc8 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 1 Jun 2022 17:04:45 +0800 Subject: [PATCH] chore: merge two example directories to be one (#13358) [TD16198] --- example/CMakeLists.txt | 49 -------------------------- examples/c/CMakeLists.txt | 50 +++++++++++++++++++++++++++ {example/src => examples/c}/demoapi.c | 0 {example/src => examples/c}/tmq.c | 0 {example/src => examples/c}/tstream.c | 0 5 files changed, 50 insertions(+), 49 deletions(-) delete mode 100644 example/CMakeLists.txt rename {example/src => examples/c}/demoapi.c (100%) rename {example/src => examples/c}/tmq.c (100%) rename {example/src => examples/c}/tstream.c (100%) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt deleted file mode 100644 index 365b1b7172..0000000000 --- a/example/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -add_executable(tmq "") -add_executable(tstream "") -add_executable(demoapi "") - -target_sources(tmq - PRIVATE - "src/tmq.c" -) - -target_sources(tstream - PRIVATE - "src/tstream.c" -) - -target_sources(demoapi - PRIVATE - "src/demoapi.c" -) - -target_link_libraries(tmq - taos_static -) - -target_link_libraries(tstream - taos_static -) - -target_link_libraries(demoapi - taos_static -) - -target_include_directories(tmq - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" -) - -target_include_directories(tstream - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" -) - -target_include_directories(demoapi - PUBLIC "${TD_SOURCE_DIR}/include/client" - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" -) - -SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) -SET_TARGET_PROPERTIES(tstream PROPERTIES OUTPUT_NAME tstream) -SET_TARGET_PROPERTIES(demoapi PROPERTIES OUTPUT_NAME demoapi) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 8bc86abbb1..eff492945e 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -11,6 +11,56 @@ IF (TD_LINUX) #TARGET_LINK_LIBRARIES(subscribe taos_static trpc tutil pthread ) #ADD_EXECUTABLE(epoll epoll.c) #TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) + + add_executable(tmq "") + add_executable(tstream "") + add_executable(demoapi "") + + target_sources(tmq + PRIVATE + "tmq.c" + ) + + target_sources(tstream + PRIVATE + "tstream.c" + ) + + target_sources(demoapi + PRIVATE + "demoapi.c" + ) + + target_link_libraries(tmq + taos_static + ) + + target_link_libraries(tstream + taos_static + ) + + target_link_libraries(demoapi + taos_static + ) + + target_include_directories(tmq + PUBLIC "${TD_SOURCE_DIR}/include/os" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(tstream + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(demoapi + PUBLIC "${TD_SOURCE_DIR}/include/client" + PUBLIC "${TD_SOURCE_DIR}/include/os" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) + SET_TARGET_PROPERTIES(tstream PROPERTIES OUTPUT_NAME tstream) + SET_TARGET_PROPERTIES(demoapi PROPERTIES OUTPUT_NAME demoapi) ENDIF () IF (TD_DARWIN) INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) diff --git a/example/src/demoapi.c b/examples/c/demoapi.c similarity index 100% rename from example/src/demoapi.c rename to examples/c/demoapi.c diff --git a/example/src/tmq.c b/examples/c/tmq.c similarity index 100% rename from example/src/tmq.c rename to examples/c/tmq.c diff --git a/example/src/tstream.c b/examples/c/tstream.c similarity index 100% rename from example/src/tstream.c rename to examples/c/tstream.c -- GitLab