-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe installation under Linux and Windows #519
Conversation
Signed-off-by: Maximilian Rosin <[email protected]>
There are a couple of open questions:
|
Signed-off-by: Maximilian Rosin <[email protected]>
Signed-off-by: Maximilian Rosin <[email protected]>
@pmai do you see any update or changes that need to be done? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 .