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

ZeroMQConfig.cmake fails if shared libraries are not built #3494

Closed
RochaStratovan opened this issue May 7, 2019 · 3 comments · Fixed by #3497
Closed

ZeroMQConfig.cmake fails if shared libraries are not built #3494

RochaStratovan opened this issue May 7, 2019 · 3 comments · Fixed by #3497

Comments

@RochaStratovan
Copy link

Issue description

I found that the ZeroMQConfig.cmake file will not work if the shared libraries are not created. It will fail with the message

CMake Error at c:/3rdParty/libzmq/INSTALL/CLEAN/CMake/ZeroMQConfig.cmake:46 (get_target_property):
  get_target_property() called with non-existent target "libzmq".
Call Stack (most recent call first):
  CMakeLists.txt:9 (find_package)


CMake Error at C:/3rdParty/libzmq/INSTALL/CLEAN/CMake/ZeroMQConfig.cmake:47 (get_target_property):
  get_target_property() called with non-existent target "libzmq".
Call Stack (most recent call first):
  CMakeLists.txt:9 (find_package)

This configuration was done using the following cmake command line:

cmake -D WITH_PERF_TOOL=OFF -D ZMQ_BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=..\..\INSTALL\CLEAN -D ENABLE_CPACK=OFF -D BUILD_SHARED=OFF ..\..\libzmq-4.3.1

And then attempting to compile CPPZMQ 4.3.0 using the command line:

cmake -D ZeroMQ_DIR=C:/3rdParty/libzmq/INSTALL/CLEAN/CMake ..\cppzmq-4.3.0

I confirmed that if I removed -D BUILD_SHARED=OFF from the ZMQ compile/install then the previous mentioned error would not occur.

Environment

  • libzmq version (commit hash if unreleased): 4.3.1
  • OS: Windows 10

Minimal test code / Steps to reproduce the issue

  1. See description

What's the actual result? (include assertion message & call stack if applicable)

See description.

What's the expected result?

Expected result is that the cmake completes without any error when using find_package() for ZeroMQ.

@sigiesec
Copy link
Member

sigiesec commented May 8, 2019

Thanks for pointing this out. I have opened #3497 to solve this, but I didn't test it. Could you check if the patch solves your issue?

@RochaStratovan
Copy link
Author

RochaStratovan commented May 8, 2019 via email

@sigiesec
Copy link
Member

sigiesec commented May 9, 2019

Since cppzmq is a header-only library, there is no need to build it. The build files are only needed for the tests.

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

Successfully merging a pull request may close this issue.

3 participants