Open hsgreen opened 4 years ago
Just wondering, could the snippet you posted not be part of the application cmake, and fetches libzmq before importing cppzmq?
Just wondering, could the snippet you posted not be part of the application cmake, and fetches libzmq before importing cppzmq?
I have tried that. It does not work because the find_package(ZeroMQ)
does not search for the "staged"/"to be built" library that was just pulled and WILL be built during the build process. It wants to find the fully installed ZeroMQ.
Is there another cmake
mechanism/command that will search for a dependency as part of the "build/_deps" directory?
I'm trying to accommodate a situation where I am building an application with cmake on a custom docker image to minimize extra tools that are installed. I'm also trying to simplify my installation process by having as many dependencies as possible to be built with cmake as part of my main application build so my application can have everything statically linked and not install any development/header files from the dependent libraries. It also eliminates having to customize installation scripts for various architectures of docker images I might be targeting.
I was hoping to use cppzmq, however, right now the cmake requires ZeroMQ to be preinstalled on the system and does not accommodate attempting to just pull it in and build through cmake if it is not present. https://github.com/zeromq/cppzmq/blob/master/CMakeLists.txt#L10-L17 It would be nice to not have to have a process outside of cmake that goes and installs ZeroMQ when it can be done easily from within CMake using the relatively new FetchContent... methods.
I would like to propose something similar to the following snippet be included in the
CMakeLists.txt
:Thank you for your consideration!