feat(CMake): library only; update(README)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -39,6 +39,7 @@ WORKSPACE.bazel
|
|||||||
BUILD.bazel
|
BUILD.bazel
|
||||||
|
|
||||||
# Dirs
|
# Dirs
|
||||||
|
build
|
||||||
bin
|
bin
|
||||||
obj
|
obj
|
||||||
lib
|
lib
|
||||||
|
|||||||
29
CMakeLists.txt
Normal file
29
CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.21)
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
project(libbasen
|
||||||
|
VERSION 1.1.1
|
||||||
|
DESCRIPTION "c++20 encoding/decoding from arbitrary base"
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
|
set(CXX_FLAGS "-Wall -Wextra -Werror -Wno-unused-result -O3")
|
||||||
|
|
||||||
|
set(OBJS
|
||||||
|
base58
|
||||||
|
base64
|
||||||
|
baseN
|
||||||
|
hex
|
||||||
|
Exception
|
||||||
|
hash/sha256
|
||||||
|
)
|
||||||
|
set(SRCS)
|
||||||
|
foreach(OBJ ${OBJS})
|
||||||
|
list(APPEND SRCS "src/${OBJ}.cpp")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
add_library(basen ${SRCS})
|
||||||
|
add_library(basen::basen ALIAS basen)
|
||||||
|
target_include_directories(basen PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
)
|
||||||
2
Makefile
2
Makefile
@ -31,7 +31,7 @@ ifeq (${origin CC}, default)
|
|||||||
CC = g++
|
CC = g++
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = -std=c++23 -Wall -Wextra -Werror -Wno-unused-result -fPIC
|
CFLAGS = -std=c++20 -Wall -Wextra -Werror -Wno-unused-result -fPIC
|
||||||
|
|
||||||
ifneq (${DEBUG}, false)
|
ifneq (${DEBUG}, false)
|
||||||
CFLAGS += -fsanitize=address,undefined -g -O0
|
CFLAGS += -fsanitize=address,undefined -g -O0
|
||||||
|
|||||||
29
README.md
29
README.md
@ -1,6 +1,6 @@
|
|||||||
# libbasen
|
# libbasen
|
||||||
|
|
||||||
c++ encoding/decoding from arbitrary base
|
c++20 encoding/decoding from arbitrary base
|
||||||
|
|
||||||
<a href="https://repology.org/project/libbasen/versions">
|
<a href="https://repology.org/project/libbasen/versions">
|
||||||
<img src="https://repology.org/badge/tiny-repos/libbasen.svg" alt="Packaging status">
|
<img src="https://repology.org/badge/tiny-repos/libbasen.svg" alt="Packaging status">
|
||||||
@ -12,17 +12,24 @@ c++ encoding/decoding from arbitrary base
|
|||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
|
- [Package](#package)
|
||||||
|
- [Make](#make)
|
||||||
|
- [CMake](#cmake)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Automatically from specified repositories:
|
### Package
|
||||||
|
|
||||||
[](https://repology.org/project/libbasen/versions)
|
[](https://repology.org/project/libbasen/versions)
|
||||||
|
|
||||||
Manually using make:
|
### Make
|
||||||
|
|
||||||
|
For cli tool you should have [argparse](https://github.com/p-ranav/argparse) as make dependency.
|
||||||
|
|
||||||
|
Install:
|
||||||
```
|
```
|
||||||
make -j $(nproc)
|
make -j $(nproc)
|
||||||
sudo make i USRDIR=(Your installation dir)
|
sudo make i USRDIR=(Your installation dir)
|
||||||
@ -32,6 +39,22 @@ Uninstall:
|
|||||||
sudo make uni USRDIR=(Your installation dir)
|
sudo make uni USRDIR=(Your installation dir)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### CMake
|
||||||
|
|
||||||
|
For using as dependency only (without cli tool, test, coverage, docs)
|
||||||
|
|
||||||
|
```
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
basen
|
||||||
|
GIT_REPOSITORY https://github.com/vSEK1RO/libbasen.git
|
||||||
|
GIT_TAG latest
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(basen)
|
||||||
|
|
||||||
|
target_link_libraries(MyProject PRIVATE basen::basen)
|
||||||
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Available [here](https://vsek1ro.github.io/libbasen)
|
Available [here](https://vsek1ro.github.io/libbasen)
|
||||||
|
|||||||
Reference in New Issue
Block a user