build-cpp/cmkr

Improve the error message for `[fetch-content]` subkeys

mrexodia opened this issue · 0 comments

# Reference: https://build-cpp.github.io/cmkr/cmake-toml
[project]
name = "ConsoleApplication1"

# TODO: define a target for each of your executables/libraries like this:
#[target.myexecutable]
#type = "executable" # static, shared
#sources = ["src/ConsoleApplication1/*.cpp", "include/ConsoleApplication1/*.hpp"]
#include-directories = ["include"]
#compile-features = ["cxx_std_11"]
#link-libraries = ["target-or-library"]

[fetch-content]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "7.1.3" }


compile-features = ["cxx_std_20"]
[target.example]
type = "executable"
sources = ["src/Source.cpp"]
link-libraries = ["fmt::fmt"]

The error is:

[error] toml::value::contains(key): bad_cast to table
 --> D:\CodeBlocks\cmkr-atul\cmake.toml
    |
 17 | compile-features = ["cxx_std_20"]
    |                    ~~~~~~~~~~~~~~ the actual type is array