1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fall back to system GTest if available (#473)

Using a submodule to download and build GTest is a great approach for
most circumstances, but some may prefer to use the system-provided GTest
if it is available.

This change adds a fallback to using the system's GTest if the submodule
is absent.
This commit is contained in:
Scott K Logan
2022-05-14 11:07:39 -07:00
committed by GitHub
parent 2601493752
commit 7cd2b2c396

View File

@@ -303,7 +303,13 @@ IF(LIBTINS_BUILD_TESTS)
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
ELSE()
MESSAGE(STATUS "googletest git submodule is absent. Run `git submodule init && git submodule update` to get it")
FIND_PACKAGE(GTest QUIET)
IF(${GTest_FOUND})
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
ELSE()
MESSAGE(STATUS "googletest git submodule is absent. Run `git submodule init && git submodule update` to get it")
ENDIF()
ENDIF()
ENDIF()