-
Notifications
You must be signed in to change notification settings - Fork 281
Use system googletest dependency when available #304
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,8 @@ if(BUILD_TESTING) | |
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) # prefer use of -std14 instead of -gnustd14 | ||
|
||
if(NOT TARGET gtest OR NOT TARGET gmock_main) | ||
find_package(GTest REQUIRED) | ||
if(NOT TARGET GTest::gtest OR NOT TARGET GTest::gmock_main) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my 2 cents,
to compare with https://repology.org/project/gtest/badges (e.g. ubuntu 20.04 LTS => gtest 1.10.0)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. EDIT:
|
||
# Download and unpack googletest at configure time. | ||
configure_file( | ||
cmake/googletest.CMakeLists.txt.in | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you add
REQUIRED
-> if not found the cmake configure will fail where instead you would like to fallback to "build googletest if not found in the system"