-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from cisco/paulej_fetch_gtest
Fetch GoogleTest if not installed
- Loading branch information
Showing
11 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if(gse_BUILD_TESTS) | ||
find_package(GTest) | ||
|
||
if(NOT GTest_FOUND) | ||
message(STATUS "Fetching GTest since it is not available on the system") | ||
add_subdirectory(googletest) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
include(FetchContent) | ||
|
||
FetchContent_Declare(GTest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG v1.13.0 | ||
OVERRIDE_FIND_PACKAGE) | ||
|
||
if(WIN32) | ||
# For Windows: Prevent overriding the parent project's | ||
# compiler/linker settings | ||
# (https://github.com/google/googletest/tree/v1.13.0/googletest) | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
endif() | ||
|
||
# Prevent GTest from installing | ||
set(INSTALL_GTEST OFF CACHE INTERNAL "Disable gtest installation") | ||
|
||
FetchContent_MakeAvailable(GTest) | ||
|
||
add_library(GTest::GTest INTERFACE IMPORTED GLOBAL) | ||
add_library(GTest::Main INTERFACE IMPORTED GLOBAL) | ||
target_link_libraries(GTest::GTest INTERFACE gtest_main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters