build: add gtest as CPM package

This commit is contained in:
Daniil Zhukov 2024-07-06 12:49:54 +02:00 committed by sha512sum
parent 3bf553f502
commit e739acbed7

View file

@ -134,7 +134,11 @@ install(FILES "${PROJECT_BINARY_DIR}/cserverConfig.cmake"
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/cserver DESTINATION include)
if(ENABLE_TESTS)
find_package(GTest REQUIRED)
CPMAddPackage(
NAME GTest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
enable_testing()
file(GLOB SOURCES tests/* tests/*/* tests/*/*/*)
add_executable(cserver_tests ${SOURCES})
@ -157,4 +161,3 @@ if(ENABLE_EXAMPLES)
endif()
endforeach()
endif()