File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,17 @@ function(project_testcoverage_setup)
46
46
)
47
47
endfunction ()
48
48
49
+ # Fetches google test version 1.12.1
50
+ function (fetch_googletest )
51
+ include (FetchContent )
52
+ FetchContent_Declare (
53
+ googletest
54
+ GIT_REPOSITORY https://github.com/google/googletest.git
55
+ GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 )
56
+ FetchContent_MakeAvailable (googletest )
57
+ message (VERBOSE "GTest binaries are present at ${googletest_BINARY_DIR} " )
58
+ endfunction ()
59
+
49
60
# Setups targets for code processing.
50
61
51
62
function (project_codetools_setup )
Original file line number Diff line number Diff line change 1
1
enable_testing ()
2
2
3
3
find_package (GTest 1.10 QUIET CONFIG )
4
+ if (NOT GTest_FOUND )
5
+ message (WARNING "GTest with version >= \" 1.10\" was not found, fetching from internet" )
6
+ fetch_googletest ()
7
+ endif ()
8
+ find_package_message (
9
+ GTest_DETAILS
10
+ "Found GTest: ${GTest_DIR} (version \" ${GTest_VERSION} \" )"
11
+ "[${GTest_FOUND} ][${GTest_DIR} ][v${GTest_VERSION} ]" )
4
12
5
13
include (GoogleTest )
6
14
You can’t perform that action at this time.
0 commit comments