-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to download dependencies with CMake
This is another step in reaching feature parity between CMake and meson. When using the `fetch-deps` preset, or when setting `CMAKE_PROJECT_TOP_LEVEL_INCLUDES` to `subprojects/provider.cmake`, the dependencies will be downloaded and built from source.
- Loading branch information
Showing
5 changed files
with
60 additions
and
7 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,4 +1,5 @@ | ||
subprojects/* | ||
!subprojects/*.wrap | ||
!subprojects/*.cmake | ||
.pixi/ | ||
.cache/ |
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,41 @@ | ||
cmake_minimum_required(VERSION 3.24) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
GTest | ||
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz | ||
URL_HASH SHA256=8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7 | ||
) | ||
FetchContent_Declare( | ||
tl-expected | ||
URL https://github.com/TartanLlama/expected/archive/v1.1.0.tar.gz | ||
URL_HASH SHA256=1db357f46dd2b24447156aaf970c4c40a793ef12a8a9c2ad9e096d9801368df6 | ||
) | ||
FetchContent_Declare( | ||
jsoncpp | ||
URL https://github.com/open-source-parsers/jsoncpp/archive/1.9.5.tar.gz | ||
URL_HASH SHA256=f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2 | ||
) | ||
FetchContent_Declare( | ||
fmt | ||
URL https://github.com/fmtlib/fmt/archive/10.1.1.tar.gz | ||
URL_HASH SHA256=78b8c0a72b1c35e4443a7e308df52498252d1cefc2b08c9a97bc9ee6cfe61f8b | ||
) | ||
FetchContent_Declare( | ||
CLI11 | ||
URL https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.1.2.tar.gz | ||
URL_HASH SHA256=26291377e892ba0e5b4972cdfd4a2ab3bf53af8dac1f4ea8fe0d1376b625c8cb | ||
) | ||
|
||
macro(provide_dependency method dep_name) | ||
if ("${dep_name}" MATCHES "^(GTest|tl-expected|jsoncpp|fmt|CLI11)$") | ||
FetchContent_MakeAvailable(${dep_name}) | ||
set(${dep_name}_FOUND TRUE) | ||
endif() | ||
endmacro() | ||
|
||
cmake_language( | ||
SET_DEPENDENCY_PROVIDER provide_dependency | ||
SUPPORTED_METHODS | ||
FIND_PACKAGE | ||
) |