Skip install gtest when build with test

Signed-off-by: XuanYang-cn <xuan.yang@zilliz.com>
pull/4973/head^2
XuanYang-cn 2021-04-08 10:01:18 +08:00 committed by yefu.chen
parent 846fd8a154
commit 46d27e37d7
4 changed files with 14 additions and 2 deletions

2
.gitignore vendored
View File

@ -67,6 +67,8 @@ cwrapper_build
**/.lint
typescript
**/.pytest_cache/
.root
gtags.conf
# Delve generated file
**/__debug_bin

View File

@ -1,4 +1,3 @@
include(FetchContent)
FetchContent_Declare(google_benchmark
URL https://github.com/google/benchmark/archive/v1.5.2.tar.gz
URL_MD5 084b34aceaeac11a6607d35220ca2efa

View File

@ -29,7 +29,17 @@ FetchContent_Declare(
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH} )
FetchContent_MakeAvailable(googletest)
FetchContent_GetProperties( googletest )
if ( NOT googletest_POPULATED )
FetchContent_Populate( googletest )
# Adding the following targets:
# gtest, gtest_main, gmock, gmock_main
add_subdirectory( ${googletest_SOURCE_DIR}
${googletest_BINARY_DIR}
EXCLUDE_FROM_ALL )
endif()
# include(GoogleTest)
# ****************************************************************

View File

@ -55,3 +55,4 @@ target_link_libraries(all_tests
)
install (TARGETS all_tests DESTINATION unittest)
install (TARGETS index_builder_test DESTINATION unittest)