Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroAir committed Nov 25, 2023
1 parent bb25202 commit 4043c55
Show file tree
Hide file tree
Showing 109 changed files with 446 additions and 949 deletions.
54 changes: 4 additions & 50 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,39 +133,11 @@ set(device_module
${lithium_src_dir}/device/hydrogen_device.cpp
)

set(image_module
${lithium_src_dir}/image/image.cpp
${lithium_src_dir}/image/draw.cpp
)

set(io_module
${lithium_module_dir}/io/compress.cpp
${lithium_module_dir}/io/file.cpp
${lithium_module_dir}/io/io.cpp
)

set(module_module
${lithium_module_dir}/plugin/module_loader.cpp
${lithium_src_dir}/plugin/plugin_loader.cpp
${lithium_module_dir}/plugin/compiler.cpp
)

set(web_module
${lithium_module_dir}/web/downloader.cpp
${lithium_module_dir}/web/httpclient.cpp
${lithium_module_dir}/web/httplite.cpp
${lithium_module_dir}/web/utils.cpp
${lithium_module_dir}/web/time.cpp
)

set(server_module
${lithium_module_dir}/server/commander.hpp
${lithium_module_dir}/server/message_bus.hpp
${lithium_module_dir}/server/message_queue.hpp
${lithium_module_dir}/server/serialize.cpp
${lithium_module_dir}/server/deserialize.cpp
${lithium_module_dir}/server/json_checker.cpp

${lithium_src_dir}/websocket/WebSocketServer.cpp
${lithium_src_dir}/websocket/WsDeviceComponent.cpp
${lithium_src_dir}/websocket/WsProcessComponent.cpp
Expand Down Expand Up @@ -196,27 +168,6 @@ set(task_module
${lithium_src_dir}/task/task_generator.cpp
)

set(thread_module
${lithium_module_dir}/thread/thread.cpp
${lithium_module_dir}/thread/thread_pool.hpp
)

set(system_module
${lithium_module_dir}/system/system.cpp
${lithium_module_dir}/system/crash.cpp
${lithium_module_dir}/system/process.cpp
${lithium_module_dir}/system/pid.cpp
${lithium_module_dir}/system/pidw.cpp
# ${lithium_module_dir}/system/filew.cpp
${lithium_module_dir}/system/dirw.cpp
)

set(utils_module
${lithium_module_dir}/utils/time.cpp
${lithium_module_dir}/utils/string.cpp
${lithium_module_dir}/utils/static_switch.cpp
)

set(Lithium_module
${lithium_src_dir}/App.cpp
${lithium_src_dir}/AppComponent.hpp
Expand Down Expand Up @@ -276,20 +227,23 @@ add_subdirectory(libs/)
# 所有的工具组件
add_subdirectory(tools)

add_subdirectory(${lithium_module_dir})

# 内置的模组
include_directories(modules)
add_subdirectory(modules/hydrogen_client)

# 构建Lithium内核
add_subdirectory(${lithium_src_dir}/core)

add_executable(lithium_server ${api_module} ${config_module} ${io_module} ${module_module} ${web_module} ${device_module} ${thread_module} ${task_module} ${server_module} ${script_module} ${system_module} ${utils_module} ${Lithium_module})
add_executable(lithium_server ${api_module} ${config_module} ${module_module} ${device_module} ${task_module} ${server_module} ${script_module} ${Lithium_module})

target_link_directories(lithium_server PUBLIC ${CMAKE_BINARY_DIR}/libs)

target_link_libraries(lithium_server oatpp oatpp-websocket oatpp-swagger oatpp-openssl oatpp-zlib)
target_link_libraries(lithium_server loguru)
target_link_libraries(lithium_server libzippp)
target_link_libraries(lithium_server atomstatic)

target_link_libraries(lithium_server lithiumcorestatic)
target_link_libraries(lithium_server lithiumpluginstatic)
Expand Down
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Lithium
=======

<p align="center">
<a href="https://isocpp.org/">
<img src="https://img.shields.io/badge/language-C%2B%2B20-blue.svg">
</a>
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" >
<img src="https://img.shields.io/github/license/ElementAstro/Lithium">
</a>
<img src="https://img.shields.io/badge/dialect-C%2B%2B20-blue">
<img src="https://img.shields.io/badge/license-GPL3-blue">
<img src="https://img.shields.io/badge/platform-Windows-green">
<img src= "https://img.shields.io/badge/platform-Linux%20x86__64--bit-green">
<img src="https://img.shields.io/badge/platform-Linux%20ARM-green">
<img src="https://img.shields.io/badge/platform-Ubuntu-green">
</p>

## Introduction
Expand All @@ -28,11 +27,11 @@ Features:

## How to build:

### Install dependencies:
### Install dependencies

Although efforts have been made to minimize the use of libraries, a few dependencies still need to be installed.

On Windows platform:
#### On Windows

```shell
sed -i "s#https\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g" /etc/pacman.d/mirrorlist*
Expand All @@ -43,21 +42,16 @@ pacman -S mingw-w64-x86_64-cfitsio
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-libzip
pacman -S mingw-w64-x86_64-zlib
pacman -S mingw-w64-x86_64-fftw
pacman -S mingw-w64-x86_64-fmt
pacman -S mingw-w64-x86_64-libnova
pacman -S mingw-w64-x86_64-libjpeg-turbo
pacman -S mingw-w64-x86_64-libusb
```

On Ubuntu or other similar Linux platforms:
#### On Ubuntu or other similar Linux platforms (No INDI needed):

```shell
sudo apt-add-repository ppa:mutlaqja/ppa -y
sudo apt update && sudo apt upgrade -y
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install gcc g++ cmake
sudo apt-get install libindi1 indi-bin libindi-dev
sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev
sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev
```

Alternatively, you can directly run the provided script according to your platform:
Expand All @@ -67,6 +61,19 @@ sudo sh scripts/build_ci.sh
sh scripts/build_win.sh
```

#### Update GCC and Cmake

Unfortunately, the newest GCC and CMake are not available on Github Codespace, so we must install them manually.

```shell
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-13 # GCC13 is the best choice

wget https://cmake.org/files/v3.28/cmake-3.28.0-rc5.tar.gz
tar -zxvf cmake-3.28.0-rc5.tar.gz
```

Build the code:

```shell
Expand Down Expand Up @@ -122,7 +129,7 @@ And never lose sight of this noble race.

尽管已经尽最大努力减少了库的使用,但仍需要安装一些依赖项

在Windows平台下
#### 在Windows平台下

```shell
# 添加清华镜像源,下载速度嘎嘎的
Expand All @@ -134,24 +141,18 @@ pacman -S mingw-w64-x86_64-cfitsio
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-libzip
pacman -S mingw-w64-x86_64-zlib
pacman -S mingw-w64-x86_64-fftw
pacman -S mingw-w64-x86_64-fmt
pacman -S mingw-w64-x86_64-libnova
pacman -S mingw-w64-x86_64-libjpeg-turbo
pacman -S mingw-w64-x86_64-libusb
# 如果想用make构建
pacman -S make
pacman -S make # 注意添加对应的目录,否则会当场爆炸
```

在Ubuntu或其他类似的Linux平台下:
#### Ubuntu/Debian (不需要INDI库)

```shell
# 安装INDI及其附属库
sudo apt-add-repository ppa:mutlaqja/ppa -y
sudo apt update && sudo apt upgrade -y
sudo apt-get install libindi1 indi-bin libindi-dev
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install gcc g++ cmake
sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev
sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev
```

或者您可以直接根据您的平台运行提供的脚本:
Expand All @@ -161,7 +162,7 @@ sudo sh scripts/build_ci.sh
sh scripts/build_win.sh
```

构建代码
#### 构建代码

```shell
mkdir build && cd build
Expand Down
Loading

0 comments on commit 4043c55

Please sign in to comment.