使用CMake在Windows 10上构建ZeroMQ [英] Build zeromq on Windows 10 with CMake

查看:319
本文介绍了使用CMake在Windows 10上构建ZeroMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去,我曾使用Visual Studio解决方案文件在Windows上构建zeromq(libzmq).我只是注意到Visual Studio解决方案已被

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

解决方案

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在Windows 10上构建ZeroMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆