zeromq / czmq

High-level C binding for ØMQ
czmq.zeromq.org
Mozilla Public License 2.0
1.16k stars 523 forks source link

use CPM.cmake #2200

Closed ClausKlein closed 2 years ago

ClausKlein commented 2 years ago

Pull Request Notice

demonstrate the build of libzmq as sub-project instead of usefind_packages()

sphaero commented 2 years ago

I have this on my todo list, bare with me

sphaero commented 2 years ago

Thanks for demonstrating this. I didn't know about CPM. From what I can see the change was only to replace the libzmq findpackage script with CPM. Most other changes were esthetic.

Since the CMakeLists.txt is generated by zproject this change couldn't happen anyway. We'd need to add it to zproject.

I'm not sure if it would fix the problems we have with cmake:

https://github.com/zeromq/zproject/issues?q=is%3Aissue+is%3Aopen+cmake https://github.com/zeromq/czmq/issues?q=is%3Aissue+cmake+is%3Aopen

Was there anything specific to your fork of libzmq? From what I saw it wasn't?

ClausKlein commented 2 years ago

Thanks for demonstrating this. I didn't know about CPM. From what I can see the change was only to replace the libzmq findpackage script with CPM. Most other changes were esthetic.

Since the CMakeLists.txt is generated by zproject this change couldn't happen anyway. We'd need to add it to zproject.

I'm not sure if it would fix the problems we have with cmake:

https://github.com/zeromq/zproject/issues?q=is%3Aissue+is%3Aopen+cmake https://github.com/zeromq/czmq/issues?q=is%3Aissue+cmake+is%3Aopen

Was there anything specific to your fork of libzmq? From what I saw it wasn't?

CPMAddPackage(
  NAME libzmq
  GITHUB_REPOSITORY ClausKlein/libzmq
  GIT_TAG 5438860e581b866432c087a11facee1036122e3b
)

this is a bug fixed version, because the current release does not build on OSX! see https://github.com/zeromq/libzmq/issues/4249

sphaero commented 2 years ago

Ah I see,

I think the problem with current FindLibzmq scripts and others is that they are not very conforming to modern cmake. They are not very easy to use if you have multiple zeromq projects as add_subdirectories. So these scripts need to be modernized so they can find either a system installed version or a source included (aka subdirectory)