ets2-job-logger icon indicating copy to clipboard operation
ets2-job-logger copied to clipboard

CMake do not find msgpack on Windows

Open Lihis opened this issue 4 years ago • 4 comments

Build fails as CMake do not find Findmsgpack.cmake, see: https://ci.appveyor.com/project/Lihis/ets2-job-logger/builds/42129622.

Lihis avatar Jan 08 '22 16:01 Lihis

There seem to be two options to fix this:

  1. I think this is the simplest. You need to use VC 2019, don't know why but for 2017 it doesn't work automatically. So, before opening the project, you need to install the dependent libraries in (vcpkg) :
vcpkg install msgpack:x64-windows
vcpkg install websocketpp:x64-windows
vcpkg install jsoncpp:x64-windows
vcpkg install wxWidgets:x64-windows
vcpkg install boost:x64-windows

this may take about an hour. When the libraries are installed, you need to do the integration: vcpkg integrate install

Now this problem should not appear.

  1. This way is suitable for VC 2017. You also need to install the libraries from the first method. Now that they have been installed, you need to copy and paste each library into their respective conan folders : C:\Users\your name\.conan\data\

now the cache should be generated without problems

ResTedRU avatar Jan 15 '22 14:01 ResTedRU

  1. I think this is the simplest. ... you need to install the dependent libraries in ... this may take about an hour.

I have mixed feelings about this option.. An hour for installing dependencies doesn't sound good. If every build on CI takes an hour, not that it will eat up CI usage but also have to wait a long time to see that the build passes. But in other hand it sounds a bit more pleasant to use than Conan; no need to hardcode library versions (unless Conan supports something like latest in the conanfile.txt) and iirc it might be easier to integrate with VS.

  1. This way is suitable for VC 2017.

I think we should not use two package managers.


So in summary, unless vcpkg install step can't be speed up by utilizing a caching or something on CI so at least consecutive builds takes as long as the builds took with Conan (I think about 5-10 minutes) then I would stick with Conan. Quick googling makes the difference between these two clear; vcpkg builds from source when you do the install while Conan downloads pre-built binary.

And what it comes to Conan, question is have they stopped packaging the msgpackConfig.cmake file? Or has Conan also received some bigger changes which effectively has broken our usage (need to do some manual migration like had to with the Bincrafters?). This seems interesting Conan-CMake transparent integration.

Lihis avatar Jan 16 '22 13:01 Lihis

An hour for installing dependencies doesn't sound good.

It depends on your PC, on one it took me almost an hour, on my home computer I installed it within 10 minutes, I wrote about an hour so that it would not be a surprise if someone tries it.

they stopped packaging the msgpackConfig.cmake file?

I didn't find any information about it. But I must say that after I was able to fix the error with msgpack, I got the same error for jsoncpp - the settings files were also needed (jsoncppConfig.cmake). So in my opinion the best solution is to use VC 2019

ResTedRU avatar Jan 16 '22 14:01 ResTedRU

10 minutes is still reasonable and hopefully CI could get close to that so in that case vcpkg sounds better option.

Lihis avatar Jan 16 '22 15:01 Lihis