build: as submodule, cancel `add_test()`

if we use `etcd-cpp-apiv3` as submodule, we don't need to test `etcd-cpp-apiv3`.
in `CMakeLists.txt`
```
enable_testing()
add_subdirectory(src)
add_subdirectory(tst)
```
this code force to set `add_test()` and maybe make the project failed to `unit tests`.

Signed-off-by: zhang.han <dalezh@163.com>
This commit is contained in:
zhang.han 2022-09-05 20:50:03 +08:00
parent 69a1bf3b30
commit e7871a681a
1 changed files with 4 additions and 2 deletions

View File

@ -145,9 +145,11 @@ endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
enable_testing()
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(tst) if(BUILD_ETCD_TESTS)
enable_testing()
add_subdirectory(tst)
endif()
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/etcd/Client.hpp install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/etcd/Client.hpp
${CMAKE_CURRENT_SOURCE_DIR}/etcd/KeepAlive.hpp ${CMAKE_CURRENT_SOURCE_DIR}/etcd/KeepAlive.hpp