From f0f6b6a9752910fbd6cb506c5ae5ffe0761744e7 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 12 Jul 2019 01:57:11 +0000 Subject: [PATCH] add lower version cmake support --- CMakeLists.txt | 6 +++--- README.md | 2 +- deps/CMakeLists.txt | 2 +- deps/zlib-1.2.11/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- src/client/CMakeLists.txt | 2 +- src/connector/jdbc/CMakeLists.txt | 2 +- src/kit/shell/CMakeLists.txt | 2 +- src/kit/taosBenchmark/CMakeLists.txt | 2 +- src/kit/taosdump/CMakeLists.txt | 2 +- src/modules/http/CMakeLists.txt | 2 +- src/modules/monitor/CMakeLists.txt | 2 +- src/rpc/CMakeLists.txt | 2 +- src/sdb/CMakeLists.txt | 2 +- src/system/CMakeLists.txt | 6 ++++-- src/util/CMakeLists.txt | 2 +- 16 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c21399ddea..bc3314e8ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) SET(CMAKE_C_STANDARD 11) @@ -20,7 +20,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR UNIX) ENDIF () #set debug & release related options -SET(COMMON_FLAGS "-Wall -fPIC -malign-double -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") +SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(COMMON_CXX_FLAGS "${COMMON_FLAGS} -std=c++11") SET(DEBUG_FLAGS "-O0 -DDEBUG") @@ -43,7 +43,7 @@ ENDIF () #set output directory SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/lib) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/bin) -SET(TESTS_OUTPUT_DIR ${PROJECT_BINARY_DIR}/build/test) +SET(TESTS_OUTPUT_DIR ${PROJECT_BINARY_DIR}/test) MESSAGE(STATUS "Project binary output path: " ${PROJECT_BINARY_DIR}) MESSAGE(STATUS "Executable files output path: " ${EXECUTABLE_OUTPUT_PATH}) diff --git a/README.md b/README.md index 42e3d0710f..dc216ea9a7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Refer to [TDengine Documentation](https://www.taosdata.com/en/documentation/) # Building At the moment, TDengine only supports building and running on Linux systems. You can choose to [install from packages](https://www.taosdata.com/en/getting-started/#Install-from-Package) or from the source code. This quick guide is for installation from the source only. -To build TDengine, use [CMake](https://cmake.org/) 3.5 or higher versions in the project directory: +To build TDengine, use [CMake](https://cmake.org/) 2.8 or higher versions in the project directory: ```cmd mkdir build && cd build diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 235b444a98..bbd045000c 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/deps/zlib-1.2.11/CMakeLists.txt b/deps/zlib-1.2.11/CMakeLists.txt index 704a242045..5a0f37dd6b 100644 --- a/deps/zlib-1.2.11/CMakeLists.txt +++ b/deps/zlib-1.2.11/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3ed07b45ea..7f12970bce 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 6de31a4ff5..fa85256460 100755 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/connector/jdbc/CMakeLists.txt b/src/connector/jdbc/CMakeLists.txt index e795840503..69746c5b98 100644 --- a/src/connector/jdbc/CMakeLists.txt +++ b/src/connector/jdbc/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/kit/shell/CMakeLists.txt b/src/kit/shell/CMakeLists.txt index 7e0a5ca2e3..73714fac99 100644 --- a/src/kit/shell/CMakeLists.txt +++ b/src/kit/shell/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/kit/taosBenchmark/CMakeLists.txt b/src/kit/taosBenchmark/CMakeLists.txt index 4b6cf8c64b..196dc1f314 100644 --- a/src/kit/taosBenchmark/CMakeLists.txt +++ b/src/kit/taosBenchmark/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/kit/taosdump/CMakeLists.txt b/src/kit/taosdump/CMakeLists.txt index 1a65fd0051..8882ae8052 100644 --- a/src/kit/taosdump/CMakeLists.txt +++ b/src/kit/taosdump/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/modules/http/CMakeLists.txt b/src/modules/http/CMakeLists.txt index b21bd66bfc..58d2805e2f 100755 --- a/src/modules/http/CMakeLists.txt +++ b/src/modules/http/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/modules/monitor/CMakeLists.txt b/src/modules/monitor/CMakeLists.txt index ef6657ec95..35d28a9fac 100755 --- a/src/modules/monitor/CMakeLists.txt +++ b/src/modules/monitor/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index bfcdced71d..af7b2af6cf 100755 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/sdb/CMakeLists.txt b/src/sdb/CMakeLists.txt index 26c75bb18e..5b9d997720 100755 --- a/src/sdb/CMakeLists.txt +++ b/src/sdb/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index 6a7e431978..00dfd306ca 100755 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) @@ -11,7 +11,9 @@ TARGET_LINK_LIBRARIES(taosd taos_static trpc tutil sdb monitor pthread http z) SET(PREPARE_ENV_CMD "prepare_env_cmd") SET(PREPARE_ENV_TARGET "prepare_env_target") ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD} - POST_BUILD + POST_BUILD + COMMAND echo "make test directory" + DEPENDS taosd COMMAND ${CMAKE_COMMAND} -E make_directory ${TESTS_OUTPUT_DIR}/cfg/ COMMAND ${CMAKE_COMMAND} -E make_directory ${TESTS_OUTPUT_DIR}/log/ COMMAND ${CMAKE_COMMAND} -E make_directory ${TESTS_OUTPUT_DIR}/data/ diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index a19060ee52..dfcca250a8 100755 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -- GitLab