Merge pull request #131 from build-cpp/fetch-subdir

Add [fetch-content].subdir
main
Duncan Ogilvie 1 year ago committed by GitHub
commit 099b14552c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -180,6 +180,7 @@ git = "https://github.com/myuser/gitcontent"
tag = "v0.1" tag = "v0.1"
shallow = false shallow = false
system = false system = false
subdir = ""
[fetch-content.svncontent] [fetch-content.svncontent]
condition = "mycondition" condition = "mycondition"
@ -195,6 +196,8 @@ hash = "SHA1 502a4e25b8b209889c99c7fa0732102682c2e4ff"
sha1 = "502a4e25b8b209889c99c7fa0732102682c2e4ff" sha1 = "502a4e25b8b209889c99c7fa0732102682c2e4ff"
``` ```
Table keys that match CMake variable names (`[A-Z_]+`) will be passed to the [`FetchContent_Declare`](https://cmake.org/cmake/help/latest/module/FetchContent.html#command:fetchcontent_declare) command.
## Targets ## Targets
```toml ```toml

@ -156,6 +156,7 @@ struct Content {
ConditionVector include_before; ConditionVector include_before;
ConditionVector include_after; ConditionVector include_after;
bool system; bool system;
std::string subdir;
}; };
enum MsvcRuntimeType { enum MsvcRuntimeType {

@ -507,6 +507,8 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p
value = algo + "=" + value; value = algo + "=" + value;
} else if (key == "hash") { } else if (key == "hash") {
key = "URL_HASH"; key = "URL_HASH";
} else if (key == "subdir") {
key = "SOURCE_SUBDIR";
} else if (is_cmake_arg(key)) { } else if (is_cmake_arg(key)) {
// allow passthrough of ExternalProject options // allow passthrough of ExternalProject options
} else if (!c.visisted(key)) { } else if (!c.visisted(key)) {

Loading…
Cancel
Save