Files
build-cpp-cmkr/docs/examples.markdown
T
Luiz "darknessxk" Felipe 3ba07bfd17 Added Quickstart example
2021-05-13 03:29:41 +02:00

1.1 KiB

layout, title, permalink
layout title permalink
page Examples /examples/

Examples

Quickstart

Smallest possible start point you can have using cmkr

[cmake]
version = "3.15"

[project]
name = "hello-world"

[target.hello-world]
type = "executable"
sources = [ "src/*.cpp" ]

Changing C++/C version

Simple example changing C++ to version 20 and C standard to the version 11

[target.example]
type = "executable"
compile-features = [ "cxx_std_20", "c_std_11" ]

Import from another Git repository

Importing an existing project called Zydis to my project

tag is optional but you can target any branch with it

[fetch-content]
zydis = { git = "https://github.com/zyantific/zydis.git", tag = "v3.1.0" }

[target.example]
type = "executable"
link-libraries = ["zydis"]

Import from another folder

Importing an existing project called Zydis to my project

tag is optional but you can target any branch with it

[fetch-content]
zydis = { git = "https://github.com/zyantific/zydis.git", tag = "v3.1.0" }

[target.example]
type = "executable"
link-libraries = ["zydis"]