From a789dc2f1393bbbd1c22bcc1be66880b07e0d5bb Mon Sep 17 00:00:00 2001 From: zhanghan-mq <100839582+zhanghan-mq@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:55:02 +0800 Subject: [PATCH] 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 Signed-off-by: zhang.han Co-authored-by: zhang.han --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8a11a3..2619071 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,9 +145,11 @@ endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) -enable_testing() 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 ${CMAKE_CURRENT_SOURCE_DIR}/etcd/KeepAlive.hpp