diff --git a/CMakeLists.txt b/CMakeLists.txt index 99cac11874d3827d299726309b0af01eca85a6f8..e08d2bb6addf3a669e4b8b6043ce2c2088c875da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,6 +376,8 @@ add_library(lava::app ALIAS lava.app) option(LIBLAVA_TESTS "Enable Tests" TRUE) if(LIBLAVA_TESTS) +message("========================================================================") + message("> tests") message(">> lava") @@ -492,4 +494,27 @@ install( DESTINATION ${CONFIG_PATH} ) +option(LIBLAVA_TEMPLATE "Enable Template" TRUE) +if(LIBLAVA_TEMPLATE) +message("========================================================================") + + set(NAME template) + + message("> ${NAME}") + + set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) + + add_executable(${NAME} + ${SRC_DIR}/main.cpp + ) + + target_include_directories(${NAME} PUBLIC + ${SRC_DIR} + ) + + target_link_libraries(${NAME} lava::app) + + set_property(TARGET ${NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_BINARY_DIR}") +endif() + message("========================================================================") diff --git a/DOCS.md b/DOCS.md index 1d9417e79baeeaf5e260333a2eac7ec85b53ab68..bcdba43605b18298efb4ad18e1e1d67b3a7398e4 100644 --- a/DOCS.md +++ b/DOCS.md @@ -2,7 +2,7 @@ # liblava docs [](https://git.io/liblava) -[Features](#features) **[Tutorial](#tutorial)** [Requirements](#requirements) **[Modules](#modules)** [Third-Party](#third-party) **[Guide](#guide)** [Tests](#tests) **[Build](#build)** [Install](#install) +[Features](#features) **[Tutorial](#tutorial)** [Requirements](#requirements) **[Modules](#modules)** [Third-Party](#third-party) **[Guide](#guide)** [Tests](#tests) [Template](#template) **[Build](#build)** [Install](#install) <br /> @@ -369,7 +369,7 @@ int main(int argc, char* argv[]) { <br /> -##### What's next? ā Check some <a href="https://git.io/liblava-demo">demos</a> and clone a <a href="https://git.io/liblava-template">starter template</a> to try it out! +##### What's next? ā Check some <a href="https://git.io/liblava-demo">demos</a> and use the [template](#template) to try it out! <a href="https://github.com/liblava/liblava-demo/#readme"><img src="res/demo.png"></a> @@ -528,6 +528,12 @@ In addition run **lava-unit** that will check parts of **liblava** using [Catch2 <br /> +## Template + +You can start coding with the **template** project. If you like you can rename it in [CMakeLists](CMakeLists.txt) + +Just put your code in the [src](src) folder. Everything you need is in [main.cpp](src/main.cpp) + ## Build ```bash diff --git a/README.md b/README.md index eea0a55484e737ef5d1a87fc3239a7a96ffd922e..92120b8bdbf09458fea0e4c4eeafacd55af110f5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ <br /> -**C++20** + **Modular** **<a href="https://git.io/liblava-demo">demo</a>** + <a href="https://git.io/liblava-template">template</a> **Windows** + **Linux** +**C++20** + **Modular** **<a href="https://git.io/liblava-demo">demo</a>** + [template](DOCS.md/#template) **Windows** + **Linux** [](https://git.io/liblava) [](LICENSE) [](https://www.codefactor.io/repository/github/liblava/liblava) [](https://discord.lava-block.com) [](https://paypal.me/liblava) [](https://twitter.com/liblava) diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8cf2dd83804639a56a86ffbaa2ad0a259ae9a36e --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,16 @@ +// file : src/main.cpp +// copyright : Copyright (c) 2018-present, Lava Block OĆ and contributors +// license : MIT; see accompanying LICENSE file + +#include <imgui.h> +#include <liblava/lava.hpp> + +using namespace lava; + +int main(int argc, char* argv[]) { + app app("template", { argc, argv }); + if (!app.setup()) + return error::not_ready; + + return app.run(); +}