Cannot build with MSYS2, possibly due to incorrect find of libzmq

Open
#645 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cmake, cpp
Domain
build-system

Research direction

Start with CMakeLists.txt at the linked target definition and libzmq-pkg-config/FindZeroMQ.cmake, then inspect the generated cppzmqTargets.cmake under share/cmake/cppzmq. Reproduce the MSYS2 Ninja build and verify that the exported target names the installed ZeroMQ library correctly and no longer produces libzmq-NOTFOUND.

Written by the indexing model from the issue text.

Description

I'm linking a cmake project against cppzmq 4.7.1, and the build steps fails with

ninja: error: 'libzmq-NOTFOUND', needed by '<binary>.exe', missing and no known rule to make it

I discovered that libzmq is found fine, however the file <prefix>/share/cmake/cppzmq/cppzmqTargets.cmake includes this code

set_target_properties(cppzmq PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "libzmq"
)

so it is declaring a linked library "libzmq". Imo, this should be "zmq", as the "lib" prefix is automatically added. If I change "libzmq" to just "zmq", the problem goes away.

Is this related to the use of "libzmq" here or here maybe?

Dominant language
C++
Stars
2.3k
Forks
798
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zeromq/cppzmq

All issues in zeromq/cppzmq

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.