-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
CMake build on Linux does not export ZMQ_BUILD_DRAFT_API as a compile_definition with the target #4194
Comments
It's exported in pkgconfig, you can use that instead. If you want something cmake specific, please send a PR to implement it. |
The difficulty arises through a combination of two slightly different issues:
CMake does not have a tight integration between when finding packages using its own mechanisms or that provided by pkg-config. cppzmq for instance tries first using find_package() and if that fails then falls back to the pkg-config method using pkg_check_modules(). So when I want to use libzmq in my project its much cleaner to know that either find_package() will work OR that I have to use the pkg-config method. With Windows builds only supporting cmake and Windows not having pkg-config, I believe the proper multi-platform solution is to fix both these problems by ALWAYS installing ZeroMQConfig.cmake regardless of build method and fixing it to export the necessary #defines. I can probably raise a PR to fix the ZeroMQConfig.cmake but autoconf is absolute black magic to me and I would not feel confident in doing this. |
We can't support cmake stuff in autotools, that's not supported upstream and just too much work to do these kind of bol-ons. It's cmake-specific stuff, so to keep maintenance overhead down it's better to leave it with cmake alone. Please do send a PR to fix the variable exporting if you can. |
libzmq version = 4.3.4
Ubuntu 20.04 with cmake 3.16.3
Building with the following command after extracting the tarball and mkdir build; cd build.
cmake -D BUILD_SHARED=OFF -D ENABLE_CURVE=OFF -D ENABLE_DRAFTS=ON =WITH_LIBBSD=OFF -D WITH_LIBSODIUM=OFF ..
sudo make install
The FindPackage config module in /usr/local/lib/cmake/ZeroMQ has no mention of ZMQ_BUILD_DRAFT_API even though you now need it to use the cmake target libzmq-static.
I add the compile definition in my own CMakeLists.txt but the general idea of CMake is that I shouldn't need to. This is further exacerbated when using cppzmq which also requires the definition.
The text was updated successfully, but these errors were encountered: