-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake file: googletest, Catch2, benchmark
- Loading branch information
1 parent
d72a801
commit 2afe05b
Showing
10 changed files
with
124 additions
and
36 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
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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (c) 2023 Myvas Foundation | ||
# SPDX-License-Identifier: MIT | ||
|
||
################################### | ||
# Find or fetch a CMake package | ||
# | ||
# googletest >=1.10.0 | ||
# googletest | ||
################################### | ||
|
||
set(googletest_VERSION_REQUIRED 1.14.0) | ||
|
||
find_package(googletest ${googletest_VERSION_REQUIRED} QUIET) | ||
if(googletest_FOUND) | ||
message(STATUS "Found googletest: ${googletest_VERSION}") | ||
else() | ||
message(STATUS "CMake package googletest ${googletest_VERSION_REQUIRED} or later not found!" | ||
" Please wait for fetching from https://github.com/google/googletest" | ||
) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare(googletest | ||
URL https://github.com/google/googletest/archive/refs/tags/v${googletest_VERSION_REQUIRED}.tar.gz | ||
DOWNLOAD_EXTRACT_TIMESTAMP ON | ||
OVERRIDE_FIND_PACKAGE | ||
) | ||
find_package(googletest) | ||
if(googletest_FOUND) | ||
# TODO: We should extract `REAL` version number by hand, since there is no googletest_VERSION here! | ||
message(STATUS "Built googletest: ${googletest_VERSION}") | ||
else() | ||
message(FATAL_ERROR "Failed to build googletest: ${googletest_VERSION_REQUIRED}") | ||
endif() | ||
endif() |