diff --git a/Cargo.toml b/Cargo.toml index 57a7ed7..491624a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,5 +2,5 @@ members = [ "lvgl", "lvgl-sys", - "examples/demo", + "examples" ] diff --git a/README.md b/README.md index 865520e..97d7255 100644 --- a/README.md +++ b/README.md @@ -54,4 +54,10 @@ That is required, so we can safely provide Rust pointers through FFI. For that r ## Running the demo -[This project contains an example that can run in a desktop simulator.](./examples/demo) +[This project contains examples that can run in a desktop simulator.](./examples) + +To run the `demo` example: + +```shell +$ DEP_LV_CONFIG_PATH=`pwd`/examples/include cargo run --example demo +``` diff --git a/examples/Cargo.toml b/examples/Cargo.toml new file mode 100644 index 0000000..8dfe050 --- /dev/null +++ b/examples/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "demo" +version = "0.1.0" +authors = ["Rafael Caricio "] +edition = "2018" +publish = false + +[dev-dependencies] +lvgl = { path = "../lvgl" } +lvgl-sys = { path = "../lvgl-sys" } +embedded-graphics = "0.6" +embedded-graphics-simulator = "0.2.0" + +[[example]] +name = "demo" +path = "demo.rs" diff --git a/examples/demo/src/main.rs b/examples/demo.rs similarity index 100% rename from examples/demo/src/main.rs rename to examples/demo.rs diff --git a/examples/demo/README.md b/examples/demo/README.md deleted file mode 100644 index 0ce3e64..0000000 --- a/examples/demo/README.md +++ /dev/null @@ -1,12 +0,0 @@ -From base of the repository, install LVGL git submodule. - -``` -git submodule update --init -``` - -Run this demo: - -``` -cd examples/demo/ -DEP_LV_CONFIG_PATH=./include cargo run -``` diff --git a/examples/demo/include/fonts_noto_sans_numeric_80.c b/examples/include/fonts_noto_sans_numeric_80.c similarity index 100% rename from examples/demo/include/fonts_noto_sans_numeric_80.c rename to examples/include/fonts_noto_sans_numeric_80.c diff --git a/examples/demo/include/lv_conf.h b/examples/include/lv_conf.h similarity index 100% rename from examples/demo/include/lv_conf.h rename to examples/include/lv_conf.h diff --git a/examples/demo/include/noto_sans_numeric_80.h b/examples/include/noto_sans_numeric_80.h similarity index 100% rename from examples/demo/include/noto_sans_numeric_80.h rename to examples/include/noto_sans_numeric_80.h