diff options
author | Gil <mcg@google.com> | 2018-01-17 10:22:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 10:22:57 -0800 |
commit | c3664973a94a2c715b9c57583f5953483caf2cce (patch) | |
tree | a10a7def0ba8df627bfd0be7fa8f8cb90e0ad3f6 /Firestore/CMakeLists.txt | |
parent | cac2c3ff7aa7b94e3776bb1282765ca78be977ae (diff) |
Simplify integration with googletest (#672)
This makes it possible to build the Firestore subproject with CLion
because it no longer needs to be told where googletest is.
Diffstat (limited to 'Firestore/CMakeLists.txt')
-rw-r--r-- | Firestore/CMakeLists.txt | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Firestore/CMakeLists.txt b/Firestore/CMakeLists.txt index 553f59c..499e06c 100644 --- a/Firestore/CMakeLists.txt +++ b/Firestore/CMakeLists.txt @@ -28,7 +28,23 @@ set(FIREBASE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) list(INSERT CMAKE_MODULE_PATH 0 ${FIREBASE_SOURCE_DIR}/cmake) include(utils) -find_package(GTest REQUIRED) +# Include GoogleTest directly in the build. +set(gtest_dir ${FIREBASE_INSTALL_DIR}/external/googletest) +add_subdirectory( + ${gtest_dir}/src/googletest + ${gtest_dir}/src/googletest-build + EXCLUDE_FROM_ALL +) + +# Set up aliases with the same names as available via FindGTest. +add_library( + GTest::GTest ALIAS gtest +) + +add_library( + GTest::Main ALIAS gtest_main +) + find_package(LevelDB REQUIRED) find_package(GRPC REQUIRED) |