uiLitejhksdhkfj/documents/HowToUse.md

68 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2020-01-22 11:03:29 +08:00
# How to use GuiLite?
- For GuiLite user: You could copy GuiLite.h in your application
- For GuiLite developer: You could get well-organized source code, and develop it on any platform(Windows/Linux/Apple)
# For GuiLite user
GuiLite is a header-only library, so it should be straightforward to integrate into your application.
UIcode.cpp:
```c++
#define GUILITE_ON // Do not define this macro upon GuiLite.h once more
#include "GuiLite.h"
// your code here:
```
# For GuiLite developer
2021-07-03 23:04:07 +08:00
## Build GuiLite library for Windows?
2020-01-22 11:03:29 +08:00
Prerequisite: Windows & Visul Studio 2013/2015/2017/2019
- Open "GuiLite.sln" by Visual Studio
- Click `Build Solution`
2020-09-28 00:13:50 +08:00
- Output here: GuiLite\workspace\Debug(Release)\GuiLite.lib
2020-01-22 11:03:29 +08:00
FAQ: Error when open GuiLite project with Visual Studio, reconfigure the project to match your computer like this:
![vs-configure](vs-configure.jpg)
2021-07-03 23:04:07 +08:00
## Build GuiLite library for iOS/Mac and Linux(amd64) & raspberry pi?
2020-01-22 11:03:29 +08:00
```bash
cd GuiLite/workspace
cmake .
make
2020-09-28 00:13:50 +08:00
# Output here: GuiLite/workspace/libGuiLite.a
2020-01-22 11:03:29 +08:00
```
2021-07-03 23:04:07 +08:00
## Build GuiLite library for ARM Linux?
2020-01-22 11:03:29 +08:00
### Prerequisite: Install cross compiler:
```bash
# For ARM32:
sudo apt-get install g++-arm-linux-gnueabi gcc-arm-linux-gnueabi
# For ARM64:
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
```
### Build
```bash
cd GuiLite/workspace
# For ARM32:
cmake -D CMAKE_C_COMPILER="/usr/bin/arm-linux-gnueabi-gcc" -D CMAKE_CXX_COMPILER="/usr/bin/arm-linux-gnueabi-g++" .
# For ARM64:
cmake -D CMAKE_C_COMPILER="/usr/bin/aarch64-linux-gnu-gcc" -D CMAKE_CXX_COMPILER="/usr/bin/aarch64-linux-gnu-g++" .
make
```
2020-09-28 00:13:50 +08:00
Output here: GuiLite/workspace/libGuiLite.a
2020-01-22 11:03:29 +08:00
2021-07-03 23:04:07 +08:00
## How to build GuiLite library for any MCU?
2020-01-22 11:03:29 +08:00
### Prerequisite: Install Keil uvsion 5.6 or above.
### Build
- Open `GuiLite/workspace/GuiLite.uvprojx` with Keil uvsion.
- Implement function(e.g, thread_sleep) in `core\src\adapter\api_unknow.cpp` to meet your need.
- Choose your Device type(Default: STM32F103ZE) from option for target.
- Build GuiLite.
2020-09-28 00:13:50 +08:00
- Output here: GuiLite/workspace/Objects/GuiLite.lib
2020-01-22 11:03:29 +08:00
## Build header-only GuiLite.h?
```bash
2023-04-25 10:48:05 +08:00
cd GuiLite/src
./GenerateGuiLite.h.sh
2020-01-22 11:03:29 +08:00
```