Skip to content

Commit a0c61ed

Browse files
author
Sandro Kalatozishvili
committed
Updated CMakeLists.txt file and readme
1 parent 80a4c64 commit a0c61ed

File tree

4 files changed

+40
-26
lines changed

4 files changed

+40
-26
lines changed

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ endif()
1919
set(THREADS_PREFER_PTHREAD_FLAG ON)
2020
find_package(Threads REQUIRED)
2121

22-
22+
find_package(OpenSSL)
23+
IF(OpenSSL_FOUND)
24+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XUTILS_USE_SSL")
25+
ENDIF()
2326

2427
SET(HEADER_DST "include/xutils")
2528
SET(SOURCE_DIR "./src")

README.md

+34-23
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,32 @@
5858
### Installation
5959
There are several ways to build and install the project.
6060

61+
#### Using included script (recommended on Linux).
62+
A relatively simple way to build and install a project is to use the included build script:
63+
64+
```bash
65+
git clone https://github.com/kala13x/libxutils.git && ./libxutils/build.sh --install
66+
```
67+
68+
List options that build script supports:
69+
70+
- `--tool=<tool>` Specify `Makefile` generation tool or use included `Makefile`.
71+
- `--ssl=yes/no` Manually enable or disable SSL support (default: yes).
72+
- `--install` Install library and the tools after the build.
73+
- `--cleanup` Cleanup object files after build/installation.
74+
- `--examples` Include examples in the build.
75+
- `--tools` Include tools in the build.
76+
77+
You can either choose `cmake`, `smake` or `make` as the tool argument, but `cmake` is recommended on platforms other than the Linux.
78+
If the tool will not be specified the script will use `make` (included Makefile) as default.
79+
6180
#### Using CMake
62-
If you have a `CMake` tool installed in your operating system, this is probably the easiest and best way to build a project:
81+
If you have a `CMake` tool installed in your operating system, here is how project can be built and installed using `cmake`:
6382

6483
```bash
6584
git clone https://github.com/kala13x/libxutils.git
6685
cd libxutils
67-
mkdir build && cd build
68-
cmake .. && make
86+
cmake . && make
6987
sudo make install
7088
```
7189

@@ -79,19 +97,8 @@ smake && make
7997
sudo make install
8098
```
8199

82-
#### Using build script
83-
A relatively simple way to build and install a project is to use a build script.
84-
85-
```bash
86-
git clone https://github.com/kala13x/libxutils.git
87-
./libxutils/build.sh --tool=cmake --install --cleanup
88-
```
89-
90-
You can either choose `cmake`, `smake` or `make` as the tool argument, but `cmake` is recommended on the platforms other than the Linux.
91-
If the tool will not be specified the script will use `make` as default.
92-
93100
#### Using Makefile
94-
The project can also be built with a pre-generated `Makefile` for linux.
101+
The project can also be built with a pre-generated `Makefile` for the Linux.
95102

96103
```bash
97104
git clone https://github.com/kala13x/libxutils.git
@@ -154,20 +161,24 @@ Use build script to force disable SSL even if it is installed in the system:
154161
```
155162

156163
### Usage
157-
If you want to use the library, include the required `<xutils/*.h>` header files in your source code and\
158-
use `-lxutils` linker flag while compiling your project. See the example directory for more information.
164+
Just include the required `<xutils/*.h>` header files in your source code and use `-lxutils`\
165+
linker flag while compiling your project. See the example directory for more information.
159166

160167
### Tools & Examples
168+
Use the included script to build or install CLI apps from the `tools` directory.\
169+
The script can be used to build the sources from the `examples` directory as well.
161170

162-
The project includes samples and apps in the `examples` and `tools` directory.\
163-
These sources can be built by using the `CMake` tool or `Makefile` from that directory.
171+
```bash
172+
./libxutils/build.sh --tools --examples
173+
```
174+
175+
These sources can also be built by using the `CMake` tool or `Makefile` from that directory.\
176+
You may need to export the SSL flag accordingly if you are doing a build without the script:
164177

165178
```bash
166179
cd examples
167-
mkdir build
168-
cd build
169-
cmake ..
170-
make
180+
export XUTILS_USE_SSL=y
181+
cmake . && make
171182
```
172183

173184
#### XTOP and more

src/xver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#define XUTILS_VERSION_MAX 2
1414
#define XUTILS_VERSION_MIN 5
15-
#define XUTILS_BUILD_NUMBER 43
15+
#define XUTILS_BUILD_NUMBER 44
1616

1717
#ifdef __cplusplus
1818
extern "C" {

tools/xcrypt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static void XCrypt_DisplayUsage(const char *pName)
163163
xlog("the program will prompt you to enter the it securely.\n");
164164

165165
xlog("%s2%s) You can specify multiple ciphers with -c argument.", XSTR_FMT_BOLD, XSTR_FMT_RESET);
166-
xlog("The ciphers in the list must be separated separated by \":\".");
166+
xlog("The ciphers in the list must be separated by \":\".");
167167
xlog("%s%s -dc hex:aes:xor -i crypted.txt -o decrypted.bin%s\n", XSTR_FMT_DIM, pName, XSTR_FMT_RESET);
168168

169169
#ifdef _XUTILS_USE_SSL

0 commit comments

Comments
 (0)