CMakeLists.txt 518 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
set(TARGET TestExample_test)

file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false *.h *.cpp)

set(SOURCES ${TEST_SOURCES})

add_executable(${TARGET} ${TEST_SOURCES})

add_test(NAME ${TARGET} COMMAND ${TARGET})

set(GTEST_ROOT $ENV{PREPARE_ENV_DIR}/googleTest )
find_package(GTest REQUIRED)

target_include_directories (${TARGET} PRIVATE ${GTEST_INCLUDE_DIR})
target_include_directories (${TARGET} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../tst_src)

target_link_libraries(${TARGET}  TestSource_lib ${GTEST_BOTH_LIBRARIES})