Skip to content
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

Support libzmq's Autotools Install: pkg-config #132

Closed
ax3l opened this issue Jul 14, 2017 · 4 comments
Closed

Support libzmq's Autotools Install: pkg-config #132

ax3l opened this issue Jul 14, 2017 · 4 comments

Comments

@ax3l
Copy link
Contributor

ax3l commented Jul 14, 2017

Following #127 and zeromq/libzmq#2621 (comment), the libzmq install via autotools is still a thing and used in packaging systems, too.

Albeit the autotools install lacks the install of CMake config modules, it would be great if we could add support for libzmq autotools-installs anyway.

One way could be to support the always-installed pkg-config module named libzmq in cppzmq's CMakeLists.txt.

For autotools based installs we could as a fallback to the current logic piggyback on pkg-config. This could look like this:

find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)

set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
find_library(ZeroMQ_LIBRARY NAMES libzmq.so
             PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq.a
             PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
@ax3l ax3l changed the title Support Autotools Install: pkg-config Support libzmq's Autotools Install: pkg-config Jul 14, 2017
@bluca
Copy link
Member

bluca commented Jul 14, 2017

Sounds good, could you please send a PR please?

Also to ensure maximum backward compatibility I would suggest looking for the CMake files first, and then pkgconfig as a fallback.

Otherwise a third project might start picking the system library unintentionally, for example.

@ax3l
Copy link
Contributor Author

ax3l commented Jul 14, 2017

sure, can do. the only point is that this is likely only helpful for *nix systems (and I have no access to other envs such as OSX/Win)

@bluca
Copy link
Member

bluca commented Jul 14, 2017

That's OK - if it's a fallback, it won't hurt. Thanks!

@ax3l
Copy link
Contributor Author

ax3l commented Jul 14, 2017

awww, since the last stable release someone started patching in targets for the two libzmq libs... The patch I proposed above won't cut that properly I guess... #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants