Skip to content
Snippets Groups Projects
Commit 087490f7 authored by Lava Block's avatar Lava Block
Browse files

add template

parent 5b9fd1b6
No related branches found
No related tags found
No related merge requests found
......@@ -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("========================================================================")
......@@ -2,7 +2,7 @@
# liblava docs   [![Version](https://img.shields.io/badge/Version-0.6.0-blue)](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
......
......@@ -6,7 +6,7 @@
<br />
**C++20** + **Modular** &nbsp; **<a href="https://git.io/liblava-demo">demo</a>** + <a href="https://git.io/liblava-template">template</a> &nbsp; **Windows** + **Linux**
**C++20** + **Modular** &nbsp; **<a href="https://git.io/liblava-demo">demo</a>** + [template](DOCS.md/#template) &nbsp; **Windows** + **Linux**
[![Version](https://img.shields.io/badge/Version-0.6.0-blue)](https://git.io/liblava) [![License](https://img.shields.io/github/license/liblava/liblava)](LICENSE) [![CodeFactor](https://www.codefactor.io/repository/github/liblava/liblava/badge)](https://www.codefactor.io/repository/github/liblava/liblava) [![Discord](https://img.shields.io/discord/439508141722435595)](https://discord.lava-block.com) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/liblava) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow)](https://twitter.com/liblava)
......
// 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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment