Only download gtest if library can't be found
Summary: This turned up easier than expected. Just didn't have a test environment for this yesterday.
@@ -47,6 +47,8 @@ if (NOT ANDROID_ABI)
enable_testing()
add_subdirectory(test/jni)
+ find_library(GTEST_LIB gtest)
+ if(NOT GTEST_LIB)
# Download and unpack googletest at configure time
configure_file(googletest-CMakeLists.txt.in googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
@@ -67,7 +69,7 @@ if (NOT ANDROID_ABI)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
${CMAKE_CURRENT_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
-
+ endif()
endif()
if (ANDROID_ABI)
