Skip to content

Commit 3577e6e

Browse files
committed
[readme] Update readme for Windows/MSVC build
1 parent 9cbf870 commit 3577e6e

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ This implementation is based on the following libraries :
3131
- [Build](#build)
3232
- [Pre-requisites](#pre-requisites)
3333
- [Build options](#build-options)
34+
- [Linux build](#linux-build)
35+
- [Windows build](#windows-build)
3436
- [Install and use](#install-and-use)
3537
- [Installation](#installation)
3638
- [Use with CMake](#use-with-cmake)
@@ -327,9 +329,8 @@ The behavior and the configuration of the **Open OCPP** stack can be modified th
327329

328330
* A fully C++17 compliant compiler
329331
* OpenSSL library v1.1.1 or greater
330-
* SQLite 3 library
331332
* CMake 3.13 or greater
332-
* Make 4.1 or greater
333+
* Make 4.1 or greater (for Linux build only)
333334
* curl 7.70 or greater (for examples only, to allow diagnotics uploads)
334335
* zip 3.0 or greater (for examples only, to allow diagnotics uploads)
335336

@@ -338,37 +339,57 @@ For information, most of the development has been made on the following environm
338339
* Debian 11 (Bullseye)
339340
* gcc 10.2 and clang 11.0
340341
* OpenSSL 1.1.1k
341-
* SQLite 3.34.1
342342
* CMake 3.18
343343
* Make 4.3
344344

345345
### Build options
346346

347347
The build is based on CMake, the following definitions must be passed to the CMake command to customize the build :
348348

349-
* **TARGET** : Allow to load the appropriate *CMakeLists_TARGET.txt* file
349+
* **TARGET** : Allow to load the appropriate *CMakeLists_TARGET.txt* file => not needed for native GCC/CLang or MSVC since it will be automatically detected
350350
* **BIN_DIR** : Output directory for the generated binaries
351351
* **CMAKE_BUILD_TYPE** : Can be set to either Debug or Release (Release build produces optimized stripped binaries)
352352

353353
Additionnaly, the **CMakeLists_Options.txt** contains several options that can be switched on/off.
354354

355+
The build generates 2 flavors of the **Open OCPP** library depending on the needs of your project :
356+
* Shared : libopen-ocpp.so
357+
* Static : libopen-ocpp_static.a
358+
359+
**Note**: When using **Open OCPP** in a non GNU LGPL project, the shared library must be used in order to not contaminate your project with the LGPL licence (see [Wikipedia GNU LGPL article](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Differences_from_the_GPL))
360+
361+
### Linux build
362+
355363
An helper makefile is available at project's level to simplify the use of CMake. Just use the one of the following commands to build using gcc or gcc without cross compilation :
356364

357-
```make gcc-native``` or ```make clang-native``` or ```make gcc-native BUILD_TYPE=Debug``` or ```make clang-native BUILD_TYPE=Debug```
365+
```make gcc``` or ```make clang``` or ```make gcc BUILD_TYPE=Debug``` or ```make clang BUILD_TYPE=Debug```
358366

359367
This makefile also contains the corresponding cleaning targets :
360368

361-
```make clean-gcc-native``` or ```make clean-clang-native```
369+
```make clean-gcc``` or ```make clean-clang```
362370

363371
And to run the unit tests :
364372

365-
```make tests-gcc-native``` or ```make tests-clang-native```
373+
```make tests-gcc``` or ```make tests-clang```
366374

367-
The build generates 2 flavors of the **Open OCPP** library depending on the needs of your project :
368-
* Shared : libopen-ocpp.so
369-
* Static : libopen-ocpp_static.a
375+
### Windows build
370376

371-
**Note**: When using **Open OCPP** in a non GNU LGPL project, the shared library must be used in order to not contaminate your project with the LGPL licence (see [Wikipedia GNU LGPL article](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Differences_from_the_GPL))
377+
**Open OCPP** can be generated on Window plateform using Visual Studio 2022 Community Edition. To open and build the project please follow the standard instructions from Microsoft to [build a CMake based project in Visual Studio](https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170).
378+
379+
You will have to install first a full Windows package of the OpenSSL library (including headers). One can be found on this website : https://slproweb.com/products/Win32OpenSSL.html (do not download the "Light" versions which are not embedding the headers).
380+
381+
Then the following environment variables must be defined to allow Visual Studio/CMake to find the installed OpenSSL package :
382+
383+
* OPENSSL_INCLUDE_DIR
384+
* OPENSSL_ROOT_DIR
385+
386+
Example for a 64-bit OpenSSL package download from the mentioned website and installed in the default folder :
387+
388+
```OPENSSL_INCLUDE_DIR = C:\Program Files\OpenSSL-Win64\include```
389+
390+
```OPENSSL_ROOT_DIR = C:\Program Files\OpenSSL-Win64```
391+
392+
**Note** : Do not forget to close and re-open Visual Studio after having modified the environment variables to have them taken into account
372393

373394
## Install and use
374395
### Installation
@@ -379,7 +400,7 @@ The build generates 2 flavors of the **Open OCPP** library depending on the need
379400

380401
The makefile contains helper targets which can be called if the installation needs to be done in a non standard directory using the variable *INSTALL_PREFIX* :
381402

382-
```make install-gcc-native INSTALL_PREFIX=/your/directory``` or ```make install-clang-native INSTALL_PREFIX=/your/directory```
403+
```make install-gcc INSTALL_PREFIX=/your/directory``` or ```make install-clang INSTALL_PREFIX=/your/directory```
383404

384405
If run without the *INSTALL_PREFIX* variable, it will install in the standard system directories.
385406

0 commit comments

Comments
 (0)