You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
673 B
CMake
30 lines
673 B
CMake
set(TEST_PROJECT_NAME ${CMAKE_PROJECT_NAME}_test)
|
|
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
googletest
|
|
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
GIT_TAG v1.13.0
|
|
)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
|
|
add_executable(${TEST_PROJECT_NAME}
|
|
test_tests.cpp
|
|
)
|
|
|
|
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
|
|
|
|
target_include_directories(${TEST_PROJECT_NAME}
|
|
SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/tests"
|
|
PRIVATE "${PROJECT_SOURCE_DIR}/include"
|
|
)
|
|
|
|
target_link_libraries(${TEST_PROJECT_NAME} gtest_main cblib)
|
|
|
|
|
|
add_test(NAME Test.tests COMMAND ${TEST_PROJECT_NAME})
|
|
|