zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.95k stars 757 forks source link

cppzmq does not work with CMake FetchContent_Declare #436

Closed woojung3 closed 4 years ago

woojung3 commented 4 years ago

In my CMakeLists.txt, I Fetch libzmq and cppzmq in the following order:

FetchContent_Declare( zeromq GIT_REPOSITORY https://github.com/zeromq/libzmq.git GIT_TAG v4.3.2 ) FetchContent_Declare( cppzmq GIT_REPOSITORY https://github.com/zeromq/cppzmq.git GIT_TAG v4.6.0 ) FetchContent_MakeAvailable(zeromq cppzmq)

This should work (I think), but it fails with "CMake libzmq package not found". My guess is that line 11 to 25 of cppzmq's CMakeLists.txt, which uses "ZeroMQ_FOUND" is causing the issue.

Could you patch your CMakeLists.txt so that cppzmq can go along with FetchContent?

Thank you for your help

woojung3 commented 4 years ago

Already changed in master. closing issue.

Mizux commented 4 years ago

For the record duplicate of #394 which has been fixed by the PR #395