build: add gtest as CPM package
This commit is contained in:
parent
3bf553f502
commit
e739acbed7
1 changed files with 8 additions and 5 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue