Skip to content

Commit

Permalink
Update GTest to 1.8.1 (#53)
Browse files Browse the repository at this point in the history
* Update GTest to 1.8.1

* add comment about gtest_force_shared_crt
  • Loading branch information
rbsheth committed Nov 1, 2019
1 parent 11085e0 commit 2ccff0d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ hunter_default_version(GSL VERSION 2.1.0-p2)
if(MSVC80)
hunter_default_version(GTest VERSION 1.7.0-hunter-6)
else()
hunter_default_version(GTest VERSION 1.8.0-hunter-p11)
hunter_default_version(GTest VERSION 1.8.1)
endif()

hunter_default_version(HalideIR VERSION 0.0-32057b5-p0)
Expand Down
15 changes: 15 additions & 0 deletions cmake/projects/GTest/hunter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,31 @@ hunter_add_version(
76c6aec038f7d7258bf5c4f45c4817b34039d285
)

hunter_add_version(
PACKAGE_NAME
GTest
VERSION
"1.8.1"
URL
"https://github.com/google/googletest/archive/release-1.8.1.tar.gz"
SHA1
152b849610d91a9dfa1401293f43230c2e0c33f8
)


if(HUNTER_GTest_VERSION VERSION_LESS 1.8.0)
set(_gtest_license "LICENSE")
else()
set(_gtest_license "googletest/LICENSE")
endif()

# gtest_force_shared_crt prevents GoogleTest from modifying options
# rather than forcing it to use shared libraries
hunter_cmake_args(
GTest
CMAKE_ARGS
HUNTER_INSTALL_LICENSE_FILES=${_gtest_license}
gtest_force_shared_crt=TRUE
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
Expand Down
5 changes: 1 addition & 4 deletions examples/GTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ add_executable(foo foo.cpp)

hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED)
target_link_libraries(foo PUBLIC GTest::main)

find_package(GMock CONFIG REQUIRED)
target_link_libraries(foo PUBLIC GMock::gmock)
target_link_libraries(foo PRIVATE GTest::gtest_main GTest::gmock)

if(NOT EXISTS "${GTest_LICENSES}")
message(FATAL_ERROR "File not found: '${GTest_LICENSES}")
Expand Down

0 comments on commit 2ccff0d

Please sign in to comment.