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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user