CMakeLists.txt 1.1 KB
Newer Older
H
Haojun Liao 已提交
1 2 3

MESSAGE(STATUS "build planner unit test")

wafwerar's avatar
wafwerar 已提交
4 5 6 7
IF(NOT TD_DARWIN)
    # GoogleTest requires at least C++11
    SET(CMAKE_CXX_STANDARD 11)
    AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
H
Haojun Liao 已提交
8

wafwerar's avatar
wafwerar 已提交
9
    ADD_EXECUTABLE(plannerTest
10 11 12
        ${SOURCE_LIST}
        "${SOURCE_LIST}/../../../parser/test/mockCatalog.cpp"
        "${SOURCE_LIST}/../../../parser/test/mockCatalogService.cpp"
wafwerar's avatar
wafwerar 已提交
13
    )
14

wafwerar's avatar
wafwerar 已提交
15 16 17 18
    TARGET_LINK_LIBRARIES(
            plannerTest
            PUBLIC os util common nodes planner parser catalog transport gtest function qcom
    )
H
Haojun Liao 已提交
19

wafwerar's avatar
wafwerar 已提交
20 21 22 23 24 25
    TARGET_INCLUDE_DIRECTORIES(
            plannerTest
            PUBLIC "${TD_SOURCE_DIR}/include/libs/planner/"
            PRIVATE "${TD_SOURCE_DIR}/source/libs/planner/inc"
            PRIVATE "${TD_SOURCE_DIR}/source/libs/parser/test"
    )
wafwerar's avatar
wafwerar 已提交
26 27


wafwerar's avatar
wafwerar 已提交
28 29 30 31 32 33 34
    if(${BUILD_WINGETOPT})
        target_include_directories(
            plannerTest
            PUBLIC "${TD_SOURCE_DIR}/contrib/wingetopt/src"
        )
        target_link_libraries(plannerTest PUBLIC wingetopt)
    endif()
35

wafwerar's avatar
wafwerar 已提交
36 37 38 39 40
    add_test(
        NAME plannerTest
        COMMAND plannerTest
    )
ENDIF ()