Describe installation under Linux and Windows #519
Conversation
Signed-off-by: Maximilian Rosin <maximilian.rosin@parson-europe.com>
|
There are a couple of open questions:
|
Signed-off-by: Maximilian Rosin <maximilian.rosin@parson-europe.com>
Signed-off-by: Maximilian Rosin <maximilian.rosin@parson-europe.com>
|
@pmai do you see any update or changes that need to be done? |
PhRosenberger
left a comment
There was a problem hiding this comment.
- Should we mention that protobuf and osi versions must fit to the ones chosen within the tools?
- What about static vs. dynamic protobuf in Windows?
- Do we require specific minimum versions of cmake / protobuf?
| @@ -0,0 +1,54 @@ | |||
| = Installing OSI for C++ on Windows | |||
|
|
|||
| **Prerequisites** | |||
There was a problem hiding this comment.
Output CCB 09.06.2021:
- @pmai will provide a readme to enrich this section, for an easier windows installation process.
- This would not hold the merge process and can be adapted afterwards
There was a problem hiding this comment.
Using vcpkg to properly build the required configurations of protobuf on Visual Studio (here VS 2017):
-
Install vcpkg as per the documentation, e.g. clone via git the bootstrap as needed
-
English Language pack needs to be installed for VS 2017 for vcpkg to work
-
Create a new triplet file for the required combination of static library linking with dynamic runtime (usually needed for dynamic linking to still work):
I had to create a file named x64-windows-static-md-v141.cmake in the triplets directory with the following content:set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_PLATFORM_TOOLSET "v141")Note: only need the v141 suffix and setting of VCPKG_PLATFORM_TOOLSET to ensure VS 2017 is selected if you have newer VS installed (like I had).
-
Now the protobuf libraries can be built automatically using:
vcpkg.exe install protobuf:x64-windows-static-md-v141 -
Once built, they can be automatically used in building the examples by specifying the triplet and toolchain file from VCPKG on the cmake configuration command-line:
cd examples mkdir wbuild cd wbuild cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static-md-v141 -DCMAKE_TOOLCHAIN_FILE=../../../vcpkg/scripts/buildsystems/vcpkg.cmake -G 'Visual Studio 15 2017 Win64' cmake –build .
The CMAKE_TOOLCHAIN_FILE must point to your vcpkg directory, which in my example was parallel to the osi-sensor-model-packaging directory…
This might complain somewhat depending on cmake and compiler settings, but builds without problems (and should support release and debug builds out of the box).
|
Output CCB 09.06.2021: |
This PR resolves #518 .