Add [fetch-content].subdir

Closes #98
main
Duncan Ogilvie 11 months ago
parent 58c7de1d60
commit 771c80a41a

@ -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