cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
cmake/find_gtest.cmake
19lines · modecode
8 years ago
| 1 | option (USE_INTERNAL_GTEST_LIBRARY "Set to FALSE to use system Google Test instead of bundled" ${NOT_UNBUNDLED}) |
| 2 | |
| 3 | if (USE_INTERNAL_GTEST_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest/CMakeLists.txt") |
| 4 | message (WARNING "submodule contrib/googletest is missing. to fix try run: \n git submodule update --init --recursive") |
| 5 | set (USE_INTERNAL_GTEST_LIBRARY 0) |
| 6 | endif () |
| 7 | |
| 8 | if (NOT USE_INTERNAL_GTEST_LIBRARY) |
| 9 | find_library (GTEST_LIBRARY gtest_main) |
| 10 | find_path (GTEST_INCLUDE_DIR NAMES /gtest/gtest.h PATHS ${GTEST_INCLUDE_PATHS}) |
| 11 | endif () |
| 12 | |
| 13 | if (GTEST_LIBRARY AND GTEST_INCLUDE_DIR) |
| 14 | else () |
| 15 | set (USE_INTERNAL_GTEST_LIBRARY 1) |
| 16 | set (GTEST_LIBRARY gtest_main) |
| 17 | endif () |
| 18 | |
| 19 | message (STATUS "Using gtest: ${GTEST_INCLUDE_DIR} : ${GTEST_LIBRARY}") |