Skip to content

Improve the error message for [fetch-content] subkeys #80

Open
@mrexodia

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions