Skip to content

Commit

Permalink
GTest: Move to using FetchContent instead of an in-tree copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Atkins committed Jul 1, 2020
1 parent 69f319c commit d335628
Show file tree
Hide file tree
Showing 322 changed files with 13 additions and 132,427 deletions.
2 changes: 1 addition & 1 deletion thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(BUILD_TESTING)
adios2_add_thirdparty_target(gtest GTest::GTest)
else()
add_subdirectory(GTest)
adios2_add_thirdparty_target(gtest gtest_interface)
adios2_add_thirdparty_target(gtest gtest)
endif()
endif()

Expand Down
30 changes: 12 additions & 18 deletions thirdparty/GTest/CMakeLists.txt
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()
4 changes: 0 additions & 4 deletions thirdparty/GTest/Readme.txt

This file was deleted.

40 changes: 0 additions & 40 deletions thirdparty/GTest/googletest/.gitignore

This file was deleted.

81 changes: 0 additions & 81 deletions thirdparty/GTest/googletest/.travis.yml

This file was deleted.

175 changes: 0 additions & 175 deletions thirdparty/GTest/googletest/BUILD.bazel

This file was deleted.

33 changes: 0 additions & 33 deletions thirdparty/GTest/googletest/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit d335628

Please sign in to comment.