Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/cmake-toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ git = "https://github.com/myuser/gitcontent"
tag = "v0.1"
shallow = false
system = false
subdir = ""

[fetch-content.svncontent]
condition = "mycondition"
Expand All @@ -195,6 +196,8 @@ hash = "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

```toml
Expand Down
1 change: 1 addition & 0 deletions include/project_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct Content {
ConditionVector include_before;
ConditionVector include_after;
bool system;
std::string subdir;
};

enum MsvcRuntimeType {
Expand Down
2 changes: 2 additions & 0 deletions src/project_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p
value = algo + "=" + value;
} else if (key == "hash") {
key = "URL_HASH";
} else if (key == "subdir") {
key = "SOURCE_SUBDIR";
} else if (is_cmake_arg(key)) {
// allow passthrough of ExternalProject options
} else if (!c.visisted(key)) {
Expand Down