cppzmq
cppzmq copied to clipboard
Error message for missing shared or static ZMQ library is not clear
I'm not sure if this is logic to improve (meaning it should only fail if both shared and static libraries are not created) or an error message to be improved.
I've compile libZMQ 4.3.1 with only a static library. Then when I try to cmake cppzmq it fails with the following
cmake -D ZeroMQ_DIR="C:\Users\rocha\REPO2\build_rocha\depot\Stratovan\Library\3rdParty\libzmq\INSTALL\NEW\CMake" ..\cppzmq-4.3.0 -- Detected CPPZMQ Version - 4.3.0 CMake Error at CMakeLists.txt:24 (message): ZeroMQ version not supported!
This message looks like its a version mismatch between CPPZMQ @ 4.3.0 and libZMQ @ 4.3.1. However, when I looked at the logic I see the following:
if (ZeroMQ_FOUND AND (NOT TARGET libzmq OR NOT TARGET libzmq-static)) message(FATAL_ERROR "ZeroMQ version not supported!") endif()
The problem is that we found ZMQ package but we don't have libzmq (because I didn't make the shared library).
If CPPZMQ only requires one of the library, static or shared, then the logic should be changed from OR to AND.
If CPPZMQ requres both static and shared libraries, then I would recommend changing the error message to indicate the actual problem. The specified version of ZMQ is missing the <static,shared> library
As said in the libzmq issue, you don't really need to build anything for cppzmq, however if you want to integrate it via cmake means, it would be nice if it worked with only one of the libzmq flavors as well.
If you want to contribute a fix for the CMakeLists.txt to allow for that, it would be great.
Also, I agree the message is misleading. I suspect it goes back to some very old versions of libzmq, and cppzmq started working only with some particular version.