CMakeLists.txt 1.4 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20)
H
hjxilinx 已提交
2 3 4
PROJECT(TDengine)

FIND_PATH(HEADER_GTEST_INCLUDE_DIR gtest.h /usr/include/gtest /usr/local/include/gtest)
5 6
FIND_LIBRARY(LIB_GTEST_STATIC_DIR libgtest.a /usr/lib/ /usr/local/lib /usr/lib64)
FIND_LIBRARY(LIB_GTEST_SHARED_DIR libgtest.so /usr/lib/ /usr/local/lib /usr/lib64)
H
hjxilinx 已提交
7

8
IF (HEADER_GTEST_INCLUDE_DIR AND (LIB_GTEST_STATIC_DIR OR LIB_GTEST_SHARED_DIR))
H
hjxilinx 已提交
9 10
    MESSAGE(STATUS "gTest library found, build unit test")

11 12 13 14 15 16
    # GoogleTest requires at least C++11
    SET(CMAKE_CXX_STANDARD 11)

    INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
    LINK_DIRECTORIES(/usr/lib /usr/local/lib)

H
hjxilinx 已提交
17 18 19 20
    INCLUDE_DIRECTORIES(${HEADER_GTEST_INCLUDE_DIR})
    AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)

    ADD_EXECUTABLE(queryTest ${SOURCE_LIST})
21
    TARGET_LINK_LIBRARIES(queryTest taos cJson query gtest pthread)
S
Shuduo Sang 已提交
22
ENDIF()
sangshuduo's avatar
sangshuduo 已提交
23

W
wpan 已提交
24 25 26
SET_SOURCE_FILES_PROPERTIES(./astTest.cpp PROPERTIES COMPILE_FLAGS -w)
SET_SOURCE_FILES_PROPERTIES(./histogramTest.cpp PROPERTIES COMPILE_FLAGS -w)
SET_SOURCE_FILES_PROPERTIES(./percentileTest.cpp PROPERTIES COMPILE_FLAGS -w)
W
add ut  
wpan 已提交
27
SET_SOURCE_FILES_PROPERTIES(./apercentileTest.cpp PROPERTIES COMPILE_FLAGS -w)
W
wpan 已提交
28 29 30
SET_SOURCE_FILES_PROPERTIES(./resultBufferTest.cpp PROPERTIES COMPILE_FLAGS -w)
SET_SOURCE_FILES_PROPERTIES(./tsBufTest.cpp PROPERTIES COMPILE_FLAGS -w)
SET_SOURCE_FILES_PROPERTIES(./unitTest.cpp PROPERTIES COMPILE_FLAGS -w)
W
wpan 已提交
31
SET_SOURCE_FILES_PROPERTIES(./rangeMergeTest.cpp PROPERTIES COMPILE_FLAGS -w)