From 259946e0f8d6165af51fd9b940c1fdc7ea5010b7 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 13 Dec 2022 18:21:30 +0800 Subject: [PATCH] fix: add cmake file --- examples/c/CMakeLists.txt | 95 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 examples/c/CMakeLists.txt diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt new file mode 100644 index 0000000000..5f798f88a5 --- /dev/null +++ b/examples/c/CMakeLists.txt @@ -0,0 +1,95 @@ +PROJECT(TDengine) + +IF (TD_LINUX) + INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) + AUX_SOURCE_DIRECTORY(. SRC) + + add_executable(tmq "") + add_executable(stream_demo "") + add_executable(schemaless "") + add_executable(prepare "") + add_executable(demo "") + add_executable(asyncdemo "") + + target_sources(tmq + PRIVATE + "tmq.c" + ) + + target_sources(stream_demo + PRIVATE + "stream_demo.c" + ) + + target_sources(schemaless + PRIVATE + "schemaless.c" + ) + + target_sources(prepare + PRIVATE + "prepare.c" + ) + + target_sources(demo + PRIVATE + "demo.c" + ) + + target_sources(asyncdemo + PRIVATE + "asyncdemo.c" + ) + + target_link_libraries(tmq + taos_static + ) + + target_link_libraries(stream_demo + taos_static + ) + + target_link_libraries(schemaless + taos_static + ) + + target_link_libraries(prepare + taos_static + ) + + target_link_libraries(demo + taos_static + ) + + target_link_libraries(asyncdemo + taos_static + ) + + target_include_directories(tmq + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(stream_demo + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(schemaless + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(api_reqid + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + + SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) + SET_TARGET_PROPERTIES(stream_demo PROPERTIES OUTPUT_NAME stream_demo) + SET_TARGET_PROPERTIES(schemaless PROPERTIES OUTPUT_NAME schemaless) + SET_TARGET_PROPERTIES(prepare PROPERTIES OUTPUT_NAME prepare) + SET_TARGET_PROPERTIES(demo PROPERTIES OUTPUT_NAME demo) + SET_TARGET_PROPERTIES(asyncdemo PROPERTIES OUTPUT_NAME asyncdemo) +ENDIF () +IF (TD_DARWIN) + INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) + AUX_SOURCE_DIRECTORY(. SRC) +ENDIF () -- GitLab