-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note that we removed `-Werror` to `-Wno-deprecated-declarations` due to a bug in clang:llvm/llvm-project#75057
- Loading branch information
1 parent
54c7371
commit 8f5e4f2
Showing
5 changed files
with
20 additions
and
50 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
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,46 +1,18 @@ | ||
if("${GOOGLETEST_ROOT}" STREQUAL "") | ||
set(GOOGLETEST_ROOT "/usr/local") | ||
endif() | ||
|
||
if("${GOOGMOCK_ROOT}" STREQUAL "") | ||
set(GOOGMOCK_ROOT "/usr/local") | ||
endif() | ||
|
||
find_path(GTEST_INCLUDE_DIR | ||
NAMES gtest/gtest.h | ||
PATHS ${GOOGLETEST_ROOT}/include) | ||
|
||
find_path(GMOCK_INCLUDE_DIR | ||
NAMES gmock/gmock.h | ||
PATHS ${GOOGMOCK_ROOT}/include) | ||
|
||
find_library(GTEST_LIBRARIES | ||
NAME gtest | ||
PATHS ${GOOGLETEST_ROOT}/lib) | ||
|
||
find_library(GMOCK_LIBRARIES | ||
NAME gmock | ||
PATHS ${GOOGMOCK_ROOT}/lib) | ||
|
||
if(NOT GTEST_LIBRARIES OR NOT GMOCK_LIBRARIES) | ||
message(STATUS "fetch GTest from https://github.com/google/googletest.git") | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG release-1.11.0 | ||
) | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
set(BUILD_GMOCK ON CACHE BOOL "" FORCE) | ||
set(BUILD_GTEST ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
set(GMOCK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/_deps/googletest-src/googlemock/include/) | ||
set(GTEST_INCLUDE_DIR ${CMAKE_BINARY_DIR}/_deps/googletest-src/googletest/include/) | ||
set(GTEST_LIBRARIES gtest_main) | ||
set(GMOCK_LIBRARIES gmock_main) | ||
else() | ||
message(STATUS "use system GTest") | ||
endif() | ||
message(STATUS "fetch GTest from https://github.com/google/googletest.git") | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG release-1.11.0 | ||
) | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
set(BUILD_GMOCK ON CACHE BOOL "" FORCE) | ||
set(BUILD_GTEST ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
set(GMOCK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/_deps/googletest-src/googlemock/include/) | ||
set(GTEST_INCLUDE_DIR ${CMAKE_BINARY_DIR}/_deps/googletest-src/googletest/include/) | ||
set(GTEST_LIBRARIES gtest_main) | ||
set(GMOCK_LIBRARIES gmock_main) | ||
|
||
message(STATUS "GTest: ${GTEST_INCLUDE_DIR}, ${GTEST_LIBRARIES}") | ||
message(STATUS "GMock: ${GMOCK_INCLUDE_DIR}, ${GMOCK_LIBRARIES}") |
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