58
58
### Installation
59
59
There are several ways to build and install the project.
60
60
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
+
61
80
#### 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 ` :
63
82
64
83
``` bash
65
84
git clone https://github.com/kala13x/libxutils.git
66
85
cd libxutils
67
- mkdir build && cd build
68
- cmake .. && make
86
+ cmake . && make
69
87
sudo make install
70
88
```
71
89
@@ -79,19 +97,8 @@ smake && make
79
97
sudo make install
80
98
```
81
99
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
-
93
100
#### 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 .
95
102
96
103
``` bash
97
104
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:
154
161
```
155
162
156
163
### 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.
159
166
160
167
### 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.
161
170
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:
164
177
165
178
``` bash
166
179
cd examples
167
- mkdir build
168
- cd build
169
- cmake ..
170
- make
180
+ export XUTILS_USE_SSL=y
181
+ cmake . && make
171
182
```
172
183
173
184
#### XTOP and more
0 commit comments