From 46f33fcbd23fdc6237fa891a193cd74469a7a858 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 23 Sep 2021 09:37:01 +0800 Subject: [PATCH 1/6] refact --- CMakeLists.txt | 4 ++++ source/client/CMakeLists.txt | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9324daef20..06b50d4f95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,10 @@ execute_process(COMMAND "${CMAKE_COMMAND}" --build . # deps add_subdirectory(deps) +# api +aux_source_directory(include/client API_SRC) +add_library(api INTERFACE ${API_SRC}) + # src add_subdirectory(source) diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index 26623d3cdc..2313c1633c 100644 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -2,6 +2,9 @@ aux_source_directory(src CLIENT_SRC) add_library(taos ${CLIENT_SRC}) target_include_directories( taos - PUBLIC "${CMAKE_SOURCE_DIR}/include/client" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) +target_link_libraries( + taos + INTERFACE api ) \ No newline at end of file From 22e1dc5ce9e8342de6f1c17e8daf2783c57343de Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 23 Sep 2021 09:48:51 +0800 Subject: [PATCH 2/6] refact --- CMakeLists.txt | 2 +- cmake/gtest_CMakeLists.txt.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06b50d4f95..e5fbc69d1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set(DEPS_TMP_FILE "${CMAKE_BINARY_DIR}/deps_tmp_CMakeLists.txt.in") configure_file("${CMAKE_SUPPORT_DIR}/deps_CMakeLists.txt.in" ${DEPS_TMP_FILE}) ## googletest -option(BUILD_TEST "If build unit tests using googletest" OFF) +option(BUILD_TEST "If build unit tests using googletest" ON) if(${BUILD_TEST}) cat("${CMAKE_SUPPORT_DIR}/gtest_CMakeLists.txt.in" ${DEPS_TMP_FILE}) diff --git a/cmake/gtest_CMakeLists.txt.in b/cmake/gtest_CMakeLists.txt.in index ba4eaef8fb..ed210d305c 100644 --- a/cmake/gtest_CMakeLists.txt.in +++ b/cmake/gtest_CMakeLists.txt.in @@ -1,8 +1,8 @@ # googletest ExternalProject_Add(googletest - GIT_REPOSITORY git@github.com:google/googletest.git - GIT_TAG master + GIT_REPOSITORY git@github.com:taosdata/googletest.git + GIT_TAG release-1.11.0 SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/googletest" BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" CONFIGURE_COMMAND "" From 0406220da52ec80bcfda36214571ac51181aaefa Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 23 Sep 2021 10:07:34 +0800 Subject: [PATCH 3/6] refact --- CMakeLists.txt | 3 +++ cmake/cjson_CMakeLists.txt.in | 12 ++++++++++++ deps/CMakeLists.txt | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 cmake/cjson_CMakeLists.txt.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e5fbc69d1a..ca6f7903a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ if(${BUILD_TEST}) cat("${CMAKE_SUPPORT_DIR}/gtest_CMakeLists.txt.in" ${DEPS_TMP_FILE}) endif(${BUILD_TEST}) +## cJson +cat("${CMAKE_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${DEPS_TMP_FILE}) + ## download dependencies configure_file(${DEPS_TMP_FILE} "${CMAKE_SOURCE_DIR}/deps/deps-download/CMakeLists.txt") execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . diff --git a/cmake/cjson_CMakeLists.txt.in b/cmake/cjson_CMakeLists.txt.in new file mode 100644 index 0000000000..6c67e36d39 --- /dev/null +++ b/cmake/cjson_CMakeLists.txt.in @@ -0,0 +1,12 @@ + +# cjson +ExternalProject_Add(cjson + GIT_REPOSITORY git@github.com:taosdata/cJSON.git + GIT_TAG v1.7.15 + SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/cJson" + BINARY_DIR "${CMAKE_BINARY_DIR}/cJson-build" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) \ No newline at end of file diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 2bb75b07c9..bb3a1c2bbc 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,3 +1,5 @@ if(${BUILD_TEST}) add_subdirectory(googletest) endif(${BUILD_TEST}) + +add_subdirectory(cJson) From 7db57d1d50d66f3cb36c0e459284d1acb286202d Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 23 Sep 2021 10:43:39 +0800 Subject: [PATCH 4/6] refact --- CMakeLists.txt | 3 +++ cmake/lz4_CMakeLists.txt.in | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 cmake/lz4_CMakeLists.txt.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ca6f7903a3..3cabcc5644 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ endif(${BUILD_TEST}) ## cJson cat("${CMAKE_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${DEPS_TMP_FILE}) +## lz4 +cat("${CMAKE_SUPPORT_DIR}/lz4_CMakeLists.txt.in" ${DEPS_TMP_FILE}) + ## download dependencies configure_file(${DEPS_TMP_FILE} "${CMAKE_SOURCE_DIR}/deps/deps-download/CMakeLists.txt") execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . diff --git a/cmake/lz4_CMakeLists.txt.in b/cmake/lz4_CMakeLists.txt.in new file mode 100644 index 0000000000..dc3b17ea21 --- /dev/null +++ b/cmake/lz4_CMakeLists.txt.in @@ -0,0 +1,12 @@ + +# lz4 +ExternalProject_Add(lz4 + GIT_REPOSITORY git@github.com:lz4/lz4.git + GIT_TAG v1.9.3 + SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/lz4" + BINARY_DIR "${CMAKE_BINARY_DIR}/lz4-build" + CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/build/cmake + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) \ No newline at end of file From 339d1c18545e63c77e3cac2fe56e5ad297ddf3a9 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 23 Sep 2021 10:59:24 +0800 Subject: [PATCH 5/6] refact --- CMakeLists.txt | 8 ++++---- cmake/lz4_CMakeLists.txt.in | 2 +- deps/CMakeLists.txt | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cabcc5644..dbd0531b3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,18 +20,18 @@ set(DEPS_TMP_FILE "${CMAKE_BINARY_DIR}/deps_tmp_CMakeLists.txt.in") configure_file("${CMAKE_SUPPORT_DIR}/deps_CMakeLists.txt.in" ${DEPS_TMP_FILE}) ## googletest -option(BUILD_TEST "If build unit tests using googletest" ON) +option(BUILD_TEST "If build unit tests using googletest" OFF) if(${BUILD_TEST}) cat("${CMAKE_SUPPORT_DIR}/gtest_CMakeLists.txt.in" ${DEPS_TMP_FILE}) endif(${BUILD_TEST}) -## cJson -cat("${CMAKE_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${DEPS_TMP_FILE}) - ## lz4 cat("${CMAKE_SUPPORT_DIR}/lz4_CMakeLists.txt.in" ${DEPS_TMP_FILE}) +## cJson +cat("${CMAKE_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${DEPS_TMP_FILE}) + ## download dependencies configure_file(${DEPS_TMP_FILE} "${CMAKE_SOURCE_DIR}/deps/deps-download/CMakeLists.txt") execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . diff --git a/cmake/lz4_CMakeLists.txt.in b/cmake/lz4_CMakeLists.txt.in index dc3b17ea21..2f3cdc0d89 100644 --- a/cmake/lz4_CMakeLists.txt.in +++ b/cmake/lz4_CMakeLists.txt.in @@ -5,7 +5,7 @@ ExternalProject_Add(lz4 GIT_TAG v1.9.3 SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/lz4" BINARY_DIR "${CMAKE_BINARY_DIR}/lz4-build" - CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/build/cmake + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" TEST_COMMAND "" diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index bb3a1c2bbc..1d8eac00aa 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -3,3 +3,4 @@ if(${BUILD_TEST}) endif(${BUILD_TEST}) add_subdirectory(cJson) +add_subdirectory(lz4/build/cmake) From 8e76b4a6d9d1f4d244c750d5adc46a8d3cd02deb Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 23 Sep 2021 11:18:32 +0800 Subject: [PATCH 6/6] refact dependencies --- CMakeLists.txt | 2 +- cmake/cjson_CMakeLists.txt.in | 2 +- cmake/gtest_CMakeLists.txt.in | 2 +- cmake/lz4_CMakeLists.txt.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbd0531b3c..9533514ebc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set(DEPS_TMP_FILE "${CMAKE_BINARY_DIR}/deps_tmp_CMakeLists.txt.in") configure_file("${CMAKE_SUPPORT_DIR}/deps_CMakeLists.txt.in" ${DEPS_TMP_FILE}) ## googletest -option(BUILD_TEST "If build unit tests using googletest" OFF) +option(BUILD_TEST "If build unit tests using googletest" ON) if(${BUILD_TEST}) cat("${CMAKE_SUPPORT_DIR}/gtest_CMakeLists.txt.in" ${DEPS_TMP_FILE}) diff --git a/cmake/cjson_CMakeLists.txt.in b/cmake/cjson_CMakeLists.txt.in index 6c67e36d39..83f34ae794 100644 --- a/cmake/cjson_CMakeLists.txt.in +++ b/cmake/cjson_CMakeLists.txt.in @@ -1,7 +1,7 @@ # cjson ExternalProject_Add(cjson - GIT_REPOSITORY git@github.com:taosdata/cJSON.git + GIT_REPOSITORY git@github.com:taosdata-contrib/cJSON.git GIT_TAG v1.7.15 SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/cJson" BINARY_DIR "${CMAKE_BINARY_DIR}/cJson-build" diff --git a/cmake/gtest_CMakeLists.txt.in b/cmake/gtest_CMakeLists.txt.in index ed210d305c..6de66e23de 100644 --- a/cmake/gtest_CMakeLists.txt.in +++ b/cmake/gtest_CMakeLists.txt.in @@ -1,7 +1,7 @@ # googletest ExternalProject_Add(googletest - GIT_REPOSITORY git@github.com:taosdata/googletest.git + GIT_REPOSITORY git@github.com:taosdata-contrib/googletest.git GIT_TAG release-1.11.0 SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/googletest" BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" diff --git a/cmake/lz4_CMakeLists.txt.in b/cmake/lz4_CMakeLists.txt.in index 2f3cdc0d89..56e5fbd258 100644 --- a/cmake/lz4_CMakeLists.txt.in +++ b/cmake/lz4_CMakeLists.txt.in @@ -1,7 +1,7 @@ # lz4 ExternalProject_Add(lz4 - GIT_REPOSITORY git@github.com:lz4/lz4.git + GIT_REPOSITORY git@github.com:taosdata-contrib/lz4.git GIT_TAG v1.9.3 SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/lz4" BINARY_DIR "${CMAKE_BINARY_DIR}/lz4-build"