Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build zeromq on Windows 10 with CMake

In the past I’ve used the Visual Studio solution files to build zeromq (libzmq) on Windows. I just noticed that the Visual Studio solutions have been deprecated because they are too difficult to maintain.

The alternative is to use CMake; trouble is I’ve no experience of how to invoke the build this way. Is anyone please able to demonstrate the necessary commands, step-by-step?

I’d like to achieve 32 & 64bit libzmq binaries using libsodium and compiled with VS2015 on Windows 10. (I’ve installed CMake 64bit and allowed it to add to the system path at installation.)

Thanks

like image 714
GoFaster Avatar asked Aug 28 '18 11:08

GoFaster


2 Answers

So eventually I managed to build zeromq on Windows 10 from source using CMake.

CMake is used to set the various zeromq project options; in this case to use the libsodium library for cryptography and to provide the necessary include & linker paths for the build. Once the options are configured CMake is used to generate a Visual Studio solution from which to build the libzmq binaries.

Briefly this is how I did it using the CMake GUI:

  1. Specify to where the libzmq source code was cloned and tell CMake where to build the binaries. Hint; make a separate folder for each Visual Studio version & 32/64bit as necessary, see screenshot below.

  2. Click Configure to load the project options. From the pop up window choose the compiler you wish to use from the list. Set the necessary project options and click Configure again.

  3. If all is well click Generate to create the Visual Studio files.

  4. Click Open Project; once loaded in Visual Studio choose Debug/Release as you need and click Build Solution.

  5. Repeat the process for other architectures eg. choose the 32bit compiler as you require. Remember to adjust build output location & libsodium linker path to reflect that architecture.

Screenshot: Cmake screenshot

like image 97
GoFaster Avatar answered Sep 19 '22 16:09

GoFaster


  1. VS2015 Toolbar -> Open -> CMake -> ZMQ folder

  2. Toolbar -> CMake -> Cache -> Generate -> ZeroMQ

  3. Toolbar -> CMake -> Install -> ZeroMQ

You can find builds in /Users/UserName/CMakeBuilds/...

like image 28
Alko Avatar answered Sep 20 '22 16:09

Alko