-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GTest: Move to using FetchContent instead of an in-tree copy
- Loading branch information
Chuck Atkins
committed
Jul 1, 2020
1 parent
69f319c
commit d335628
Showing
322 changed files
with
13 additions
and
132,427 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 |
---|---|---|
@@ -1,22 +1,16 @@ | ||
message_start_thirdparty() | ||
|
||
set(BUILD_GTEST ON CACHE INTERNAL "") | ||
set(BUILD_GMOCK OFF CACHE INTERNAL "") | ||
if(BUILD_SHARED_LIBS) | ||
set(gtest_force_shared_crt ON CACHE INTERNAL "") | ||
endif() | ||
set(BUILD_SHARED_LIBS OFF) | ||
|
||
set(CMAKE_POLICY_DEFAULT_CMP0042 NEW) | ||
|
||
add_subdirectory(googletest EXCLUDE_FROM_ALL) | ||
|
||
add_library(gtest_interface INTERFACE) | ||
target_link_libraries(gtest_interface INTERFACE gtest) | ||
if(BUILD_SHARED_LIBS) | ||
target_compile_definitions(gtest_interface INTERFACE | ||
GTEST_LINKED_AS_SHARED_LIBRARY=1 | ||
) | ||
endif() | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG release-1.10.0 | ||
CMAKE_ARGS | ||
-DBUILD_GTEST=ON | ||
-DBUILD_GMOCK=OFF | ||
-DBUILD_SHARED_LIBS=OFF | ||
-Dgtest_force_shared_crt=${BUILD_SHARED_LIBS} | ||
) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
message_end_thirdparty() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.