build: as submodule, cancel `add_test()` (#160)

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>

Signed-off-by: zhang.han <dalezh@163.com>
Co-authored-by: zhang.han <zhang.han@xsky.com>
This commit is contained in:
zhanghan-mq 2022-09-06 09:55:02 +08:00 committed by GitHub
parent 69a1bf3b30
commit a789dc2f13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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