CMakeLists.txt 981 字节
Newer Older
S
Shengliang Guan 已提交
1
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
H
hjxilinx 已提交
2 3 4 5 6 7 8 9 10 11
PROJECT(TDengine)

FIND_PATH(HEADER_GTEST_INCLUDE_DIR gtest.h /usr/include/gtest /usr/local/include/gtest)
FIND_LIBRARY(LIB_GTEST_STATIC_DIR libgtest.a /usr/lib/ /usr/local/lib)

IF (HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR)
    MESSAGE(STATUS "gTest library found, build unit test")

    INCLUDE_DIRECTORIES(${HEADER_GTEST_INCLUDE_DIR})
    AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
H
[NONE]  
Hui Li 已提交
12 13
    
    LIST(REMOVE_ITEM SOURCE_LIST ${CMAKE_CURRENT_SOURCE_DIR}/trefTest.c)
H
Haojun Liao 已提交
14
    ADD_EXECUTABLE(utilTest ${SOURCE_LIST})
S
TD-4088  
Shengliang Guan 已提交
15
    TARGET_LINK_LIBRARIES(utilTest tutil common os gtest pthread gcov)
H
[NONE]  
Hui Li 已提交
16 17 18 19 20

    LIST(APPEND BIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/trefTest.c)
    ADD_EXECUTABLE(trefTest ${BIN_SRC})
    TARGET_LINK_LIBRARIES(trefTest common tutil)

S
Shuduo Sang 已提交
21
ENDIF()
H
Haojun Liao 已提交
22

H
[NONE]  
Hui Li 已提交
23 24 25 26
#IF (TD_LINUX)
#    ADD_EXECUTABLE(trefTest ./trefTest.c)
#    TARGET_LINK_LIBRARIES(trefTest tutil common)
#ENDIF ()
H
Haojun Liao 已提交
27 28 29 30

INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)