|
1 | 1 | # Install Ulfius |
2 | 2 |
|
3 | | -- [Distribution packages](#distribution-packages) |
4 | | -- [Manual install](#manual-install) |
5 | | - - [Prerequisites](#prerequisites) |
6 | | - - [CMake - Multi architecture](#cmake---multi-architecture) |
7 | | - - [Good ol' Makefile](#good-ol-makefile) |
| 3 | +- [Install Ulfius](#install-ulfius) |
| 4 | + - [Distribution packages](#distribution-packages) |
| 5 | + - [Manual install](#manual-install) |
| 6 | + - [Prerequisites](#prerequisites) |
| 7 | + - [CMake - Multi architecture](#cmake---multi-architecture) |
| 8 | + - [CMake / Win32 / MinGW Quickstart](#cmake--win32--mingw-quickstart) |
8 | 9 |
|
9 | 10 | ## Distribution packages |
10 | 11 |
|
@@ -184,3 +185,51 @@ The available options for CMake are: |
184 | 185 | - `-DBUILD_DEB=[on|off]` (default `off`): Build DEB package when running `make package` |
185 | 186 | - `-DBUILD_RPM=[on|off]` (default `off`): Build RPM package when running `make package` |
186 | 187 | - `-DCMAKE_BUILD_TYPE=[Debug|Release]` (default `Release`): Compile with debugging symbols or not |
| 188 | + |
| 189 | +#### CMake / Win32 / MinGW Quickstart |
| 190 | + |
| 191 | +1. Install [MSYS2](https://www.msys2.org/) and start your preferred environment (ucrt64.exe is suggested and used in this example) |
| 192 | +2. Install the required libraries |
| 193 | + |
| 194 | +```shell |
| 195 | +pacman -S mingw-w64-ucrt-x86_64-gcc |
| 196 | +pacman -S mingw-w64-ucrt-x86_64-libmicrohttpd |
| 197 | +pacman -S mingw-w64-ucrt-x86_64-curl |
| 198 | +pacman -S mingw-w64-ucrt-x86_64-jansson |
| 199 | +``` |
| 200 | + |
| 201 | +3. Build and install orcania into your MSYS environment: |
| 202 | + |
| 203 | +```shell |
| 204 | +git clone https://github.com/babelouest/orcania.git |
| 205 | +cmake -G Ninja -DCMAKE_C_COMPILER=C:/msys64/ucrt64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/ucrt64/bin/g++.exe -DBUILD_STATIC=ON -DBUILD_BASE64URL=OFF -DCMAKE_INSTALL_PREFIX=C:/msys64/ucrt64/ -B ./orcania/build orcania |
| 206 | +cmake --build ./orcania/build |
| 207 | +cmake --install ./orcania/build |
| 208 | +``` |
| 209 | + |
| 210 | +4. Build and install yder into your MSYS environment: |
| 211 | + |
| 212 | +```shell |
| 213 | +git clone https://github.com/babelouest/yder.git |
| 214 | +cmake -G Ninja -DCMAKE_C_COMPILER=C:/msys64/ucrt64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/ucrt64/bin/g++.exe -DBUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX=C:/msys64/ucrt64/ -B ./yder/build yder |
| 215 | +cmake --build ./yder/build |
| 216 | +cmake --install ./yder/build |
| 217 | +``` |
| 218 | + |
| 219 | +5. Add ulfius to your application CMakeLists.txt, make sure to replace YOUR_ULFIUS_SRC_PATH |
| 220 | + |
| 221 | +```CMake |
| 222 | +# Adjust these and other option flags as you desire |
| 223 | +option(BUILD_STATIC "..." ON) |
| 224 | +option(BUILD_SHARED "..." OFF) |
| 225 | +option(WITH_YDER "..." OFF) |
| 226 | +option(BUILD_UWSC "..." OFF) |
| 227 | +set(MHD_LIBRARY "C:/msys64/ucrt64/lib/libmicrohttpd.a") |
| 228 | +set(MHD_INCLUDE_DIR "C:/msys64/ucrt64/include") |
| 229 | +add_subdirectory(YOUR_ULFIUS_SRC_PATH ulfius) |
| 230 | +
|
| 231 | +target_link_libraries(app PRIVATE ulfius_static) |
| 232 | +
|
| 233 | +target_link_libraries(app PRIVATE ${MHD_LIBRARY}) |
| 234 | +target_link_libraries(app PRIVATE ws2_32) |
| 235 | +``` |
0 commit comments